/* ============================================================
   Academic site — stylesheet
   Edit colours and fonts in the :root block below.
   ============================================================ */

:root {
  --paper:    #F6F7F5;   /* page background            */
  --ink:      #16221E;   /* headings + body text       */
  --slate:    #5C6864;   /* secondary text             */
  --rule:     #E0E4E0;   /* hairlines                  */
  --viridian: #2E6A57;   /* links + accents            */
  --amber:    #97662F;   /* data labels only           */
  --wash:     #EDF0EC;   /* subtle fills               */

  /* top bar */
  --bar:      #262E2B;   /* bar background             */
  --bar-text: #EAEDE9;   /* name + active link         */
  --bar-dim:  #9BA6A1;   /* inactive links             */
  --bar-mark: #D6A163;   /* underline on current page  */

  --serif: "IBM Plex Serif", Georgia, serif;
  --sans:  "IBM Plex Sans", system-ui, -apple-system, sans-serif;
  --mono:  "IBM Plex Mono", ui-monospace, Menlo, monospace;

  --measure: 60rem;
  --margin-col: 7.5rem;
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16.5px;
  line-height: 1.65;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--viridian);
  text-decoration: none;
  border-bottom: 1px solid rgba(46, 106, 87, 0.28);
  transition: border-color 0.15s ease, color 0.15s ease;
}
a:hover { border-bottom-color: var(--viridian); }

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

.wrap {
  max-width: 82rem;
  margin: 0 auto;
  padding: 0 1.75rem;
}

/* ---------- top bar ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid rgba(0, 0, 0, 0.22);
  background: rgba(38, 46, 43, 0.92);
  -webkit-backdrop-filter: saturate(150%) blur(12px);
  backdrop-filter: saturate(150%) blur(12px);
}
@supports not (backdrop-filter: blur(1px)) {
  .topbar { background: var(--bar); }
}
.topbar .wrap {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1.5rem;
  padding-top: 1.1rem;
  padding-bottom: 1.1rem;
  flex-wrap: wrap;
}
.mark {
  font-family: var(--serif);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--bar-text);
  border-bottom: none;
}
.mark:hover { color: #FFFFFF; }

.topnav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.4rem;
  font-family: var(--mono);
  font-size: 0.76rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}
.topnav a {
  color: var(--bar-dim);
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
}
.topnav a:hover { color: var(--bar-text); border-bottom-color: var(--bar-dim); }
.topnav a[aria-current="page"] {
  color: var(--bar-text);
  border-bottom-color: var(--bar-mark);
}
.topbar :focus-visible { outline-color: var(--bar-mark); }

/* ---------- hero ---------- */

/* ---------- About page: sticky identity rail ---------- */

.about-layout {
  max-width: 92rem;
  display: grid;
  grid-template-columns: 13rem minmax(0, 1fr);
  gap: 3rem;
}

.rail-inner {
  position: sticky;
  top: 5.5rem;
  padding-top: 4.5rem;
}

.about-layout .portrait {
  width: 7rem;
  margin: 0 0 1.1rem;
}

.rail-name {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.5rem;
  line-height: 1.15;
  letter-spacing: -0.015em;
  margin: 0 0 0.6rem;
}

.rail-role {
  margin: 0 0 1.2rem;
  font-size: 0.84rem;
  line-height: 1.5;
  color: var(--slate);
}

.rail-links {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--rule);
}
.rail-links li { border-bottom: 1px solid var(--rule); }
.rail-links a {
  display: block;
  padding: 0.42rem 0;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--slate);
  border-bottom: none;
}
.rail-links a:hover { color: var(--viridian); }

/* Two-column academic profile links, reused on About, Publications, and Contact. */
.profile-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.45rem 0.9rem;
}
.profile-links li {
  min-width: 0;
}
.profile-links a {
  display: block;
  padding: 0.38rem 0;
  font-family: var(--mono);
  font-size: 0.7rem;
  line-height: 1.35;
  letter-spacing: 0.025em;
  color: var(--slate);
  border-bottom: 1px solid var(--rule);
}
.profile-links a:hover { color: var(--viridian); border-bottom-color: var(--viridian); }

/* The About rail uses a single-column profile list. */
.rail-links.profile-links {
  border-top: none;
  gap: 0.2rem 0.9rem;
}
.rail-links.profile-links li { border-bottom: none; }
.rail-links.profile-links a { padding: 0.42rem 0; }
.about-profile-links {
  grid-template-columns: 1fr;
  gap: 0.08rem;
}

.about-body > main { padding-top: 4.5rem; padding-bottom: 5rem; }
.about-body .row:first-of-type { padding-top: 0; }

/* ---------- hero ---------- */

.hero { padding: 4.5rem 0 0; }

.portrait {
  display: block;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border: 1px solid var(--rule);
  border-radius: 3px;
  background: var(--wash);
}

.hero-name {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(2.4rem, 6.2vw, 3.75rem);
  line-height: 1.04;
  letter-spacing: -0.025em;
  margin: 0 0 1rem;
}
.hero-role {
  font-size: 1.08rem;
  color: var(--slate);
  max-width: 34rem;
  margin: 0 0 1.5rem;
}
.hero-role strong { color: var(--ink); font-weight: 500; }

.hero-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.1rem;
  font-family: var(--mono);
  font-size: 0.8rem;
  letter-spacing: 0.03em;
}

/* ---------- signature: Mittag-Leffler curve band ---------- */

.curveband {
  margin: 3.25rem 0 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  padding: 1.5rem 0 1.1rem;
}
.curveband svg { display: block; width: 100%; height: 190px; }

.ml-curve {
  fill: none;
  stroke: var(--viridian);
  stroke-width: 2.2;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}
.ml-curve.faint  { stroke-opacity: 0.30; }
.ml-curve.mid    { stroke-opacity: 0.48; }
.ml-curve.strong { stroke-opacity: 0.70; }
.ml-curve.full   { stroke-opacity: 1; }

.ml-axis { stroke: var(--rule); stroke-width: 1; }

.curve-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 1.4rem;
  margin-top: 1rem;
}
.key {
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.04em;
  color: var(--slate);
  display: inline-flex;
  align-items: center;
}
.key::before {
  content: "";
  width: 20px;
  height: 2px;
  margin-right: 0.5rem;
  background: var(--viridian);
}
.key.faint::before  { opacity: 0.30; }
.key.mid::before    { opacity: 0.48; }
.key.strong::before { opacity: 0.70; }
.key.full::before   { opacity: 1; }

.curve-caption {
  margin: 0.9rem 0 0;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  color: var(--slate);
}

@media (prefers-reduced-motion: no-preference) {
  .ml-curve {
    stroke-dasharray: 1400;
    stroke-dashoffset: 1400;
    animation: draw 1.5s cubic-bezier(0.3, 0.7, 0.3, 1) forwards;
  }
  .ml-curve:nth-of-type(2) { animation-delay: 0.12s; }
  .ml-curve:nth-of-type(3) { animation-delay: 0.24s; }
  .ml-curve:nth-of-type(4) { animation-delay: 0.36s; }
  @keyframes draw { to { stroke-dashoffset: 0; } }
}

/* ---------- marginalia layout ---------- */

main { padding-bottom: 5rem; }

.row {
  display: grid;
  grid-template-columns: var(--margin-col) minmax(0, var(--measure));
  gap: 3rem;
  padding-top: 3.25rem;
}
.row + .row { border-top: 1px solid var(--rule); }

.margin {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--slate);
  text-align: right;
  padding-top: 0.42rem;
}

