:root {
  --paper:      #edecf2;
  --paper-alt:  #ffffff;
  --ink:        #16161c;
  --ink-heading:#33323d;
  --ink-soft:   #4a4854;
  --ink-faint:  #86848f;
  --rule:       #dbd9e3;
  --rule-soft:  #e7e6ee;
  --accent:     #46508c;
  --link:       #356b96;
  --accent-lit: #7b84bd;
  --accent-soft:#c9cce8;
  --accent-ink: #22254a;
  --accent-warm:#b08a3c;
  --warm-deep:  #8a6a20;

/* purple #e5e3f4, orange #f1ebe0 */ 
  --theme-1: #d8e1ef;
  --theme-2: #f3e8cf;
  --theme-3: #d8e7e4;
  --theme-4: #f3e8cf;
  --deep:    #0e0f1a;

  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body:    "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono:    "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --font-script:  "Pinyon Script", "Snell Roundhand", "Apple Chancery", cursive;

  --shell:   54rem;
  --gutter:  clamp(1.25rem, 5vw, 3rem);
  --nav-h:   66px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.68;
  font-weight: 400;
  font-variant-ligatures: none;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--accent); color: #fff; padding: .7rem 1.2rem; border-radius: 0 0 6px 0;
}
.skip-link:focus { left: 0; }

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

/* Header */
.hero {
  position: relative;
  min-height: clamp(300px, 23vw, 620px);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
  background: var(--deep);
  padding: clamp(2.2rem, 5vw, 3.2rem) var(--gutter) clamp(1.7rem, 3.4vw, 2.4rem);
  isolation: isolate;
  padding-bottom: 1.5rem;
}

.hero__art {
  position: absolute; inset: 0;
  z-index: -2;
  background-color: var(--deep);
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
}


.hero__scrim {
  position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(120% 90% at 15% 100%,
      color-mix(in srgb, var(--deep) 92%, transparent) 0%,
      color-mix(in srgb, var(--deep) 55%, transparent) 45%,
      transparent 78%),
    linear-gradient(to top,
      color-mix(in srgb, var(--deep) 95%, transparent) 0%,
      color-mix(in srgb, var(--deep) 35%, transparent) 42%,
      color-mix(in srgb, var(--deep) 10%, transparent) 100%);
}

.hero__inner {
  position: relative;
  width: 100%;
  max-width: 60rem;
  margin: 0 auto;
  display: flex;
  align-items: flex-end;
  gap: clamp(1.5rem, 4vw, 2.75rem);
  animation: rise .9s cubic-bezier(.16,1,.3,1) both;
}
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

.hero__text { min-width: 0; }

.hero__eyebrow {
  margin: 0 0 .6rem;
  font-size: .74rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--accent-lit) 60%, #ffffff);
}
.hero__name {
  margin: 0;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: clamp(1.35rem, 2.35vw, 1.75rem);
  line-height: 1.18;
  letter-spacing: -.014em;
  color: #fff;
  max-width: 40rem;
  text-wrap: balance;
}
.hero__tagline {
  margin: .75rem 0 0;
  max-width: 36rem;
  font-size: clamp(1rem, 1.6vw, 1.12rem);
  font-weight: 300;
  line-height: 1.6;
  color: rgba(255,255,255,.80);
  text-wrap: pretty;
}

.hero__links {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin: 1.3rem 0 0;
  padding: 0;
}
.hero__links a {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .44rem .95rem .44rem .8rem;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 999px;
  background: rgba(255,255,255,.03);
  backdrop-filter: blur(8px);
  color: rgba(255,255,255,.80);
  font-size: .83rem;
  font-weight: 400;
  text-decoration: none;
  transition: background .2s, border-color .2s, transform .2s;
}
.hero__links a:hover {
  background: rgba(255,255,255,.12);
  border-color: rgba(255,255,255,.4);
  color: rgba(255,255,255,.96);
  transform: translateY(-1px);
  text-decoration: none;
}
.hero__links svg,
.hero__links-img { width: 15px; height: 15px; flex: 0 0 auto; object-fit: contain; }

