/* Arif Al Mamun: monochrome editorial theme, black type on white.
   Colours are limited to black, white and greys. Do not add accent colours. */

:root {
  --bg: #ffffff;
  --surface: #f4f4f4;
  --surface-2: #eeeeee;
  --fg: #000000;
  --text-2: #333333;
  --text-3: #767676;
  --rule: rgba(0, 0, 0, 0.15);
  --rule-faint: rgba(0, 0, 0, 0.07);

  --serif: "Cormorant Garamond", "Iowan Old Style", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --wrap: 1240px;
  --gutter: clamp(16px, 4vw, 48px);
  --inset: clamp(0px, 3vw, 44px);
  --label-col: 13rem;
  --header-h: 68px;
}

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

html {
  background: var(--bg);
  color-scheme: light;
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 24px);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.65;
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; height: auto; }
picture { display: block; }
a { color: inherit; }
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }
ul, ol { margin: 0; padding: 0; }
cite { font-style: normal; }
b, strong { font-weight: 600; color: var(--fg); }

::selection { background: var(--fg); color: var(--bg); }

:focus-visible {
  outline: 2px solid var(--fg);
  outline-offset: 3px;
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: 16px; top: -100px; z-index: 100;
  background: var(--fg); color: var(--bg);
  padding: 10px 16px; font-weight: 600; text-decoration: none;
}
.skip-link:focus { top: 12px; }

.muted { color: var(--text-3); }
.print-only { display: none; }

/* ---------------------------------------------------------------- frame + wrap */
.wrap {
  width: min(100% - 2 * var(--gutter), var(--wrap));
  margin-inline: auto;
  padding-inline: var(--inset);
}

main, .site-footer { position: relative; z-index: 1; }
main { overflow-x: clip; }

/* Photographs bleed off the edge of the page and dissolve into the white.
   Two masks are intersected: a side fade and a bottom fade. */
.fade-photo picture,
.hero-portrait picture {
  height: 100%;
  -webkit-mask-image: var(--fade-side), linear-gradient(to top, transparent 0%, #000 24%);
  mask-image: var(--fade-side), linear-gradient(to top, transparent 0%, #000 24%);
  -webkit-mask-composite: source-in;
  mask-composite: intersect;
}
.fade-photo img,
.hero-portrait img { width: 100%; height: 100%; object-fit: cover; }

/* ---------------------------------------------------------------- header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--bg);
  border-bottom: 1px solid var(--rule);
}

.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  min-height: var(--header-h);
  gap: 24px;
}

.wordmark,
.site-nav a {
  font-family: var(--serif);
  font-variant-caps: all-small-caps;
  letter-spacing: 0.16em;
  text-decoration: none;
}

.wordmark {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--fg);
  white-space: nowrap;
}

.site-nav ul { display: flex; gap: clamp(14px, 2vw, 30px); list-style: none; }

.site-nav a {
  font-size: 1.15rem;
  font-weight: 500;
  color: var(--text-3);
  padding: 6px 0;
  border-bottom: 1px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}
.site-nav a:hover { color: var(--fg); }
.site-nav a[aria-current="page"] { color: var(--fg); border-bottom-color: var(--fg); }

.menu-toggle {
  display: none;
  background: none; color: var(--fg);
  border: 1px solid var(--rule);
  font-family: var(--serif); font-variant-caps: all-small-caps; letter-spacing: 0.16em;
  font-size: 1.15rem; font-weight: 500;
  padding: 6px 14px; cursor: pointer;
}

/* ---------------------------------------------------------------- shared type */
.page-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.2rem, 4.2vw, 3.4rem);
  line-height: 1;
  letter-spacing: -0.015em;
  margin: 0 0 0.35em;
}

.lede {
  font-family: var(--serif);
  font-size: clamp(1.1rem, 1.6vw, 1.35rem);
  line-height: 1.45;
  color: var(--text-2);
  max-width: 34em;
}

.text-link {
  display: inline-block;
  margin-top: 28px;
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--fg);
  text-decoration: underline;
  text-decoration-color: var(--text-3);
  text-underline-offset: 5px;
  transition: text-decoration-color 0.2s;
}
.text-link:hover { text-decoration-color: var(--fg); }