.margin.year {
  font-family: var(--serif);
  font-size: 1.75rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  text-transform: none;
  color: var(--rule);
  padding-top: 0;
  line-height: 1;
}
.margin .sub {
  display: block;
  text-transform: none;
  letter-spacing: 0.02em;
  color: var(--amber);
  margin-top: 0.4rem;
}

.column > :first-child { margin-top: 0; }
.column > :last-child  { margin-bottom: 0; }

h2 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.5rem;
  letter-spacing: -0.015em;
  line-height: 1.25;
  margin: 0 0 1rem;
}
h3 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.08rem;
  margin: 2rem 0 0.5rem;
}
p { margin: 0 0 1.1rem; }

.lede { font-size: 1.05rem; }

/* ---------- research areas ---------- */

.area {
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--rule);
}
.area:last-child { border-bottom: none; padding-bottom: 0; }
.area h3 { margin-top: 0; }
.area p { margin-bottom: 0; color: var(--slate); }
.area .keys {
  margin-top: 0.65rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--amber);
}

.interest-list {
  margin: 0.25rem 0 0;
  padding-left: 1.1rem;
  columns: 2;
  column-gap: 2.5rem;
}
.interest-list li {
  margin: 0 0 0.5rem;
  break-inside: avoid;
}
.interest-list li:last-child { margin-bottom: 0; }

.research-topic {
  padding: 2.2rem 0;
  border-bottom: 1px solid var(--rule);
}
.research-topic:first-child { padding-top: 0.2rem; }
.research-topic:last-child { border-bottom: none; padding-bottom: 0; }
.topic-title {
  margin: 0 0 1rem;
  width: 100%;
  font-size: 1.38rem;
}
.topic-intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 16rem;
  gap: 1.6rem;
  align-items: center;
}
.topic-description p {
  margin: 0;
  color: var(--slate);
  font-size: 1rem;
  line-height: 1.7;
}
.topic-media {
  display: flex;
  justify-content: flex-end;
}
.topic-media img {
  display: block;
  width: 100%;
  max-width: 16rem;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border: 1px solid rgba(46, 106, 87, 0.14);
  border-radius: 14px;
  background: linear-gradient(180deg, #f7f8f4, #edf0ec);
  box-shadow: 0 10px 26px rgba(22, 34, 30, 0.07);
}
.topic-publications {
  width: 100%;
  margin-top: 1.15rem;
}
.research-paper-list {
  width: 100%;
  margin: 0;
  padding-left: 1.2rem;
}
.research-paper-list li {
  margin: 0 0 0.62rem;
  padding-left: 0.15rem;
  color: var(--slate);
  font-size: 0.92rem;
  line-height: 1.55;
}
.research-paper-list li:last-child { margin-bottom: 0; }
.research-paper-title {
  font-family: var(--serif);
  font-weight: 600;
  color: var(--ink);
}
.research-paper-details {
  color: var(--slate);
}
.research-paper-details .me {
  color: var(--ink);
  font-weight: 500;
}
.research-paper-links {
  white-space: nowrap;
  font-family: var(--mono);
  font-size: 0.68rem;
}
.research-paper-links a {
  margin-left: 0.3rem;
}

/* ---------- publications ---------- */

/* Justify all publication-page text while leaving the rest of the site unchanged. */
.publications-page .about-body,
.publications-page .rail-inner {
  text-align: justify;
}

/* Only add a subtle background to the section titles on the publications page. */
.publications-page .row.cat .column {
  background: linear-gradient(135deg, rgba(46, 106, 87, 0.12), rgba(237, 240, 236, 0.95));
  border: 1px solid rgba(46, 106, 87, 0.18);
  border-radius: 14px;
  padding: 1rem 1.35rem;
  box-shadow: 0 10px 24px rgba(22, 34, 30, 0.06);
}

.pub {
  padding: 1.4rem 0;
  border-bottom: 1px solid var(--rule);
}
.pub:last-child { border-bottom: none; }
.pub-title {
  font-family: var(--serif);
  font-size: 1.02rem;
  font-weight: 600;
  line-height: 1.4;
  margin: 0 0 0.35rem;
}
.pub-authors { margin: 0 0 0.2rem; font-size: 0.95rem; color: var(--slate); }
.pub-authors .me { color: var(--ink); font-weight: 500; }
.pub-venue { margin: 0; font-size: 0.95rem; color: var(--slate); font-style: italic; }
.pub-links {
  margin: 0.55rem 0 0;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.year-head {
  font-family: var(--mono);
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  color: var(--amber);
  margin: 0 0 0.25rem;
}

/* ---------- news ---------- */

.news { list-style: none; margin: 0; padding: 0; }
.news li {
  display: grid;
  grid-template-columns: 5.5rem 1fr;
  gap: 1rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--rule);
  font-size: 0.95rem;
  line-height: 1.55;
}
.news li:last-child { border-bottom: none; }
.news time {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  color: var(--slate);
  padding-top: 0.22rem;
}
.news strong { font-weight: 500; color: var(--ink); }
.news li > span { color: var(--slate); }
.sub-note {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.88rem;
  color: var(--slate);
}
.sub-note em { color: var(--ink); font-style: italic; }
.news a {
  border-bottom-color: rgba(46, 106, 87, 0.22);
}
.news a:hover { border-bottom-color: var(--viridian); }

/* ---------- teaching ---------- */

.teaching-layout {
  max-width: 92rem;
  display: grid;
  grid-template-columns: 13rem minmax(0, 1fr);
  gap: 3rem;
}
.teaching-rail-inner {
  position: sticky;
  top: 5.5rem;
  padding-top: 4.5rem;
}
.teaching-rail-nav a.current {
  color: var(--ink);
  font-weight: 500;
}

.teaching-rail-nav .rail-group {
  border-bottom: 1px solid var(--rule);
}
.teaching-rail-nav .rail-group > a {
  border-bottom: none;
}
.teaching-subnav {
  list-style: none;
  margin: 0 0 0.45rem;
  padding: 0 0 0 0.8rem;
  border-left: 2px solid rgba(46, 106, 87, 0.16);
}
.teaching-subnav li {
  border: none !important;
}
.teaching-subnav a {
  display: block;
  padding: 0.38rem 0.15rem 0.38rem 0.55rem;
  font-size: 0.76rem;
  line-height: 1.35;
  color: var(--slate);
}
.teaching-subnav a:hover,
.teaching-subnav a.current {
  color: var(--viridian);
}
.teaching-body {
  padding-top: 4.5rem;
  padding-bottom: 5rem;
  min-width: 0;
}
.teaching-section {
  scroll-margin-top: 6rem;
  padding-bottom: 3.75rem;
}
.teaching-section + .teaching-section {
  border-top: 1px solid var(--rule);
  padding-top: 3.4rem;
}
.teaching-page-title {
  font-family: var(--serif);
  font-size: clamp(2.2rem, 4vw, 3.1rem);
  line-height: 1.08;
  letter-spacing: -0.025em;
  margin: 0 0 2rem;
}
.teaching-section > h2 {
  font-size: 1.65rem;
  margin: 0 0 1.25rem;
  padding: 0.9rem 1.25rem;
  background: linear-gradient(135deg, rgba(46, 106, 87, 0.12), rgba(237, 240, 236, 0.95));
  border: 1px solid rgba(46, 106, 87, 0.18);
  border-radius: 14px;
  box-shadow: 0 10px 24px rgba(22, 34, 30, 0.06);
}
.teaching-summary {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  margin: 1.6rem 0 3rem;
}
.teaching-summary div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.8rem 0;
  border-bottom: 1px solid var(--rule);
}
.teaching-summary span {
  font-family: var(--serif);
  font-weight: 600;
}
.teaching-summary strong {
  flex: 0 0 auto;
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--amber);
  padding-top: 0.16rem;
}
.institution {
  scroll-margin-top: 6rem;
  margin: 0 0 4rem;
}
.institution:last-child { margin-bottom: 0; }
.institution-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 0.85rem 1rem;
  border-top: 1px solid rgba(46, 106, 87, 0.12);
  border-bottom: 1px solid rgba(46, 106, 87, 0.16);
  margin-bottom: 0.35rem;
  background: rgba(237, 240, 236, 0.72);
}
.institution-head h3 {
  margin: 0;
  font-size: 1.35rem;
}
.institution-head p {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.94rem;
  color: var(--amber);
  white-space: nowrap;
}
.course-detail {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 10.8rem;
  gap: 2rem;
  align-items: start;
  padding: 1.75rem 0;
  border-bottom: 1px solid var(--rule);
}
.course-detail:last-child { border-bottom: none; }
.course-detail.no-textbook { grid-template-columns: 1fr; }
.course-copy { min-width: 0; }
.course-code {
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.09em;
  color: var(--amber);
  margin: 0 0 0.28rem;
}
.course-copy h4 {
  margin: 0 0 0.55rem;
  font-family: var(--serif);
  font-size: 1.18rem;
  line-height: 1.25;
}
.course-copy p {
  margin: 0;
  color: var(--slate);
  font-size: 0.94rem;
  line-height: 1.65;
  text-align: justify;
}
.course-copy p strong {
  color: var(--ink);
  font-weight: 500;
}
.course-copy .course-textbook {
  margin-top: 0.75rem;
  color: var(--slate);
}
.textbook-media {
  margin: 0;
  width: 10.5rem;
  height: 15.5rem;
  display: flex;
  justify-content: center;
  align-items: center;
  background: #fff;
  border: 1px solid rgba(22, 34, 30, 0.13);
  border-radius: 4px;
  box-shadow: 0 10px 22px rgba(22, 34, 30, 0.12);
  overflow: hidden;
}
.textbook-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* ---------- publications rail + categories ---------- */

