/*
  Site styles for the clean layouts (_layouts/clean*.liquid).
  Design adapted from stevenwman.github.io (al-folio based, MIT).
  Colors and fonts are set once here: dark is the default, light is the toggle.
*/
* {
  box-sizing: border-box;
}
:root {
  --bg: #0a0a0b;
  --surface: #141416;
  --ink: #e8e8ea;
  --muted: #8e9198;
  --line: #222225;
  --line-strong: #3a3a3f;
  --accent: #58a6ff;
  --award: #ff6b6b;
  --journal: #c29bff;
  --conference: #4fcf8f;
  --display: "Bricolage Grotesque", system-ui, "Segoe UI", Helvetica, Arial, sans-serif;
  --body: "Inter", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  color-scheme: dark;
}
html[data-theme="light"] {
  --bg: #fbfbfc;
  --surface: #f1f2f4;
  --ink: #16181b;
  --muted: #666b72;
  --line: #e3e5e8;
  --line-strong: #c7cbd1;
  --accent: #0a58ca;
  --award: #c62828;
  --journal: #7a45d6;
  --conference: #157a45;
  color-scheme: light;
}
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 1.03rem/1.65 var(--body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
.wrap {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 28px;
}
a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}
::selection {
  background: color-mix(in srgb, var(--accent) 25%, transparent);
}
strong {
  font-weight: 600;
}
.eyebrow {
  font: 500 0.72rem/1.4 var(--mono);
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
}
h1,
h2 {
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: -0.025em;
}

/* navigation */
.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.nav .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}
.nav .me {
  font: 700 1.05rem var(--display);
  letter-spacing: -0.025em;
  color: var(--ink);
}
.nav .me:hover {
  text-decoration: none;
}
.nav ul {
  display: flex;
  align-items: center;
  gap: 26px;
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.92rem;
}
.nav ul a {
  color: var(--muted);
}
.nav ul a:hover,
.nav ul a.on {
  color: var(--ink);
  text-decoration: none;
}
#theme-toggle {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
#theme-toggle:hover {
  color: var(--ink);
  background: var(--surface);
}
#theme-toggle .moon,
html[data-theme="light"] #theme-toggle .sun {
  display: none;
}
html[data-theme="light"] #theme-toggle .moon {
  display: block;
}

/* home: name and subtitle (no banner) */
.intro {
  padding-top: 72px;
}
.intro h1 {
  font-size: clamp(2.56rem, 5.92vw, 4.48rem);
  line-height: 1;
  margin: 0 0 18px;
}

/* sections */
section.block {
  padding-top: 68px;
}
.sec-head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin: 0 0 20px;
}
.sec-head h2 {
  font-size: 1.56rem;
  line-height: 1.2;
  margin: 0;
}
.sec-head .more {
  margin-left: auto;
  font: 500 0.76rem var(--mono);
}

/* the bio sits right under the name, without its own heading */
section#about {
  padding-top: 44px;
}
.about {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 60px;
  align-items: start;
}
.about p {
  margin: 0 0 1.05em;
  max-width: 62ch;
}
.about img {
  width: 100%;
  height: auto;
  border-radius: 6px;
  display: block;
}
.links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin-top: 22px;
  font: 500 0.78rem var(--mono);
}

.news {
  list-style: none;
  margin: 0;
  padding: 0;
}
.news li {
  display: grid;
  grid-template-columns: 7.2rem 1fr;
  gap: 18px;
  padding: 13px 0;
  border-top: 1px solid var(--line);
  font-size: 0.98rem;
}
.news li:last-child {
  border-bottom: 1px solid var(--line);
}
.news time {
  font: 400 0.76rem/1.9 var(--mono);
  color: var(--muted);
  white-space: nowrap;
}