.block-body a:not(.btn):not(.pub-link):not(.text-link),
.related a,
.index a {
  text-decoration: underline;
  text-decoration-color: var(--rule);
  text-underline-offset: 4px;
  transition: text-decoration-color 0.2s;
}
.block-body a:not(.btn):not(.pub-link):not(.text-link):hover,
.related a:hover,
.index a:hover { text-decoration-color: var(--fg); }

/* ---------------------------------------------------------------- buttons */
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px;
  padding: 12px 24px;
  font-family: var(--sans);
  font-size: 0.92rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--fg);
  background: transparent;
  border: 1px solid var(--fg);
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s;
}
.btn:hover { background: var(--fg); color: var(--bg); }
.btn-solid { background: var(--fg); color: var(--bg); }
.btn-solid:hover { background: var(--bg); color: var(--fg); }
.btn-large { min-height: 56px; padding-inline: 32px; font-size: 1rem; }

.profile-links {
  display: flex; flex-wrap: wrap; gap: 8px 24px;
  list-style: none;
  margin-top: 28px;
  font-size: 0.9rem;
}
.profile-links a {
  color: var(--text-2);
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 2px;
  transition: color 0.2s, border-color 0.2s;
}
.profile-links a:hover { color: var(--fg); border-bottom-color: var(--fg); }

/* ---------------------------------------------------------------- home: hero */
/* Portrait on the left, bleeding off the page edge and fading right into the text */
.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  align-items: center;
  min-height: calc(100svh - var(--header-h));
  padding-block: clamp(48px, 8vh, 96px);
}

.hero-portrait {
  --fade-side: linear-gradient(to left, transparent 0%, #000 46%);
  position: absolute;
  top: 0; bottom: 0;
  left: calc(50% - 50vw);
  width: 60vw;
  margin: 0;
  z-index: 0;
}
.hero-portrait img { object-position: 30% 35%; }

.hero-text { position: relative; z-index: 1; grid-column: 2; }

.hero-name {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(3.4rem, 7.6vw, 8rem);
  line-height: 1;
  letter-spacing: -0.02em;
  margin: 0 0 36px;
}
.hero-name .line { display: flex; align-items: center; }
.hero-name .line + .line { margin-top: 0.16em; }

/* Element tile: a periodic-table square picked out of each name */
.el {
  position: relative;
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 1.06em;
  height: 1.06em;
  margin-right: 0.06em;
  background: var(--fg);
  color: var(--bg);
  border: 1px solid var(--fg);
  outline: 1px solid var(--fg);
  outline-offset: 3px;
}
.el-s { font-weight: 500; font-size: 0.82em; line-height: 1; letter-spacing: -0.01em; transform: translateY(-0.02em); }
.el-n,
.el-m {
  position: absolute;
  font-family: var(--mono);
  font-size: max(0.1em, 9px);
  line-height: 1;
  letter-spacing: 0;
}
.el-n { top: 0.4em; right: 0.45em; }
.el-m { bottom: 0.38em; left: 0.45em; }
.hero-name .rest { white-space: pre; }

.hero-tagline {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(1.4rem, 2.2vw, 1.85rem);
  line-height: 1.3;
  color: var(--fg);
  max-width: 24em;
  margin-bottom: 18px;
}

.hero-summary {
  color: var(--text-2);
  font-size: 1.02rem;
  max-width: 36em;
  margin-bottom: 0.8em;
}

/* One orchestrated entrance on the home page */
@media (prefers-reduced-motion: no-preference) {
  .page-home .hero-name .line,
  .page-home .hero-tagline,
  .page-home .hero-summary,
  .page-home .hero .actions,
  .page-home .hero .profile-links {
    animation: rise 0.9s cubic-bezier(0.2, 0.7, 0.1, 1) both;
  }
  .page-home .hero-name .line:nth-of-type(2) { animation-delay: 0.08s; }
  .page-home .hero-tagline { animation-delay: 0.2s; }
  .page-home .hero-summary { animation-delay: 0.28s; }
  .page-home .hero .actions { animation-delay: 0.36s; }
  .page-home .hero .profile-links { animation-delay: 0.42s; }
  .page-home .hero-portrait { animation: develop 1.8s cubic-bezier(0.3, 0.6, 0.1, 1) both; }
}

@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes develop {
  from { opacity: 0; filter: brightness(1.8) contrast(0.6); }
  to { opacity: 1; filter: none; }
}

/* ---------------------------------------------------------------- blocks + index */
.block {
  display: grid;
  grid-template-columns: var(--label-col) minmax(0, 1fr);
  column-gap: 32px;
  padding-block: clamp(40px, 6vw, 72px);
  border-top: 1px solid var(--rule);
}
.block:first-child { border-top: 0; }
.home-sections { border-top: 1px solid var(--rule); }

.block-title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.45rem;
  line-height: 1.2;
  margin: 0 0 20px;
}