.rail-heading {
  margin: 0 0 0.9rem;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--amber);
}

.rail-nav { list-style: none; margin: 0; padding: 0; }
.rail-nav li { border-top: 1px solid var(--rule); }
.rail-nav li:last-child { border-bottom: 1px solid var(--rule); }
.rail-nav a {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.6rem;
  padding: 0.6rem 0;
  font-size: 0.88rem;
  line-height: 1.3;
  color: var(--slate);
  border-bottom: none;
}
.rail-nav a span {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--amber);
}
.rail-nav a:hover { color: var(--ink); }
.rail-nav a.current { color: var(--ink); font-weight: 500; }

.rail-foot {
  margin: 1.1rem 0 0;
  font-size: 0.78rem;
  line-height: 1.5;
  color: var(--slate);
}

.profiles-heading { margin-top: 1.35rem; }
.publication-profile-links { gap: 0.2rem 0.8rem; }
.publication-profile-links a { font-size: 0.66rem; }

.cat { scroll-margin-top: 5.5rem; }
.cat-head {
  font-family: var(--serif);
  font-size: 1.45rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  margin: 0 0 0.4rem;
}
.row.cat + .row { padding-top: 1.75rem; border-top: none; }

/* Keep the active Publications category title visible while scrolling. */
.publications-page .row.cat {
  position: sticky;
  top: 4.55rem;
  z-index: 30;
  margin-top: 2.15rem;
  padding-top: 0.55rem;
  padding-bottom: 0.55rem;
  background: var(--paper);
}
.publications-page .about-body .row.cat:first-of-type {
  margin-top: 0;
}
.publications-page .row.cat .column {
  background: linear-gradient(135deg, #e4ece8, #edf0ec);
}

@media (max-width: 46rem) {
  .publications-page .row.cat {
    position: static;
    margin-top: 1.5rem;
  }
}

/* ---------- contact page: details + map ---------- */

.contact-split {
  display: grid;
  grid-template-columns: minmax(0, 17rem) minmax(0, 1fr);
  gap: 3rem;
  padding-top: 3.25rem;
}

.ident {
  margin: 0 0 1.75rem;
  line-height: 1.6;
  color: var(--slate);
}
.ident strong {
  display: block;
  font-family: var(--serif);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 0.3rem;
}

.field-label {
  margin: 1.35rem 0 0.3rem;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--amber);
}
.field-body {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--slate);
}
.field-body + .field-body { margin-top: 0.55rem; }

.contact-profile-links {
  margin-top: 0.2rem;
  max-width: 24rem;
}

.contact-map { display: grid; }
.contact-map iframe {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 340px;
  border: 1px solid var(--rule);
  border-radius: 3px;
  background: var(--wash);
}
.map-note {
  margin: 0.65rem 0 0;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.03em;
  color: var(--slate);
}

/* ---------- contact ---------- */

.contact { list-style: none; margin: 0; padding: 0; }
.contact li {
  display: grid;
  grid-template-columns: 6rem 1fr;
  gap: 1rem;
  padding: 0.45rem 0;
  font-size: 0.95rem;
}
.contact .k {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--slate);
  padding-top: 0.25rem;
}

/* ---------- footer ---------- */