@media (max-width: 700px) {
  .hero__inner { flex-direction: column; align-items: flex-start; }
}

/* Navigation */
.nav {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--paper-alt) 92%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
}
.nav__inner {
  max-width: calc(var(--shell) + 2 * var(--gutter)); margin: 0 auto;
  padding: 0 var(--gutter);
  height: var(--nav-h);
  display: flex; align-items: center; gap: 1rem;
}

.nav__list {
  list-style: none; display: flex; gap: .45rem;
  margin: 0; padding: 0; flex-wrap: wrap;
}

.nav__list a {
  display: block;
  padding: .6rem 1.15rem;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font-size: 1.12rem;
  font-weight: 400;
  line-height: 1.5;
  text-decoration: none;
  white-space: nowrap;
  transition: color .16s, background .16s;
}
.nav__list a:hover {
  color: var(--ink);
  background: var(--paper);
  text-decoration: none;
}
.nav__list a:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent);
}
.nav__list a.is-active {
  color: var(--accent-ink);
  background: var(--accent-soft);
}
.nav__list a.is-active:hover {
  background: color-mix(in srgb, var(--accent-soft) 82%, var(--accent));
}

.nav__toggle {
  display: none; margin-left: auto;
  width: 40px; height: 40px;
  background: none; border: 1px solid var(--rule); border-radius: 8px;
  cursor: pointer; padding: 0;
  flex-direction: column; align-items: center; justify-content: center; gap: 4px;
}
.nav__toggle span { display: block; width: 17px; height: 1.6px; background: var(--ink); border-radius: 2px; transition: .25s; }
.nav__toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(5.6px) rotate(45deg); }
.nav__toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav__toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-5.6px) rotate(-45deg); }

@media (max-width: 620px) {
  .nav__toggle { display: flex; }
  .nav__list {
    position: absolute; top: var(--nav-h); left: 0; right: 0;
    flex-direction: column; gap: .4rem;
    background: var(--paper-alt);
    border-bottom: 1px solid var(--rule);
    padding: .75rem var(--gutter) 1rem;
    display: none;
  }
  .nav__list.is-open { display: flex; }
  .nav__list a { padding: .7rem 1rem; text-align: center; }
  .nav__list a:hover { transform: none; }
}

/* Content */
.main {
  max-width: calc(var(--shell) + 2 * var(--gutter));
  margin: 0 auto;
  padding: clamp(2.5rem, 6vw, 4.5rem) var(--gutter) clamp(4rem, 9vw, 7rem);
}
.prose { max-width: var(--shell); }
.prose.is-swapping { opacity: 0; transform: translateY(8px); }
.prose { transition: opacity .28s ease, transform .28s ease; }

.prose > *:first-child { margin-top: 0; }

.prose h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2.2rem, 5vw, 2.9rem);
  line-height: 1.05;
  letter-spacing: -.022em;
  margin: 0 0 1.35rem;
  color: var(--ink-heading);
  text-wrap: balance;
}

.prose h2 {
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 1.68rem;
  line-height: 1.25;
  letter-spacing: -.02em;
  margin: 0 0 .9rem;
  color: var(--ink);
  clear: both;
}

.prose .panel {
  background: var(--paper-alt);
  border-radius: 18px;
  padding: clamp(1.35rem, 3vw, 1.7rem);
  margin: 1.7rem 0 0;
}
.prose .panel + .panel { margin-top: 1rem; }
.prose .panel > .section + .section {
  margin-top: 1.9rem;
  padding-top: 1.7rem;
  border-top: 1px solid var(--rule);
}
.prose .section > *:last-child { margin-bottom: 0; }
.prose .panel > *:last-child { margin-bottom: 0; }
.prose .panel table { margin-bottom: 0; }
.prose .panel .pub:last-child { border-bottom: none; padding-bottom: 0; }
.prose h3 {
  font-size: 1.06rem;
  font-weight: 600;
  letter-spacing: -.005em;
  margin: 2rem 0 .5rem;
}
.prose h4 {
  font-size: .78rem; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase;
  color: var(--ink-faint);
  margin: 2rem 0 .6rem;
}
.prose p { margin: 0 0 1.15rem; text-wrap: pretty; }
.prose ul, .prose ol { margin: 0 0 1.2rem; padding-left: 1.3rem; }
.prose li { margin-bottom: .45rem; }
.prose li::marker { color: var(--accent); }