.block-body { color: var(--text-2); max-width: 52rem; }
.block-body > p { max-width: 40em; }

.index { margin: 0; }
.index-row {
  display: grid;
  grid-template-columns: 11rem minmax(0, 1fr);
  gap: 8px 24px;
  padding-block: 16px;
  border-top: 1px solid var(--rule);
}
.index-row:first-child { border-top: 0; padding-top: 0; }
.index dt {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--text-3);
  padding-top: 0.25em;
}
.index dd { margin: 0; color: var(--text-2); max-width: 40em; }
.index b { font-weight: 500; }
.index-tight .index-row { grid-template-columns: 9rem minmax(0, 1fr); padding-block: 12px; }
.index-tight .index-row:first-child { padding-top: 0; }

.plain-list { list-style: none; }
.plain-list li { padding-left: 1.1em; position: relative; margin-bottom: 0.5em; }
.plain-list li::before {
  content: ""; position: absolute; left: 0; top: 0.78em;
  width: 0.45em; height: 1px; background: var(--text-3);
}

/* ---------------------------------------------------------------- page head */
.page-head {
  position: relative;
  padding-top: clamp(36px, 5vw, 64px);
  padding-bottom: clamp(28px, 4vw, 48px);
  border-bottom: 1px solid var(--rule);
}
.page-head-text { position: relative; z-index: 1; max-width: 46rem; }
.page-head .actions { margin-top: 36px; }

/* Inner pages: photo bleeds off the right edge and fades left into the title */
.page-head.has-photo { min-height: min(46vh, 400px); display: flex; align-items: flex-end; }
.page-head.has-photo .page-head-text { max-width: min(46rem, 58%); }
/* The photo keeps its own shape at the full header height, so faces are never cropped or blown up */
.fade-photo {
  --fade-side: linear-gradient(to right, transparent 0%, #000 45%);
  position: absolute;
  top: 0; bottom: 0;
  right: calc(50% - 50vw);
  width: auto;
  max-width: 55vw;
  aspect-ratio: var(--ar, 1 / 1);
  margin: 0;
  z-index: 0;
}
.fade-photo img { object-position: var(--pos, 50% 40%); }
.photo-left .fade-photo {
  --fade-side: linear-gradient(to left, transparent 0%, #000 45%);
  right: auto;
  left: calc(50% - 50vw);
}
.page-head.photo-left .page-head-text { margin-left: auto; }

/* ---------------------------------------------------------------- research */
.themes { border-top: 1px solid var(--rule); }
.theme {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 24px 48px;
  padding-block: clamp(40px, 6vw, 72px);
  border-bottom: 1px solid var(--rule);
}
.theme-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.9rem, 3.4vw, 2.8rem);
  line-height: 1.05;
  margin: 0;
  max-width: 11em;
}
.theme-body { color: var(--text-2); max-width: 40em; }
.theme-label {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--text-3);
  margin: 28px 0 10px;
}
.related { list-style: none; }
.related li {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.15rem;
  line-height: 1.35;
  color: var(--fg);
  padding-block: 10px;
  border-top: 1px solid var(--rule);
}
.related .muted { font-style: normal; font-family: var(--mono); font-size: 0.75rem; }
.page-work .block:first-child { border-top: 0; }