/* publications: the list jekyll-scholar renders through _layouts/clean-bib.liquid */
.publications h2.bibliography {
  font: 500 0.78rem var(--mono);
  letter-spacing: 0.08em;
  color: var(--accent);
  margin: 40px 0 12px;
}
.publications h2.bibliography:first-child {
  margin-top: 0;
}
.publications ol.bibliography {
  list-style: none;
  margin: 0;
  padding: 0;
}
.publications ol.bibliography > li {
  padding: 22px 0;
  border-top: 1px solid var(--line);
}
.publications ol.bibliography > li:last-child {
  border-bottom: 1px solid var(--line);
}
.publications .entry {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 26px;
}
.publications .preview {
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  background: #15181d; /* matches the illustrations' card colour while loading */
  border: 1px solid var(--line);
  border-radius: 6px;
  display: block;
}
.publications .venue {
  display: flex;
  align-items: center;
  gap: 9px;
  font: 500 0.7rem/1.4 var(--mono);
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 6px;
}
/* journal / conference tag: a tinted label, squarer than the rounded link buttons so it doesn't read as clickable */
.publications .kind {
  --k: var(--muted);
  font: 500 0.62rem/1 var(--mono);
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--k);
  background: color-mix(in srgb, var(--k) 14%, transparent);
  border-radius: 4px;
  padding: 4px 7px;
}
.publications .kind.journal {
  --k: var(--journal);
}
.publications .kind.conference {
  --k: var(--conference);
}
.publications .title {
  font: 600 1.04rem/1.38 var(--body);
  letter-spacing: -0.005em;
  margin-bottom: 6px;
}
.publications .author {
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--muted);
}
.publications .author em {
  font-style: normal;
  font-weight: 500;
  color: var(--ink);
}
.publications .author a {
  color: inherit;
}
.publications .periodical {
  font-size: 0.9rem;
  color: var(--muted);
  margin-top: 2px;
}
.publications .award {
  font: 500 1.04rem/1.5 var(--mono);
  color: var(--award);
  margin-top: 8px;
}
.publications .links {
  gap: 7px;
  margin-top: 11px;
}
.publications .links a,
.publications .links button {
  font: 500 0.7rem/1 var(--mono);
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 5px 10px;
  cursor: pointer;
}
.publications .links a:hover,
.publications .links button:hover {
  border-color: var(--accent);
  color: var(--accent);
  text-decoration: none;
}
/* the interactive companion page gets the accent colour so it stands out from the other links */
.publications .links a.interactive {
  border-color: var(--accent);
  color: var(--accent);
}
.publications pre.bibtex {
  margin: 12px 0 0;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  font: 400 0.74rem/1.55 var(--mono);
  color: var(--ink);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.publications pre.bibtex[hidden] {
  display: none;
}

/* compact list on the publications page (compact_pubs: true): journal, conference and submitted sections,
   numbered from the bottom like a CV ([J4] ... [J1]); the counter starts in _pages/publications.md */
.publications.compact .pub-sec + .pub-sec {
  margin-top: 46px;
}
.publications.compact .pub-sec h2 {
  font-size: 1.36rem;
  line-height: 1.2;
  margin: 0 0 12px;
}
.pub-sec.journal {
  --tag: "[J";
}
.pub-sec.conference {
  --tag: "[C";
}
.pub-sec.preprint {
  --tag: "[S";
}
.publications.compact ol.bibliography > li {
  display: grid;
  grid-template-columns: 2.9rem minmax(0, 1fr);
  column-gap: 12px;
  padding: 15px 0;
}
.publications.compact ol.bibliography > li::before {
  counter-increment: pub -1;
  content: var(--tag) counter(pub) "]";
  font: 500 0.74rem/1.435rem var(--mono);
  color: var(--muted);
}
.publications .entry.compact {
  display: block;
}
.publications .entry.compact .title {
  margin-bottom: 4px;
}
.publications .entry.compact .award {
  font-size: 0.88rem;
  margin-top: 5px;
}
.publications .entry.compact .links {
  margin-top: 9px;
}

/* inner pages */
.page {
  padding-top: 56px;
}
.page-head {
  display: flex;
  align-items: baseline;
  gap: 18px;
  margin-bottom: 34px;
}
.page-head h1 {
  font-size: clamp(2.08rem, 4.32vw, 2.88rem);
  line-height: 1.05;
  margin: 0;
  text-transform: capitalize;
}
.page-head .lede {
  color: var(--muted);
  margin: 0;
}
.page-head .pdf {
  margin-left: auto;
  font: 500 0.76rem var(--mono);
  white-space: nowrap;
}

/* cv */
.cv-sec {
  padding-top: 40px;
}
.cv-sec:first-of-type {
  padding-top: 0;
}
.cv-sec .sec-head {
  margin-bottom: 14px;
}
.cv-sec .sec-head h2 {
  font-size: 1.36rem;
}
.cv-row {
  display: grid;
  grid-template-columns: 10.5rem minmax(0, 1fr);
  gap: 24px;
  padding: 18px 0;
  border-top: 1px solid var(--line);
}
.cv-sec .cv-row:last-child {
  border-bottom: 1px solid var(--line);
}
.cv-row .when {
  font: 400 0.76rem/1.9 var(--mono);
  color: var(--muted);
}
.cv-row .when span {
  display: block;
}
.cv-row h3 {
  font: 600 1.04rem/1.38 var(--body);
  margin: 0;
}
.cv-row h3 a {
  color: var(--ink);
}
.cv-row h3 a:hover {
  color: var(--accent);
}
.cv-row .sub {
  font-size: 0.94rem;
  color: var(--muted);
  margin-top: 2px;
}
.cv-row p {
  margin: 8px 0 0;
  font-size: 0.95rem;
}
.cv-row ul {
  margin: 9px 0 0;
  padding-left: 1.1rem;
  font-size: 0.95rem;
}
.cv-row li {
  margin: 4px 0;
}
.cv-row li::marker {
  color: var(--line-strong);
}

footer {
  margin-top: 84px;
  border-top: 1px solid var(--line);
  padding: 26px 0 40px;
  font: 400 0.74rem var(--mono);
  color: var(--muted);
}

@media (max-width: 760px) {
  .wrap {
    padding: 0 20px;
  }
  .nav ul {
    gap: 16px;
  }
  .intro {
    padding-top: 44px;
  }
  .about {
    grid-template-columns: 1fr;
    gap: 26px;
  }
  .about picture,
  .about img {
    grid-row: 1;
    max-width: 180px;
  }
  .news li {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .publications .entry {
    grid-template-columns: 104px minmax(0, 1fr);
    gap: 14px;
  }
  .publications.compact ol.bibliography > li {
    grid-template-columns: 2.5rem minmax(0, 1fr);
    column-gap: 8px;
  }
  section.block {
    padding-top: 52px;
  }
  section#about {
    padding-top: 32px;
  }
  .page {
    padding-top: 40px;
  }
  .cv-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }
  .cv-row .when span {
    display: inline;
  }
  .cv-row .when span::before {
    content: " · ";
  }
}