.prose blockquote {
  margin: 1.8rem 0;
  padding: .2rem 0 .2rem 1.4rem;
  border-left: 3px solid var(--accent);
  color: var(--ink-soft);
  font-size: 1.06rem;
  font-style: italic;
}
.prose blockquote p:last-child { margin-bottom: 0; }

.prose hr {
  border: 0; height: 1px; background: var(--rule);
  margin: 3rem 0;
  clear: both;
}
.prose .cards { clear: both; }
.prose code {
  font-family: var(--font-mono);
  font-size: .855em;
  background: var(--rule-soft);
  padding: .14em .42em;
  border-radius: 4px;
}
.prose pre {
  background: var(--paper-alt);
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: 1.1rem 1.25rem;
  overflow-x: auto;
  font-size: .875rem;
  line-height: 1.6;
}
.prose pre code { background: none; padding: 0; }

.prose img { border-radius: 10px; margin: 1.8rem 0; }
.prose figure { margin: 2rem 0; }
.prose figcaption, .prose img + em {
  display: block;
  font-size: .85rem;
  color: var(--ink-faint);
  line-height: 1.55;
  margin-top: .6rem;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  margin: 1.6rem 0;
  font-size: .93rem;
}
.prose table td:first-child,
.prose table th:first-child { width: 9.5rem; }

@media (max-width: 620px) {
  .prose table td:first-child,
  .prose table th:first-child { width: 8rem; white-space: normal; padding-right: .4rem; }
}
.prose th, .prose td {
  text-align: left;
  padding: .62rem .8rem .62rem 0;
  border-bottom: 1px solid var(--rule-soft);
  vertical-align: baseline;
}
.prose th {
  font-size: .74rem; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase;
  color: var(--ink-faint);
}

.prose table tr:last-child td { border-bottom: none; }
.prose table tr.is-grouped td { border-bottom: none; }
.prose table tr.is-grouped + tr td { padding-top: .12rem; }

.prose table td:first-child {
  white-space: nowrap;
  font-size: .87rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
  letter-spacing: .005em;
  color: var(--ink-soft);
  padding-right: 1.6rem;
}

.prose .entry__thumb {
  margin: .95rem 0 0;
  width: 100%;
  max-width: 380px;
}
.prose .entry__thumb img {
  width: 100%; display: block; margin: 0;
  border-radius: 10px;
  border: 1px solid var(--rule-soft);
}
.prose .entry__body > *:first-child { margin-top: 0; }
.prose .entry__body > *:last-child  { margin-bottom: 0; }
.prose .entry--nofig .entry__thumb { display: none; }