/* ---------------------------------------------------------------- publications */
.pub-controls {
  position: sticky;
  top: var(--header-h);
  z-index: 10;
  background: var(--bg);
  padding-block: 24px 20px;
  border-bottom: 1px solid var(--rule);
  display: grid;
  gap: 18px;
}

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font-family: var(--sans);
  font-size: 0.85rem;
  color: var(--text-2);
  background: transparent;
  border: 1px solid var(--rule);
  padding: 8px 14px;
  min-height: 40px;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, background-color 0.2s;
}
.chip:hover { border-color: var(--fg); color: var(--fg); }
.chip[aria-pressed="true"] { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.chip-count { font-family: var(--mono); font-size: 0.72rem; margin-left: 4px; opacity: 0.7; }

.pub-fields { display: flex; flex-wrap: wrap; gap: 16px 32px; align-items: end; }
.field { display: grid; gap: 4px; }
.field-search { flex: 1 1 280px; max-width: 460px; }
.field-label { font-family: var(--mono); font-size: 0.72rem; color: var(--text-3); }
.field select,
.field input {
  font: inherit;
  font-size: 0.95rem;
  color: var(--fg);
  background: var(--bg);
  border: 0;
  border-bottom: 1px solid var(--text-3);
  border-radius: 0;
  padding: 8px 0;
  min-height: 40px;
  width: 100%;
  appearance: none;
}
.field select {
  min-width: 9rem;
  padding-right: 22px;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-2) 50%), linear-gradient(135deg, var(--text-2) 50%, transparent 50%);
  background-position: calc(100% - 9px) 55%, calc(100% - 4px) 55%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
  cursor: pointer;
}
.field input::placeholder { color: var(--text-3); }
.field select:focus-visible, .field input:focus-visible { outline: none; border-bottom-color: var(--fg); box-shadow: 0 1px 0 var(--fg); }

.pub-count { font-family: var(--mono); font-size: 0.78rem; color: var(--text-3); margin: 20px 0 0; }

.pub-group { padding-top: clamp(40px, 5vw, 64px); }
.pub-group[hidden] { display: none; }
.pub-group-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  margin: 0 0 12px;
}

.pub-list { list-style: none; }
.pub {
  display: grid;
  grid-template-columns: 4.5rem minmax(0, 1fr) auto;
  gap: 8px 24px;
  align-items: start;
  padding-block: 20px;
  border-top: 1px solid var(--rule);
  scroll-margin-top: 220px;
}
.pub[hidden] { display: none; }
.pub-year { font-family: var(--mono); font-size: 0.8rem; color: var(--text-3); padding-top: 0.2em; }
.pub-cite { margin: 0; color: var(--text-2); font-size: 0.95rem; line-height: 1.6; max-width: 46em; }
.pub-cite cite {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.2em;
  line-height: 1.3;
  color: var(--fg);
}
.pub-link {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--fg);
  text-decoration: none;
  border: 1px solid var(--rule);
  padding: 6px 10px;
  white-space: nowrap;
  transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}
.pub-link:hover { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.pub:target { background: var(--surface-2); box-shadow: -16px 0 0 var(--surface-2), 16px 0 0 var(--surface-2); }

.pub-list-compact .pub { padding-block: 18px; }
.pub-list-compact .pub:first-child { border-top: 0; padding-top: 0; }

.pub-empty { padding-block: 64px; color: var(--text-2); }
.pub-empty[hidden] { display: none; }
.pub-empty .btn { margin-top: 16px; }

/* ---------------------------------------------------------------- skills */
.skills-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-bottom: 1px solid var(--rule);
}
.skills-col { padding-block: clamp(40px, 6vw, 72px); }
.skills-col:first-child { padding-right: clamp(24px, 4vw, 56px); }
.skills-col + .skills-col { padding-left: clamp(24px, 4vw, 56px); border-left: 1px solid var(--rule); }
.skills-col-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.9rem, 3vw, 2.5rem);
  line-height: 1;
  margin: 0 0 24px;
}
.skill-list { list-style: none; }
.skill { padding-block: 20px; border-top: 1px solid var(--rule); color: var(--text-2); }
.skill-name {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.4rem;
  line-height: 1.2;
  color: var(--fg);
  margin: 0 0 6px;
}
.skill p { margin: 0; }
.skill-used { margin-top: 10px !important; font-size: 0.88rem; color: var(--text-3); }
.skill-used-label { font-family: var(--mono); font-size: 0.72rem; color: var(--text-3); margin-right: 4px; }