.foot {
  border-top: 1px solid var(--rule);
  padding: 1.75rem 0 2.5rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  color: var(--slate);
}
.foot .wrap {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

/* ---------- responsive ---------- */

@media (max-width: 46rem) {
  body { font-size: 16px; }
  .topbar .wrap { padding-top: 0.8rem; padding-bottom: 0.8rem; gap: 0.5rem; }
  .topnav { gap: 0.4rem 0.85rem; font-size: 0.7rem; letter-spacing: 0.06em; }
  .hero { padding-top: 1.4rem; padding-left: 0; }
  .row {
    grid-template-columns: 1fr;
    gap: 0.9rem;
    padding-top: 2.5rem;
  }
  .margin { text-align: left; padding-top: 0; }
  .margin .sub { display: inline; margin-left: 0.75rem; }
  .news li { grid-template-columns: 1fr; gap: 0.15rem; }
  .contact li { grid-template-columns: 1fr; gap: 0.1rem; }
  .interest-list { columns: 1; }
  .research-topic {
    padding-top: 1.5rem;
    padding-bottom: 1.5rem;
  }
  .topic-title { font-size: 1.18rem; }
  .topic-intro {
    grid-template-columns: 1fr;
    gap: 0.9rem;
  }
  .topic-media { justify-content: flex-start; }
  .topic-media img { max-width: 20rem; }
  .contact-split {
    grid-template-columns: 1fr;
    gap: 2rem;
    padding-top: 2.5rem;
  }
  .contact-map iframe { height: 300px; min-height: 300px; }
  .curveband { margin-top: 2.5rem; }
}

@media (max-width: 77rem) {
  .about-layout {
    grid-template-columns: 1fr;
    gap: 0;
    max-width: 60rem;
  }
  .rail-inner { position: static; padding-top: 3.25rem; }
  .about-layout .portrait { width: 6rem; }
  .rail-name { font-size: 2rem; }
  .rail-role { font-size: 0.95rem; max-width: 34rem; }
  .rail-links { margin-top: 1rem; }
  .about-body > main { padding-top: 2.75rem; }
}



/* Publications use the same compact bibliography-list treatment as Research. */
.publications-page .publication-paper-list {
  margin-top: 0;
  margin-bottom: 0;
}
.publications-page .publication-paper-list li {
  text-align: left;
}
.publications-page .publication-paper-list .research-paper-title {
  font-size: 0.98rem;
}
.publications-page .publication-paper-list .research-paper-details {
  font-size: 0.92rem;
}
.publications-page .publication-paper-list .research-paper-links a {
  border-bottom-color: rgba(46, 106, 87, 0.22);
}


@media (max-width: 77rem) {
  .teaching-layout {
    grid-template-columns: 1fr;
    gap: 0;
    max-width: 82rem;
  }
  .teaching-rail-inner {
    position: static;
    padding-top: 2.5rem;
  }
  .teaching-rail-nav {
    display: flex;
    gap: 1.4rem;
    border-bottom: 1px solid var(--rule);
    align-items: flex-start;
  }
  .teaching-rail-nav .rail-group {
    border-bottom: none;
  }
  .teaching-subnav {
    margin-top: 0.15rem;
  }
  .teaching-rail-nav li {
    border: none;
  }
  .teaching-rail-nav a {
    padding: 0.45rem 0 0.65rem;
  }
  .teaching-body {
    padding-top: 2.5rem;
  }
}

@media (max-width: 46rem) {
  .teaching-summary {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .teaching-summary div {
    align-items: flex-start;
  }
  .institution-head {
    display: block;
  }
  .institution-head p {
    margin-top: 0.25rem;
  }
  .course-detail {
    grid-template-columns: 1fr;
    gap: 1rem;
    align-items: start;
  }
  .textbook-media {
    justify-content: flex-start;
  }
  .textbook-media {
    width: 9.5rem;
    height: 14rem;
  }
}

/* Publications page: Academic profiles in one column. */
.publication-profile-links {
  grid-template-columns: 1fr;
}

/* Publications: flat sticky section headings, no bubble styling. */
.publications-page .row.cat {
  position: sticky;
  top: 4.55rem;
  z-index: 30;
  background: var(--paper);
}

.publications-page .row.cat .column {
  border-radius: 0 !important;
  box-shadow: none !important;
  border-left: none !important;
  border-right: none !important;
  background: #e8eeeb !important;
  padding-top: 0.8rem;
  padding-bottom: 0.8rem;
}


/* ============================================================
   Flat section hierarchy for Publications and Teaching
   ============================================================ */

/* ---- Publications: darker main section headers ---- */
.publications-page .row.cat .column {
  background: #d6e1dc !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  border: none !important;
  padding: 0.82rem 1.1rem !important;
}

/* Keep publication year rows visually lighter than the main section header. */
.publications-page .row:not(.cat) .column {
  background: transparent !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

/* ---- Teaching: remove all bubble styling ---- */
.teaching-page .row.cat .column,
.teaching-page .teaching-main-title,
.teaching-page .teaching-section-title,
.teaching-page .teaching-section-head,
.teaching-page .section-heading {
  border-radius: 0 !important;
  box-shadow: none !important;
}

/* Main Teaching sections: Students / Teaching experience */
.teaching-page #students > .column,
.teaching-page #teaching-experience > .column,
.teaching-page .teaching-main-section > .column,
.teaching-page .teaching-section-header {
  background: #d6e1dc !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  border: none !important;
}

/* University subsections: lighter than the main Teaching sections. */
.teaching-page .university-head,
.teaching-page .university-heading,
.teaching-page .teaching-university-head,
.teaching-page .institution-head,
.teaching-page .teaching-subsection {
  background: #edf2ef !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  border: none !important;
}

/* Any course cards should also remain flat rather than bubble-like. */
.teaching-page .course,
.teaching-page .course-card,
.teaching-page .course-wrap {
  border-radius: 0 !important;
  box-shadow: none !important;
}


/* Final hierarchy refinement */

/* Publications — main category headers: darker, flat, sticky. */
.publications-page .row.cat .column {
  background: #d2ded8 !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

/* Teaching — main sections: darker and completely flat. */
.teaching-page .teaching-section > h2 {
  background: #d2ded8 !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding: 0.9rem 1.15rem !important;
}

/* Teaching — university subsections: visibly lighter and flat. */
.teaching-page .institution-head {
  background: #edf2ef !important;
  border-top: 1px solid #dfe7e3 !important;
  border-bottom: 1px solid #dfe7e3 !important;
  border-left: 0 !important;
  border-right: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

/* Keep the teaching content itself free of card/bubble surfaces. */
.teaching-page .teaching-section,
.teaching-page .institution,
.teaching-page .course-detail,
.teaching-page .teaching-summary,
.teaching-page .teaching-summary div {
  border-radius: 0 !important;
  box-shadow: none !important;
}


/* ============================================================
   Research page: pinned section and subsection navigation
   ============================================================ */
.research-layout {
  max-width: 92rem;
}

.research-rail-inner {
  padding-top: 4.5rem;
}

.research-rail-nav .rail-group {
  border-bottom: 1px solid var(--rule);
}

.research-rail-nav .rail-group > a {
  border-bottom: none;
}

.research-subnav {
  list-style: none;
  margin: 0 0 0.55rem;
  padding: 0 0 0 0.78rem;
  border-left: 2px solid rgba(46, 106, 87, 0.16);
}

.research-subnav li {
  border: 0 !important;
}

.research-subnav a {
  display: block;
  padding: 0.34rem 0.12rem 0.34rem 0.5rem;
  font-size: 0.75rem;
  line-height: 1.35;
  color: var(--slate);
}

.research-rail-nav a.current,
.research-rail-nav a.current-parent {
  color: var(--ink);
  font-weight: 500;
}

.research-subnav a.current {
  color: var(--viridian);
}

.research-page #overview,
.research-page #research-interests,
.research-page #research-areas,
.research-page #students,
.research-page .research-topic {
  scroll-margin-top: 6rem;
}

@media (max-width: 77rem) {
  .research-rail-nav {
    max-width: 34rem;
  }
  .research-subnav {
    margin-bottom: 0.7rem;
  }
}


/* Publications: section titles scroll normally; do not pin them. */
.publications-page .row.cat {
  position: static !important;
  top: auto !important;
  z-index: auto !important;
}


/* ============================================================
   Unified typography, dates, and academic-profile links
   ============================================================ */

:root {
  --date-accent: #B66A2C; /* warm, muted orange with good contrast */
  --type-body: 1rem;
  --type-copy: 0.96rem;
  --type-meta: 0.76rem;
  --type-section: 1.5rem;
  --type-subsection: 1.25rem;
}

/* One typography system across every page. */
body {
  font-family: var(--sans);
  font-size: 16.5px;
  line-height: 1.65;
}

p,
li,
span,
strong {
  font-family: inherit;
}

h1,
h2,
h3,
h4,
.mark,
.rail-name,
.topic-title,
.research-paper-title,
.pub-title,
.teaching-summary span {
  font-family: var(--serif);
}

.topnav,
.margin,
.rail-heading,
.rail-nav,
.profile-links,
.news time,
.course-code,
.pub-links,
.research-paper-links,
.teaching-summary strong,
.institution-head p {
  font-family: var(--mono);
}

/* Consistent heading scale across About, Research, Publications, and Teaching. */
h2,
.cat-head,
.teaching-section > h2 {
  font-size: var(--type-section);
}

h3,
.topic-title,
.institution-head h3 {
  font-size: var(--type-subsection);
}

/* Consistent main-copy size across page-specific content blocks. */
.news li,
.course-copy p,
.topic-description p,
.research-paper-list li,
.publication-paper-list li,
.pub-authors,
.pub-venue,
.field-body {
  font-size: var(--type-copy);
}

/* Dates: larger and consistently accented on About and Teaching. */
.about-page .news time,
.teaching-summary strong,
.institution-head p {
  color: var(--date-accent);
  font-size: 0.98rem;
  font-weight: 600;
  letter-spacing: 0.025em;
  line-height: 1.4;
}

/* Keep the current-position labels readable without crowding the date column. */
.about-page .news time {
  white-space: nowrap;
}

/* Academic-profile links: flat, clearly interactive, and consistent. */
.about-profile-links a,
.publication-profile-links a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  padding: 0.48rem 0.1rem;
  color: var(--viridian);
  font-size: var(--type-meta);
  font-weight: 500;
  line-height: 1.35;
  border-bottom: 1px solid rgba(46, 106, 87, 0.42);
  transition:
    color 0.15s ease,
    border-color 0.15s ease,
    padding-left 0.15s ease;
}

.about-profile-links a::after,
.publication-profile-links a::after {
  content: "↗";
  flex: 0 0 auto;
  font-family: var(--sans);
  font-size: 0.85em;
  line-height: 1;
  opacity: 0.72;
}

.about-profile-links a:hover,
.publication-profile-links a:hover {
  color: #214f41;
  border-bottom-color: #214f41;
  padding-left: 0.28rem;
}

.about-profile-links a:focus-visible,
.publication-profile-links a:focus-visible {
  outline-color: var(--date-accent);
}

/* The About profile heading should align with the Publications profile heading. */
.about-page .profiles-heading {
  margin-top: 1.25rem;
}


/* Contact page: make Academic profile links clearly clickable. */
.contact-profile-links a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  padding: 0.48rem 0.1rem;
  color: var(--viridian);
  font-size: var(--type-meta);
  font-weight: 500;
  line-height: 1.35;
  border-bottom: 1px solid rgba(46, 106, 87, 0.42);
  transition:
    color 0.15s ease,
    border-color 0.15s ease,
    padding-left 0.15s ease;
}

.contact-profile-links a::after {
  content: "↗";
  flex: 0 0 auto;
  font-family: var(--sans);
  font-size: 0.85em;
  line-height: 1;
  opacity: 0.72;
}

.contact-profile-links a:hover {
  color: #214f41;
  border-bottom-color: #214f41;
  padding-left: 0.28rem;
}

.contact-profile-links a:focus-visible {
  outline-color: var(--date-accent);
}


/* ============================================================
   Prominent left-side section titles
   ============================================================ */

.primary-section-title,
.research-rail-nav .primary-section-link {
  font-family: var(--serif);
  font-size: 1.08rem;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.01em;
  text-transform: none;
  color: var(--viridian);
}

/* About and Contact labels retain their right alignment on wide screens. */
.primary-section-title {
  padding-top: 0.08rem;
}

/* Research main links use the same visual language. */
.research-rail-nav .primary-section-link {
  padding-top: 0.72rem;
  padding-bottom: 0.72rem;
}

.research-rail-nav .primary-section-link:hover,
.research-rail-nav .primary-section-link.current {
  color: #214f41;
}

/* Keep the labels readable when the layout collapses on smaller screens. */
@media (max-width: 46rem) {
  .primary-section-title {
    font-size: 1.02rem;
  }
}


/* Restore the original monospaced label font while retaining prominence. */
.primary-section-title,
.research-rail-nav .primary-section-link {
  font-family: var(--mono) !important;
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: 0.07em;
  text-transform: none;
  color: var(--viridian);
}

.research-rail-nav .primary-section-link {
  padding-top: 0.68rem;
  padding-bottom: 0.68rem;
}

.primary-section-title {
  padding-top: 0.12rem;
}


/* ============================================================
   Responsive refinements for tablets and phones
   ============================================================ */

html {
  scroll-behavior: smooth;
}

body {
  overflow-x: hidden;
}

img,
svg,
iframe {
  max-width: 100%;
}

a,
p,
li,
span,
h1,
h2,
h3,
h4 {
  overflow-wrap: anywhere;
}

/* ---------- tablets and small laptops ---------- */
@media (max-width: 64rem) {
  .wrap {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
  }

  .topbar .wrap {
    gap: 0.8rem 1.2rem;
  }

  .row {
    grid-template-columns: 6rem minmax(0, 1fr);
    gap: 1.6rem;
  }

  .margin.year {
    font-size: 1.48rem;
  }

  /* Rails move above the content and become compact navigation panels. */
  .about-layout,
  .teaching-layout,
  .research-layout {
    grid-template-columns: 1fr;
    gap: 0;
    max-width: 82rem;
  }

  .rail-inner,
  .teaching-rail-inner,
  .research-rail-inner {
    position: static;
    top: auto;
    padding-top: 2.3rem;
  }

  .about-body > main,
  .teaching-body,
  .research-body > main {
    padding-top: 2.2rem;
  }

  .rail-nav,
  .teaching-rail-nav,
  .research-rail-nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 1.4rem;
    align-items: start;
  }

  .rail-nav li,
  .teaching-rail-nav li,
  .research-rail-nav li {
    min-width: 0;
  }

  .teaching-rail-nav .rail-group,
  .research-rail-nav .rail-group {
    grid-column: 1 / -1;
  }

  .teaching-subnav,
  .research-subnav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 1.3rem;
    padding-left: 0.7rem;
  }

  .profile-links {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .about-profile-links,
  .publication-profile-links {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .contact-split {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .contact-map iframe {
    min-height: 330px;
    height: 330px;
  }

  .topic-intro {
    grid-template-columns: minmax(0, 1fr) 13rem;
    gap: 1.25rem;
  }

  .topic-media img {
    max-width: 13rem;
  }

  .course-detail {
    grid-template-columns: minmax(0, 1fr) 9rem;
    gap: 1.4rem;
  }

  .textbook-media {
    width: 9rem;
    height: 13.25rem;
  }

  .teaching-summary div {
    gap: 1.25rem;
  }

  .institution-head {
    gap: 1rem;
  }
}

/* ---------- phones and narrow tablets ---------- */
@media (max-width: 48rem) {
  body {
    font-size: 16px;
    line-height: 1.6;
  }

  .wrap {
    width: 100%;
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .topbar {
    position: sticky;
  }

  .topbar .wrap {
    display: block;
    padding-top: 0.75rem;
    padding-bottom: 0.65rem;
  }

  .mark {
    display: block;
    width: max-content;
    max-width: 100%;
    margin-bottom: 0.55rem;
    font-size: 1rem;
  }

  .topnav {
    display: flex;
    width: 100%;
    max-width: 100%;
    flex-wrap: nowrap;
    gap: 1rem;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    padding-bottom: 0.25rem;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
  }

  .topnav a {
    flex: 0 0 auto;
    white-space: nowrap;
    padding: 0.12rem 0 0.25rem;
  }

  .about-layout,
  .teaching-layout,
  .research-layout {
    display: block;
  }

  .rail-inner,
  .teaching-rail-inner,
  .research-rail-inner {
    padding-top: 1.7rem;
  }

  .rail-heading {
    margin-bottom: 0.55rem;
  }

  .rail-nav,
  .teaching-rail-nav,
  .research-rail-nav {
    display: block;
    border-bottom: 1px solid var(--rule);
  }

  .rail-nav a,
  .teaching-rail-nav a,
  .research-rail-nav a {
    min-height: 2.65rem;
    align-items: center;
    padding-top: 0.62rem;
    padding-bottom: 0.62rem;
  }

  .teaching-subnav,
  .research-subnav {
    display: block;
    margin-bottom: 0.7rem;
    padding-left: 0.55rem;
  }

  .teaching-subnav a,
  .research-subnav a {
    min-height: 2.35rem;
    font-size: 0.78rem;
    padding-top: 0.48rem;
    padding-bottom: 0.48rem;
  }

  .about-layout .portrait {
    width: 5.5rem;
  }

  .rail-name {
    font-size: 1.65rem;
  }

  .about-body > main,
  .teaching-body,
  .research-body > main {
    padding-top: 1.8rem;
    padding-bottom: 3.5rem;
  }

  .row {
    grid-template-columns: 1fr;
    gap: 0.55rem;
    padding-top: 2.2rem;
  }

  .row + .row {
    margin-top: 0;
  }

  .margin,
  .primary-section-title {
    text-align: left;
    padding-top: 0;
  }

  .margin.year {
    font-size: 1.32rem;
    color: var(--date-accent);
    margin-bottom: 0.15rem;
  }

  .hero,
  .teaching-page-title {
    padding-top: 0;
  }

  .hero-name,
  .teaching-page-title {
    font-size: clamp(2rem, 11vw, 2.7rem);
  }

  h2,
  .cat-head,
  .teaching-section > h2 {
    font-size: 1.34rem;
  }

  h3,
  .topic-title,
  .institution-head h3 {
    font-size: 1.14rem;
  }

  .lede {
    font-size: 1rem;
  }

  .interest-list {
    columns: 1;
    padding-left: 1.05rem;
  }

  .research-topic {
    padding-top: 1.45rem;
    padding-bottom: 1.45rem;
  }

  .topic-title {
    margin-bottom: 0.75rem;
  }

  .topic-intro {
    grid-template-columns: 1fr;
    gap: 0.85rem;
  }

  .topic-media {
    justify-content: flex-start;
  }

  .topic-media img {
    width: min(100%, 21rem);
    max-width: 100%;
    border-radius: 8px;
  }

  .topic-publications {
    margin-top: 1rem;
  }

  .research-paper-list,
  .publication-paper-list {
    padding-left: 1.05rem;
  }

  .research-paper-list li,
  .publication-paper-list li {
    font-size: 0.92rem;
    line-height: 1.5;
  }

  .research-paper-links {
    display: block;
    white-space: normal;
    margin-top: 0.25rem;
  }

  .research-paper-links a {
    display: inline-block;
    margin: 0 0.55rem 0.2rem 0;
    padding: 0.1rem 0;
  }

  .publications-page .about-body,
  .publications-page .rail-inner {
    text-align: left;
  }

  .publications-page .row.cat {
    margin-top: 1.2rem;
    padding-top: 0;
    padding-bottom: 0;
  }

  .publications-page .row.cat .column {
    padding: 0.72rem 0.85rem !important;
  }

  .profile-links,
  .about-profile-links,
  .publication-profile-links,
  .contact-profile-links {
    grid-template-columns: 1fr;
  }

  .news li {
    grid-template-columns: 1fr;
    gap: 0.2rem;
  }

  .about-page .news time {
    white-space: normal;
  }

  .contact-split {
    padding-top: 2rem;
  }

  .contact-map iframe {
    min-height: 280px;
    height: 280px;
  }

  .contact-profile-links {
    max-width: none;
  }

  .teaching-section {
    padding-bottom: 2.7rem;
  }

  .teaching-section + .teaching-section {
    padding-top: 2.4rem;
  }

  .teaching-section > h2 {
    padding: 0.72rem 0.85rem !important;
  }

  .teaching-summary {
    margin: 1.2rem 0 2rem;
  }

  .teaching-summary div {
    display: block;
    padding: 0.72rem 0;
  }

  .teaching-summary strong {
    display: block;
    margin-top: 0.2rem;
    font-size: 0.9rem;
  }

  .institution {
    margin-bottom: 2.7rem;
  }

  .institution-head {
    display: block;
    padding: 0.75rem 0.8rem;
  }

  .institution-head p {
    margin-top: 0.25rem;
    white-space: normal;
  }

  .course-detail,
  .course-detail.no-textbook {
    grid-template-columns: 1fr;
    gap: 1rem;
    padding: 1.35rem 0;
  }

  .course-copy p {
    text-align: left;
  }

  .textbook-media {
    width: 8.5rem;
    height: 12.5rem;
    margin-top: 0.15rem;
  }

  .foot {
    padding-top: 1.35rem;
    padding-bottom: 1.8rem;
  }

  .foot .wrap {
    display: block;
  }

  .foot .wrap span {
    display: block;
  }

  .foot .wrap span + span {
    margin-top: 0.45rem;
  }
}

/* ---------- very narrow phones ---------- */
@media (max-width: 24rem) {
  .wrap {
    padding-left: 0.8rem;
    padding-right: 0.8rem;
  }

  .topnav {
    gap: 0.8rem;
    font-size: 0.68rem;
  }

  .mark {
    font-size: 0.94rem;
  }

  .profile-links a,
  .about-profile-links a,
  .publication-profile-links a,
  .contact-profile-links a {
    font-size: 0.72rem;
  }

  .textbook-media {
    width: 7.75rem;
    height: 11.5rem;
  }
}

/* Print-friendly fallback. */
@media print {
  .topbar,
  .rail,
  .teaching-rail,
  .research-rail {
    display: none !important;
  }

  .about-layout,
  .teaching-layout,
  .research-layout,
  .row,
  .course-detail,
  .topic-intro {
    display: block !important;
  }

  body {
    background: #fff;
    color: #000;
  }

  a {
    color: #000;
  }
}


/* ============================================================
   Mobile-only sticky "On this page" navigation
   ============================================================ */

.mobile-page-nav,
.mobile-profile-section {
  display: none;
}

@media (max-width: 48rem) {
  .research-page .research-rail,
  .teaching-page .teaching-rail,
  .publications-page .rail {
    display: none;
  }

  .mobile-profile-section {
    display: grid;
  }

  .mobile-page-nav {
    position: sticky;
    top: var(--mobile-topbar-height, 5.4rem);
    z-index: 90;
    display: block;
    width: 100%;
    background: rgba(246, 247, 245, 0.97);
    border-bottom: 1px solid var(--rule);
    -webkit-backdrop-filter: saturate(140%) blur(10px);
    backdrop-filter: saturate(140%) blur(10px);
  }

  .mobile-page-nav-inner {
    width: 100%;
    max-width: 82rem;
    margin: 0 auto;
    padding: 0 1rem;
  }

  .mobile-page-nav-toggle {
    width: 100%;
    min-height: 3.1rem;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.45rem;
    padding: 0.62rem 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--ink);
    text-align: left;
    cursor: pointer;
    font: inherit;
  }

  .mobile-page-nav-prefix {
    font-family: var(--mono);
    font-size: 0.68rem;
    letter-spacing: 0.075em;
    text-transform: uppercase;
    color: var(--amber);
    white-space: nowrap;
  }

  .mobile-page-nav-current {
    min-width: 0;
    font-family: var(--mono);
    font-size: 0.82rem;
    font-weight: 500;
    line-height: 1.3;
    color: var(--viridian);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .mobile-page-nav-icon {
    font-size: 1rem;
    line-height: 1;
    color: var(--viridian);
  }

  .mobile-page-nav-menu {
    max-height: min(62vh, 28rem);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 0.2rem 0 0.55rem;
    border-top: 1px solid var(--rule);
    background: var(--paper);
    -webkit-overflow-scrolling: touch;
  }

  .mobile-page-nav-menu[hidden] {
    display: none;
  }

  .mobile-page-nav-menu a {
    display: block;
    min-height: 2.65rem;
    padding: 0.65rem 0.15rem;
    border-bottom: 1px solid rgba(224, 228, 224, 0.78);
    color: var(--slate);
    font-family: var(--mono);
    font-size: 0.79rem;
    line-height: 1.35;
  }

  .mobile-page-nav-menu a:last-child {
    border-bottom: 0;
  }

  .mobile-page-nav-menu a:hover,
  .mobile-page-nav-menu a:focus-visible,
  .mobile-page-nav-menu a[aria-current="location"] {
    color: var(--viridian);
  }

  .mobile-page-nav-subitem {
    padding-left: 1.05rem !important;
    font-size: 0.74rem !important;
    color: #6a7571 !important;
    border-left: 2px solid rgba(46, 106, 87, 0.18);
  }

  .mobile-page-nav-subitem[aria-current="location"] {
    color: var(--viridian) !important;
    border-left-color: var(--viridian);
  }

  .about-page #about,
  .about-page #experience,
  .about-page #education,
  .research-page #overview,
  .research-page #research-interests,
  .research-page #research-areas,
  .research-page #students,
  .research-page .research-topic,
  .publications-page #preprints,
  .publications-page #journal-articles,
  .publications-page #conference-proceedings,
  .publications-page #published-abstracts,
  .publications-page #academic-profiles,
  .teaching-page #students,
  .teaching-page #teaching-experience,
  .teaching-page .institution {
    scroll-margin-top: calc(
      var(--mobile-topbar-height, 5.4rem) + 4.2rem
    ) !important;
  }

  .about-page .rail-inner {
    padding-top: 1.45rem;
  }

  .mobile-publication-profile-links {
    grid-template-columns: 1fr;
    margin-top: 0.4rem;
  }
}

@media (max-width: 24rem) {
  .mobile-page-nav-inner {
    padding-left: 0.8rem;
    padding-right: 0.8rem;
  }

  .mobile-page-nav-prefix {
    font-size: 0.62rem;
  }

  .mobile-page-nav-current {
    font-size: 0.76rem;
  }
}


/* ============================================================
   Reliable native mobile "On this page" dropdown
   ============================================================ */

@media (max-width: 48rem) {
  .mobile-page-nav-details {
    width: 100%;
  }

  .mobile-page-nav-summary {
    width: 100%;
    min-height: 3.1rem;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.45rem;
    padding: 0.62rem 0;
    color: var(--ink);
    cursor: pointer;
    list-style: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
  }

  .mobile-page-nav-summary::-webkit-details-marker {
    display: none;
  }

  .mobile-page-nav-summary::marker {
    content: "";
  }

  .mobile-page-nav-details[open] .mobile-page-nav-icon {
    transform: rotate(180deg);
  }

  .mobile-page-nav-icon {
    transition: transform 0.15s ease;
  }

  .mobile-page-nav-details:not([open]) .mobile-page-nav-menu {
    display: none;
  }

  .mobile-page-nav-details[open] .mobile-page-nav-menu {
    display: block;
  }

  .mobile-page-nav-summary:focus-visible {
    outline: 2px solid var(--viridian);
    outline-offset: 2px;
  }
}


/* ============================================================
   Teaching page — student supervision
   ============================================================ */

.student-group {
  padding-top: 1.8rem;
  scroll-margin-top: 8rem;
}

.student-group + .student-group {
  margin-top: 0.4rem;
}

.student-group-title {
  margin: 0 0 0.85rem;
  padding: 0.58rem 0.72rem;
  background: rgba(46, 106, 87, 0.09);
  border-left: 3px solid var(--viridian);
  color: var(--viridian);
  font-family: var(--serif);
  font-size: 1.18rem;
  font-weight: 600;
  line-height: 1.3;
}

.student-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.student-list li {
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--rule);
}

.student-list li:first-child {
  padding-top: 0.2rem;
}

.student-entry {
  margin: 0;
  font-size: var(--type-copy);
  line-height: 1.65;
  text-align: justify;
}

.student-name {
  color: var(--ink);
  font-weight: 650;
}

.student-name-link,
.student-resource-link {
  color: var(--viridian);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

.student-name-link::after,
.student-resource-link[target="_blank"]::after {
  content: " ↗";
  font-size: 0.78em;
  text-decoration: none;
}

.student-name-link:hover,
.student-resource-link:hover {
  color: #214f41;
  text-decoration-thickness: 2px;
}

.student-supervision-note {
  margin: 1.5rem 0 0;
  padding-top: 1.15rem;
  border-top: 1px solid var(--rule);
  font-size: var(--type-copy);
  line-height: 1.65;
  text-align: justify;
}

.student-subnav {
  margin-bottom: 0.7rem;
}

@media (max-width: 48rem) {
  .student-group {
    padding-top: 1.35rem;
    scroll-margin-top: calc(
      var(--mobile-topbar-height, 5.4rem) + 4.2rem
    );
  }

  .student-group-title {
    font-size: 1.08rem;
    padding: 0.55rem 0.65rem;
  }

  .student-entry,
  .student-supervision-note {
    text-align: left;
    font-size: 0.94rem;
  }

  .student-list li {
    padding: 0.78rem 0;
  }
}


/* ============================================================
   Dedicated Students page
   ============================================================ */

.students-page .students-page-section {
  padding-top: 3.5rem;
  padding-bottom: 4.5rem;
}

.students-page .students-page-section > .teaching-page-title {
  margin-bottom: 1rem;
}

.students-page .student-group:first-of-type {
  padding-top: 1rem;
}

.students-page .student-supervision-note {
  max-width: 70rem;
}

@media (max-width: 48rem) {
  .students-page .teaching-rail {
    display: none;
  }

  .students-page .students-page-section {
    padding-top: 1.8rem;
    padding-bottom: 3.5rem;
  }

  .students-page #students,
  .students-page #graduate-students,
  .students-page #undergraduate-researchers {
    scroll-margin-top: calc(
      var(--mobile-topbar-height, 5.4rem) + 4.2rem
    ) !important;
  }
}


/* ============================================================
   Teaching page — Courses Taught subsection
   ============================================================ */

.courses-taught-heading {
  margin: 2.2rem 0 1rem;
  padding: 0.72rem 0.85rem;
  background: rgba(46, 106, 87, 0.09);
  border-left: 3px solid var(--viridian);
  color: var(--viridian);
  font-family: var(--serif);
  font-size: 1.24rem;
  font-weight: 600;
  line-height: 1.3;
  scroll-margin-top: 8rem;
}

@media (max-width: 48rem) {
  .courses-taught-heading {
    margin-top: 1.7rem;
    padding: 0.65rem 0.75rem;
    font-size: 1.12rem;
    scroll-margin-top: calc(
      var(--mobile-topbar-height, 5.4rem) + 4.2rem
    );
  }
}


/* Keep Courses Taught text consistent with the other section headings. */
.courses-taught-heading {
  color: var(--ink);
}


/* ============================================================
   Students page — section styling consistent with the site
   ============================================================ */

.students-page .student-group {
  padding-top: 0;
  margin-top: 2.8rem;
  scroll-margin-top: 8rem;
}

.students-page .student-group:first-of-type {
  margin-top: 1.4rem;
  padding-top: 0;
}

.students-page .student-group + .student-group {
  margin-top: 2.8rem;
}

.students-page .student-group-title {
  width: 100%;
  margin: 0 0 1.25rem;
  padding: 0.9rem 1.15rem;
  background: #d2ded8;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.3;
}

.students-page .student-list {
  margin-top: 0;
}

.students-page .student-supervision-note {
  margin-top: 2.4rem;
  padding-top: 1.3rem;
}

@media (max-width: 48rem) {
  .students-page .student-group,
  .students-page .student-group + .student-group {
    margin-top: 2rem;
    scroll-margin-top: calc(
      var(--mobile-topbar-height, 5.4rem) + 4.2rem
    );
  }

  .students-page .student-group:first-of-type {
    margin-top: 1rem;
  }

  .students-page .student-group-title {
    margin-bottom: 1rem;
    padding: 0.72rem 0.85rem;
    font-size: 1.34rem;
  }
}


/* ============================================================
   Students — JUST thesis template on Overleaf
   ============================================================ */

.thesis-template-card {
  display: grid;
  grid-template-columns: 3.25rem minmax(0, 1fr) auto;
  align-items: center;
  gap: 1rem;
  margin: 1.45rem 0 0.4rem;
  padding: 1rem 1.1rem;
  background: rgba(46, 106, 87, 0.055);
  border: 1px solid rgba(46, 106, 87, 0.20);
  border-left: 3px solid var(--viridian);
  color: var(--ink);
  text-decoration: none;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    transform 0.15s ease;
}

.thesis-template-card:hover {
  background: rgba(46, 106, 87, 0.09);
  border-color: rgba(46, 106, 87, 0.38);
  transform: translateY(-1px);
}

.thesis-template-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3.25rem;
  height: 3.25rem;
}

.thesis-template-logo img {
  display: block;
  width: 2.65rem;
  height: 2.65rem;
  object-fit: contain;
}

.thesis-template-content {
  display: block;
  min-width: 0;
}

.thesis-template-eyebrow {
  display: block;
  margin-bottom: 0.18rem;
  font-family: var(--mono);
  font-size: 0.69rem;
  font-weight: 500;
  letter-spacing: 0.075em;
  text-transform: uppercase;
  color: var(--viridian);
}

.thesis-template-title {
  display: block;
  font-family: var(--serif);
  font-size: 1.02rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--ink);
}

.thesis-template-meta {
  display: block;
  margin-top: 0.22rem;
  font-size: 0.82rem;
  color: var(--muted);
}

.thesis-template-cta {
  font-family: var(--mono);
  font-size: 0.73rem;
  font-weight: 500;
  white-space: nowrap;
  color: var(--viridian);
}

@media (max-width: 48rem) {
  .thesis-template-card {
    grid-template-columns: 2.8rem minmax(0, 1fr);
    gap: 0.85rem;
    padding: 0.9rem;
  }

  .thesis-template-logo {
    width: 2.8rem;
    height: 2.8rem;
  }

  .thesis-template-logo img {
    width: 2.3rem;
    height: 2.3rem;
  }

  .thesis-template-title {
    font-size: 0.96rem;
  }

  .thesis-template-cta {
    grid-column: 2;
    margin-top: -0.25rem;
  }
}


/* ============================================================
   About — Academic institutions logo grid
   ============================================================ */

.about-page .institutions-heading {
  margin-top: 1.55rem;
  margin-bottom: 0.7rem;
}

.academic-institutions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.62rem;
  padding-bottom: 0.25rem;
}

.institution-logo-link {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 4.55rem;
  padding: 0.38rem;
  background: rgba(255,255,255,.72);
  border: 1px solid rgba(46,106,87,.18);
  text-decoration: none;
  transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}

.institution-logo-link:hover,
.institution-logo-link:focus-visible {
  border-color: rgba(46,106,87,.48);
  transform: translateY(-1px);
  box-shadow: 0 5px 16px rgba(28,45,39,.06);
}

.institution-logo-link img {
  display: block;
  width: 100%;
  max-width: 8.6rem;
  height: 3.6rem;
  object-fit: contain;
}

.academic-institutions .institution-logo-link:last-child:nth-child(odd) {
  grid-column: 1 / -1;
}

.academic-institutions .institution-logo-link:last-child:nth-child(odd) img {
  max-width: 9.4rem;
}

@media (max-width: 48rem) {
  .about-page .institutions-heading {
    margin-top: 1.35rem;
  }

  .academic-institutions {
    max-width: 28rem;
    gap: 0.7rem;
  }

  .institution-logo-link {
    min-height: 4.8rem;
  }
}


/* ============================================================
   About page — academic institution logos (web PNGs, no boxes)
   ============================================================ */

.academic-institutions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem 1rem;
  align-items: center;
  padding-bottom: 0.1rem;
}