.news-tag {
  display: block;
  margin-bottom: .35rem;
  font-size: .89rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.news-tag--violet { color: var(--accent); }
.news-tag--gold   { color: var(--warm-deep); }
.news-tag--grey   { color: var(--ink-soft); }

/* Publications */
.pub {
  --pub-pad:   1.1rem;
  --pub-title: 1.02rem;
  --pub-lh:    1.4;
  --pub-dot:   5px;

  position: relative;
  padding: var(--pub-pad) 0 var(--pub-pad) 1.4rem;
  border-bottom: 1px solid var(--rule-soft);
}
.pub::before {
  content: "";
  position: absolute;
  left: 0;
  top: calc(var(--pub-pad) + var(--pub-title) * var(--pub-lh) / 2 - var(--pub-dot) / 2);
  width: var(--pub-dot); height: var(--pub-dot); border-radius: 50%;
  background: var(--accent-lit);
}
.pub h3 { margin: 0 0 .3rem; font-size: var(--pub-title); line-height: var(--pub-lh); }
.pub h3 a { color: var(--ink); }
.pub h3 a:hover { color: var(--link); }
.pub p { margin: 0 0 .25rem; font-size: .9rem; color: var(--ink-soft); }
.pub p:last-child { margin-bottom: 0; }
.pub em { font-style: normal; color: var(--ink-soft); }
.pub strong { font-weight: 600; color: var(--ink); }

.pub .me { color: var(--link); font-weight: 600; }

.pub .chips { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .5rem; }
.pub .chips a {
  font-family: var(--font-mono);
  font-size: .715rem;
  letter-spacing: .02em;
  padding: .2rem .55rem;
  border: 1px solid var(--rule);
  border-radius: 5px;
  color: var(--ink-soft);
  text-decoration: none;
}
.pub .chips a:hover { border-color: var(--link); color: var(--link); text-decoration: none; }

/* Portrait */
.prose .portrait {
  float: left;
  width: clamp(150px, 32%, 196px);

  margin: .35rem 1.75rem 1.4rem 0;
  shape-margin: 1.75rem;
}
.prose .portrait img {
  width: 100%;
  aspect-ratio: 1 / 1.12;
  object-fit: cover;

  object-position: 50% 32%;
  border-radius: 12px;
  margin: 0;
  background: var(--paper-alt);
  border: none;
  box-shadow: 0 10px 26px rgba(20, 20, 20, .10);
}
.prose .portrait p { margin: 0; max-width: none; }
.prose .portrait p + p {
  margin-top: .7rem;
  font-size: .78rem;
  line-height: 1.5;
  color: var(--ink-faint);
}
.prose .portrait + h1,
.prose .portrait + p { margin-top: 0; }

.prose .portrait ~ p {
  margin-left: calc(clamp(150px, 32%, 196px) + 1.75rem);
  text-align: justify;
  text-align-last: left;
  hyphens: auto;
}

@media (max-width: 620px) {
  .prose .portrait {
    float: none;
    width: 165px;
    margin: 0 0 1.6rem;
  }
  .prose .portrait ~ p {
    margin-left: 0;
    text-align: left;
    hyphens: none;
  }
}

/* Research themes */
.prose .themes {
  display: grid;
  gap: 1.1rem;

  margin: 2rem 0 2.6rem;
  clear: both;
}
.prose .theme {
  display: grid;

  grid-template-columns: 280px minmax(0, 1fr);
  gap: 1.45rem;
  align-items: start;
  padding: clamp(1.35rem, 3vw, 1.7rem);
  border: none;
  border-radius: 18px;
  background: var(--paper-alt);
  clear: both;
}
.prose .theme--1 { background: var(--theme-1); }
.prose .theme--2 { background: var(--theme-2); }
.prose .theme--3 { background: var(--theme-3); }
.prose .theme--4 { background: var(--theme-4); }
.prose .theme__media { margin: 0; }


.prose .theme__media img {
  width: 100%;
  aspect-ratio: 5 / 4;
  object-fit: contain;
  object-position: center;
  border-radius: 12px;
  margin: 0;
  border: none;
  background: #ffffff99;
  display: block;
}


.prose .theme__media .theme__caption {
  margin: .55rem 0 0;
  font-size: .75rem;
  line-height: 1.5;
  color: var(--ink-soft);
}
.prose .theme__media .theme__caption,
.prose .theme__media .theme__caption em { font-style: normal; }
.prose .theme__body > *:first-child { margin-top: 0; }
.prose .theme__body > *:last-child  { margin-bottom: 0; }
.prose .theme h3 {
  margin: 0 0 .55rem;
  font-family: var(--font-body);
  font-size: 1.16rem;
  font-weight: 600;
  letter-spacing: -.01em;
}
.prose .theme p {
  max-width: none;
  font-size: .93rem;
  line-height: 1.66;
  margin-bottom: .8rem;
}

.prose > h1 + p,
.prose .theme__body p {
  text-align: justify;
  text-align-last: left;
  hyphens: auto;
}
.prose .theme__caption {
  text-align: left;
  hyphens: none;
}

.prose .theme.is-bare { display: block; }

@media (max-width: 780px) {
  .prose .theme {
    grid-template-columns: 1fr;
    gap: 1.1rem;
    padding: 1.1rem;
  }
  .prose .theme__media img { aspect-ratio: 16 / 7; }
}

@media (max-width: 620px) {
  .prose > h1 + p,
  .prose .theme__body p {
    text-align: left;
    hyphens: none;
  }
}

.prose .cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1rem;
  margin: 1.8rem 0 2.4rem;
}
.prose .card {
  padding: 1.2rem 1.25rem;
  border: 1px solid var(--rule);
  border-radius: 12px;
  background: var(--paper-alt);
}
.prose .card h3 { margin: 0 0 .4rem; font-size: .98rem; }
.prose .card p  { margin: 0; font-size: .88rem; color: var(--ink-soft); line-height: 1.55; }