.skills-tools {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 40px;
  padding-block: clamp(40px, 6vw, 72px);
  color: var(--text-2);
}

/* ---------------------------------------------------------------- projects + entries */
.project,
.entry {
  display: grid;
  grid-template-columns: var(--label-col) minmax(0, 1fr);
  column-gap: 32px;
  border-top: 1px solid var(--rule);
}
.project { padding-block: clamp(36px, 5vw, 56px); }
.project:first-child { border-top: 0; }
.project-years,
.entry-dates {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--text-3);
  margin: 0.55em 0 12px;
}
.project-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  line-height: 1.08;
  margin: 0 0 12px;
  max-width: 20em;
}
.project-partners { color: var(--text-2); max-width: 44em; margin-bottom: 20px; }
.project-meta { margin: 0; max-width: 48em; }
.meta-row {
  display: grid;
  grid-template-columns: 7.5rem minmax(0, 1fr);
  gap: 4px 20px;
  padding-block: 12px;
  border-top: 1px solid var(--rule-faint);
}
.meta-row dt { font-family: var(--mono); font-size: 0.75rem; color: var(--text-3); padding-top: 0.3em; }
.meta-row dd { margin: 0; color: var(--text-2); }
.meta-row .plain-list li:last-child { margin-bottom: 0; }
.meta-row .related li { font-size: 1.05rem; padding-block: 6px; border-top: 0; }

.entries .entry { grid-template-columns: 10rem minmax(0, 1fr); padding-block: 22px; }
.entries .entry:first-child { border-top: 0; padding-top: 0; }
.entry-title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.4rem;
  line-height: 1.2;
  color: var(--fg);
  margin: 0 0 4px;
}
.entry-org { color: var(--text-2); margin-bottom: 10px; }
.entry-points { list-style: none; color: var(--text-2); }
.entry-points li { padding-left: 1.1em; position: relative; margin-bottom: 0.35em; }
.entry-points li::before {
  content: ""; position: absolute; left: 0; top: 0.8em;
  width: 0.45em; height: 1px; background: var(--text-3);
}
.block .entries, .block .index { max-width: 52rem; }

/* ---------------------------------------------------------------- cv */
.cv .block-body { max-width: 54rem; }
.cv-note { margin-top: 20px; font-size: 0.92rem; }

/* ---------------------------------------------------------------- 404 */
.notfound { padding-block: clamp(80px, 16vw, 200px); }

/* ---------------------------------------------------------------- footer */
.site-footer { border-top: 1px solid var(--rule); background: var(--bg); }
.footer-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 32px 48px;
  padding-block: clamp(48px, 7vw, 88px) 32px;
}
.footer-lead { font-family: var(--mono); font-size: 0.78rem; color: var(--text-3); margin-bottom: 10px; }
.footer-email {
  font-family: var(--serif);
  font-size: clamp(1.6rem, 4vw, 2.8rem);
  line-height: 1.1;
  color: var(--fg);
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
  overflow-wrap: anywhere;
  transition: border-color 0.2s;
}
.footer-email:hover { border-bottom-color: var(--fg); }
.footer-links { list-style: none; display: grid; gap: 8px; align-content: end; font-size: 0.92rem; }
.footer-links a { color: var(--text-2); text-decoration: none; }
.footer-links a:hover { color: var(--fg); text-decoration: underline; text-underline-offset: 4px; }
.footer-meta {
  grid-column: 1 / -1;
  font-family: var(--mono); font-size: 0.72rem; color: var(--text-3);
  padding-top: 24px; border-top: 1px solid var(--rule-faint); margin: 0;
}