.institution-logo-link {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
  text-decoration: none;
  transition: opacity .15s ease, transform .15s ease;
}

.institution-logo-link:hover,
.institution-logo-link:focus-visible {
  border: 0;
  box-shadow: none;
  background: transparent;
  opacity: 0.92;
  transform: translateY(-1px);
}

.institution-logo-link img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 4.5rem;
  object-fit: contain;
}

.academic-institutions .institution-logo-link:nth-child(1) img {
  max-height: 4.35rem;
}

.academic-institutions .institution-logo-link:nth-child(2) img {
  max-height: 4.6rem;
}

.academic-institutions .institution-logo-link:nth-child(3) img,
.academic-institutions .institution-logo-link:nth-child(4) img {
  max-height: 4.1rem;
}

.academic-institutions .institution-logo-link:last-child:nth-child(odd) {
  grid-column: 1 / -1;
}

.academic-institutions .institution-logo-link:last-child:nth-child(odd) img {
  max-height: 6.5rem;
}

@media (max-width: 48rem) {
  .academic-institutions {
    max-width: 28rem;
    gap: 0.7rem 0.9rem;
  }

  .institution-logo-link img {
    max-height: 4.1rem;
  }

  .academic-institutions .institution-logo-link:last-child:nth-child(odd) img {
    max-height: 6rem;
  }
}