.loader { display: flex; gap: 6px; padding: 2rem 0; }
.loader span {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent);
  animation: bounce 1.1s ease-in-out infinite;
}
.loader span:nth-child(2) { animation-delay: .15s; }
.loader span:nth-child(3) { animation-delay: .3s; }
@keyframes bounce { 0%,80%,100% { opacity:.25; transform: translateY(0); } 40% { opacity:1; transform: translateY(-5px); } }

/* Footer */
.footer {
  border-top: 1px solid var(--rule);
  background: var(--paper-alt);
  padding: clamp(1.8rem, 3vw, 2.4rem) var(--gutter) clamp(1.4rem, 2.4vw, 1.8rem);
}
.footer__base {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  margin-top: 1rem;
  padding-top: .9rem;
  border-top: 1px solid var(--rule);
}
.footer__inner { max-width: var(--shell); margin: 0 auto; }
.footer__mark {
  flex: 0 0 auto;
  display: inline-block;
  margin: 0;
  color: var(--accent);
  font-family: var(--font-script);
  font-size: 1.85rem;
  line-height: 1;
  letter-spacing: .01em;
  -webkit-text-stroke: .4px currentColor;
  text-decoration: none;
  transition: color .16s;
}
.footer__mark:hover { text-decoration: none; color: color-mix(in srgb, var(--accent) 78%, var(--ink)); }
.footer__mark span { display: block; }

.footer__name {
  font-family: var(--font-display);
  font-weight: 600; font-size: 1.15rem;
  margin: 0 0 .2rem;
}
.footer__meta { margin: .12rem 0 0; color: var(--ink-soft); font-size: .92rem; }
.footer__links {
  list-style: none; display: flex; flex-wrap: wrap;
  gap: 1.1rem; margin: 1rem 0 0; padding: 0;
}
.footer__links a {
  display: inline-flex; align-items: center; gap: .4rem;
  font-size: .89rem; color: var(--ink-soft);
}
.footer__links a:hover { color: var(--link); }
.footer__links svg { width: 15px; height: 15px; flex: 0 0 auto; }

/* brand colours*/
.footer__links .brand--orcid    svg { color: #a6ce39; }
.footer__links .brand--scholar  svg { color: #4285f4; }
.footer__links .brand--bluesky  svg { color: #1185fe; }
.footer__links .brand--linkedin svg { color: #0a66c2; }
.footer__links .brand--github   svg { color: #24292f; }
.footer__links .brand--mail     svg { color: var(--accent); }
.footer__links a:hover svg { filter: saturate(1.15) brightness(1.05); }
.footer__links .hero__links-img { width: 15px; height: 15px; flex: 0 0 auto; object-fit: contain; }
.footer__fine {
  margin: 0; font-size: .78rem; color: var(--ink-faint);
}
.footer__fine code { font-family: var(--font-mono); font-size: .95em; }

/* Print */
@media print {
  .hero, .nav, .footer__links { display: none; }
  body { font-size: 11pt; }
  .prose { max-width: none; }
}