/* ---------------------------------------------------------------- abstracts */
.pub-main { min-width: 0; }
.pub-abstract { margin-top: 10px; max-width: 46em; }
.pub-abstract summary {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--text-2);
  cursor: pointer;
  list-style: none;
  padding: 4px 0;
}
.pub-abstract summary::-webkit-details-marker { display: none; }
.pub-abstract summary::before { content: "+"; width: 0.9em; color: var(--text-3); }
.pub-abstract[open] summary::before { content: "\2212"; color: var(--fg); }
.pub-abstract summary:hover { color: var(--fg); text-decoration: underline; text-underline-offset: 4px; }
.pub-abstract-body {
  margin-top: 8px;
  padding-left: 16px;
  border-left: 1px solid var(--rule);
  color: var(--text-2);
  font-size: 0.92rem;
  line-height: 1.65;
}
.pub-abstract-body p { margin-bottom: 0.8em; }
.pub-keywords { color: var(--text-3); font-size: 0.85rem; }
.pub-keywords span { font-family: var(--mono); font-size: 0.72rem; }

/* ---------------------------------------------------------------- jump links, project index, back to top */
.jump { padding-block: 20px; border-bottom: 1px solid var(--rule); }
.jump ul { list-style: none; display: flex; flex-wrap: wrap; gap: 8px 24px; }
.jump a, .to-top a {
  font-size: 0.88rem;
  color: var(--text-2);
  text-decoration: underline;
  text-decoration-color: var(--rule);
  text-underline-offset: 4px;
  transition: color 0.2s, text-decoration-color 0.2s;
}
.jump a:hover, .to-top a:hover { color: var(--fg); text-decoration-color: var(--fg); }

.project-index { padding-block: clamp(28px, 4vw, 44px); border-bottom: 1px solid var(--rule); }
.project-index ol { list-style: none; columns: 2; column-gap: 48px; }
.project-index li { break-inside: avoid; border-top: 1px solid var(--rule-faint); }
.project-index a {
  display: grid;
  grid-template-columns: 6.5rem minmax(0, 1fr);
  gap: 12px;
  padding: 8px 0;
  font-size: 0.92rem;
  color: var(--text-2);
  text-decoration: none;
}
.project-index a:hover { color: var(--fg); }
.project-index-years { font-family: var(--mono); font-size: 0.75rem; color: var(--text-3); padding-top: 0.15em; }

.to-top { padding-block: 32px 8px; }

/* ---------------------------------------------------------------- page entrances */
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
  .page-head-text { animation: rise 0.8s cubic-bezier(0.2, 0.7, 0.1, 1) both; }
  .fade-photo { animation: develop 1.4s cubic-bezier(0.3, 0.6, 0.1, 1) both; }
}