/* ============================================================
   About page — uploaded university logos
   ============================================================ */

.academic-institutions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem 1rem;
  align-items: center;
}

.institution-logo-link {
  min-height: 0 !important;
  padding: 0 !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

.institution-logo-link:hover,
.institution-logo-link:focus-visible {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

.institution-logo-link img {
  display: block;
  width: 100%;
  height: 5.1rem;
  max-width: 100%;
  max-height: none;
  object-fit: contain;
}

/* Balance the visual size of the different logo shapes. */
.academic-institutions .institution-logo-link:nth-child(1) img {
  height: 5.0rem;
}

.academic-institutions .institution-logo-link:nth-child(2) img {
  height: 4.7rem;
}

.academic-institutions .institution-logo-link:nth-child(3) img {
  height: 4.6rem;
}

.academic-institutions .institution-logo-link:nth-child(4) img {
  height: 4.5rem;
}

.academic-institutions .institution-logo-link:last-child:nth-child(odd) {
  grid-column: 1 / -1;
  justify-self: center;
  width: 58%;
}

.academic-institutions .institution-logo-link:last-child:nth-child(odd) img {
  height: 6.2rem;
  width: 100%;
}

@media (max-width: 48rem) {
  .academic-institutions {
    gap: 0.8rem 0.9rem;
  }

  .institution-logo-link img {
    height: 4.5rem;
  }

  .academic-institutions .institution-logo-link:last-child:nth-child(odd) {
    width: 55%;
  }

  .academic-institutions .institution-logo-link:last-child:nth-child(odd) img {
    height: 5.5rem;
  }
}