/* ---------------------------------------------------------------- countries */
.countries {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: start;
  padding-block: clamp(40px, 6vw, 72px);
}
.globe-wrap { position: sticky; top: calc(var(--header-h) + 24px); }
.globe { width: 100%; max-width: calc(100svh - var(--header-h) - 110px); margin-inline: auto; aspect-ratio: 1; touch-action: none; cursor: grab; user-select: none; }
.globe.is-dragging { cursor: grabbing; }
.globe svg { display: block; width: 100%; height: 100%; overflow: visible; }
.g-sphere { fill: var(--bg); }
.g-outline { fill: none; stroke: var(--fg); stroke-width: 1; }
.g-graticule { fill: none; stroke: var(--rule-faint); stroke-width: 0.6; }
.g-country { fill: var(--surface-2); stroke: var(--bg); stroke-width: 0.6; }
.g-country.is-study { fill: #b5b5b5; }
.g-country.is-research { fill: #4a4a4a; }
.g-country.is-selected { fill: var(--fg); }
.pin { cursor: pointer; }
.pin-hit { fill: transparent; }
.pin-dot { stroke: var(--bg); stroke-width: 1.5; }
.pin-research .pin-dot { fill: var(--fg); }
.pin-study .pin-dot { fill: var(--bg); stroke: var(--fg); stroke-width: 1.5; }
.pin-ring { fill: none; stroke: var(--fg); stroke-width: 1; opacity: 0; transition: opacity 0.2s; }
.pin:hover .pin-ring, .pin.is-selected .pin-ring { opacity: 1; }
.pin-label {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  fill: var(--fg);
  paint-order: stroke;
  stroke: var(--bg);
  stroke-width: 4px;
  stroke-linejoin: round;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.pin:hover .pin-label, .pin.is-selected .pin-label { opacity: 1; }
.globe-failed { display: none; }

.globe-legend { list-style: none; display: flex; flex-wrap: wrap; gap: 8px 24px; margin-top: 16px; font-size: 0.85rem; color: var(--text-2); }
.globe-legend li { display: flex; align-items: center; gap: 8px; }
.key { width: 10px; height: 10px; border-radius: 50%; border: 1.5px solid var(--fg); }
.key-research { background: var(--fg); }
.key-study { background: var(--bg); }

.country-lists { display: grid; gap: 40px; }
.country { border-top: 1px solid var(--rule); }
.country:last-child { border-bottom: 1px solid var(--rule); }
.country summary {
  display: flex; justify-content: space-between; align-items: baseline; gap: 16px;
  padding: 14px 0;
  cursor: pointer;
  list-style: none;
}
.country summary::-webkit-details-marker { display: none; }
.country-name {
  font-family: var(--serif);
  font-size: 1.45rem;
  line-height: 1.2;
}
.country summary:hover .country-name { text-decoration: underline; text-underline-offset: 5px; text-decoration-thickness: 1px; }
.country-name::before {
  content: "+";
  display: inline-block;
  width: 1.1em;
  font-family: var(--mono);
  font-size: 0.7em;
  color: var(--text-3);
  vertical-align: 0.15em;
}
.country[open] .country-name::before { content: "\2212"; color: var(--fg); }
.country-years { font-family: var(--mono); font-size: 0.78rem; color: var(--text-3); white-space: nowrap; }
.country-body { padding: 0 0 18px 1.6rem; color: var(--text-2); font-size: 0.95rem; }
.country-place { font-family: var(--mono); font-size: 0.75rem; color: var(--text-3); margin-bottom: 8px; }

@media (max-width: 960px) {
  .countries { grid-template-columns: 1fr; }
  .globe-wrap { position: static; max-width: 560px; margin-inline: auto; width: 100%; }
}

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1240px) {
  .site-nav ul { gap: 16px; }
  .site-nav a { font-size: 1.05rem; letter-spacing: 0.12em; }
}

@media (max-width: 1100px) {
  .menu-toggle { display: inline-block; }
  .site-nav {
    position: fixed;
    inset: var(--header-h) 0 0 0;
    background: var(--bg);
    padding: 24px var(--gutter);
    overflow-y: auto;
    display: none;
  }
  .site-nav.is-open { display: block; }
  .site-nav ul { flex-direction: column; gap: 0; }
  .site-nav li { border-bottom: 1px solid var(--rule); }
  .site-nav a {
    display: block;
    font-size: 2rem;
    letter-spacing: 0.08em;
    padding: 14px 0;
    border-bottom: 0;
  }
  .site-nav a[aria-current="page"] { border-bottom: 0; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 8px; }
  body.nav-open { overflow: hidden; }
}

@media (max-width: 960px) {
  :root { --label-col: 9rem; }

  /* Photo moves above the text and fades downward into it */
  .hero { display: block; min-height: 0; padding-top: 0; }
  .hero-portrait {
    --fade-side: linear-gradient(to bottom, #000 0%, #000 100%);
    position: relative;
    left: auto;
    width: calc(100% + 2 * var(--gutter) + 2 * var(--inset));
    margin-inline: calc(-1 * (var(--gutter) + var(--inset)));
    height: min(70vh, 560px);
  }
  .hero-portrait picture {
    -webkit-mask-image: linear-gradient(to top, transparent 0%, #000 40%);
    mask-image: linear-gradient(to top, transparent 0%, #000 40%);
  }
  .hero-text { margin-top: -18vh; }

  .page-head.has-photo { display: block; min-height: 0; padding-top: 0; }
  .page-head.has-photo .page-head-text { max-width: none; margin-top: -6vh; margin-left: 0; }
  .fade-photo,
  .photo-left .fade-photo {
    position: relative;
    left: auto;
    right: auto;
    width: calc(100% + 2 * var(--gutter) + 2 * var(--inset));
    max-width: none;
    aspect-ratio: auto;
    margin-inline: calc(-1 * (var(--gutter) + var(--inset)));
    height: min(40vh, 340px);
  }
  .fade-photo picture {
    -webkit-mask-image: linear-gradient(to top, transparent 0%, #000 45%);
    mask-image: linear-gradient(to top, transparent 0%, #000 45%);
  }

  .skills-tools { grid-template-columns: 1fr 1fr; }
  .theme { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  :root { --header-h: 60px; }
  .wrap { width: 100%; padding-inline: 16px; }
  .hero-portrait, .fade-photo { width: calc(100% + 32px); margin-inline: -16px; }

  .block, .project, .entry, .entries .entry {
    grid-template-columns: 1fr;
  }
  .block-title { margin-bottom: 16px; }

  .index-row, .index-tight .index-row { grid-template-columns: 1fr; gap: 2px; }
  .meta-row { grid-template-columns: 1fr; gap: 2px; }


  .pub { grid-template-columns: 1fr; gap: 6px; }
  .pub-link { justify-self: start; margin-top: 6px; }
  .pub-controls { position: static; }

  .skills-split { grid-template-columns: 1fr; }
  .skills-col:first-child { padding-right: 0; }
  .skills-col + .skills-col { padding-left: 0; border-left: 0; border-top: 1px solid var(--rule); }
  .skills-tools { grid-template-columns: 1fr; }

  .footer-inner { grid-template-columns: 1fr; }
  .hero-portrait { height: 62vh; }
  .country-lists { grid-template-columns: 1fr; }
  .project-index ol { columns: 1; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ---------------------------------------------------------------- print (also used for the CV PDF) */
@media print {
  @page { size: A4; margin: 16mm 16mm 18mm; }
  :root { --label-col: 34mm; }
  html, body { background: #ffffff; color: #000000; }
  body { font-size: 9.5pt; line-height: 1.45; }
  .site-header, .site-footer, .skip-link, .fade-photo, .screen-only, .pub-link, .pub-abstract, .jump, .to-top { display: none !important; }
  .page-head.has-photo { display: block; min-height: 0; }
  .page-head.has-photo .page-head-text { max-width: none; margin: 0; }
  .print-only { display: block; }
  .wrap { width: 100%; padding: 0; }
  .print-head { border-bottom: 1px solid #000000; padding-bottom: 6mm; margin-bottom: 4mm; }
  .print-head p { margin: 0; color: #000000; font-size: 9pt; }
  .print-name { font-family: var(--serif); font-size: 26pt !important; line-height: 1.05; margin-bottom: 2mm !important; }
  .page-head { display: block; padding: 0 0 4mm; border-bottom: 0; }
  .page-head .page-title { display: none; }
  .page-head .lede { display: none; }
  .block { display: block; }
  .block-title { margin-bottom: 3mm; break-after: avoid; page-break-after: avoid; }
  .block-body > p { max-width: none; }
  b, strong, .entry-title, .pub-cite cite, .related li, .block-title { color: #000000; }
  .block { padding-block: 4mm; border-top: 1px solid #888888; break-inside: auto; }
  .block-title { font-size: 12.5pt; }
  .block-body, .index dd, .entry-org, .entry-points, .pub-cite, .project-partners { color: #000000; max-width: none; }
  .index dt, .entry-dates, .pub-year, .muted { color: #000000; font-size: 8pt; }
  .index-row { padding-block: 2mm; border-top: 1px solid #cccccc; grid-template-columns: 26mm 1fr; break-inside: avoid; }
  .entries .entry { grid-template-columns: 26mm 1fr; padding-block: 2mm; border-top: 1px solid #cccccc; break-inside: avoid; }
  .entry-title { font-size: 11.5pt; }
  .pub { grid-template-columns: 12mm 1fr; padding-block: 2mm; border-top: 1px solid #cccccc; break-inside: avoid; }
  .pub-cite cite { font-size: 1.1em; }
  a { text-decoration: none !important; color: #000000; }
  .entry-points li::before, .plain-list li::before { background: #000000; }
}
