/* Shared colour variables used throughout the website. */
:root {
  --paper: #fdfffd;
  --ink: #0f1d1a;
  --muted: #485e56;
  --teal: #126b62;
  --line: #d5dfda;
  --white: #fff;
  --accent: #955031;
}

/* Base styles, links, keyboard focus and typography. */
* {
  box-sizing: border-box;
}

/* Offset applied when navigating to an anchor on the page. */
html {
  scroll-padding-top: 20px;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: system-ui,-apple-system,"Segoe UI",sans-serif;
  font-size: 16px;
  line-height: 1.7;
}

a {
  color: var(--teal);
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

a:hover {
  color: var(--ink);
}

a:focus-visible,summary:focus-visible {
  outline: 3px solid var(--teal);
  outline-offset: 5px;
  border-radius: 2px;
}

img {
  display: block;
  max-width: 100%;
}

p,h1,h2,h3 {
  margin-top: 0;
}

p {
  margin-bottom: 1rem;
}

h1,h2,h3 {
  font-family: Georgia,"Times New Roman",serif;
  font-weight: 400;
  line-height: 1.18;
}

h1 {
  font-size: clamp(2.5rem,5vw,3.8rem);
  letter-spacing: -.035em;
  margin-bottom: 20px;
}

h2 {
  font-size: clamp(1.7rem,3vw,2.1rem);
  margin-bottom: 20px;
}

h3 {
  font-size: 1.35rem;
  margin-bottom: 10px;
}

/* Shared page width and horizontal spacing. */
main,.header-inner,.footer-inner {
  max-width: 1080px;
  margin: auto;
  padding-left: 40px;
  padding-right: 40px;
}

/* Header and navigation. */
.site-header {
  border-top: 4px solid var(--teal);
  border-bottom: 1px solid var(--line);
}

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

.brand {
  color: var(--ink);
  font-family: Georgia,serif;
  font-size: 1.2rem;
  text-decoration: none;
  white-space: nowrap;
}

nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
}

nav a {
  font-size: .94rem;
  color: var(--muted);
  text-decoration: none;
  padding: 7px 0;
  border-bottom: 2px solid transparent;
}

nav a:hover,nav a[aria-current=page] {
  color: var(--teal);
  border-bottom-color: var(--teal);
}

/* Accessible link for skipping directly to the main content. */
.skip-link {
  position: absolute;
  top: -100px;
  left: 20px;
  padding: 10px 18px;
  background: white;
  z-index: 20;
}

.skip-link:focus {
  top: 10px;
}

/* Small section labels. */
.eyebrow {
  font-size: .875rem;
  color: var(--teal);
  font-weight: 650;
  letter-spacing: .07em;
  text-transform: uppercase;
  margin-bottom: 14px;
}

/* Homepage introduction and portrait. */
.hero {
  display: grid;
  grid-template-columns: minmax(0,1fr) 190px;
  gap: 64px;
  align-items: start;
  padding: 58px 0 44px;
}

.hero h1 {
  margin-bottom: 12px;
}

.position {
  font-size: 1.12rem;
  color: var(--muted);
  margin-bottom: 22px;
}

.intro {
  font-size: 1.1rem;
  max-width: 690px;
}

.portrait {
  margin: 6px 0 0;
}

.portrait img {
  width: 190px;
  aspect-ratio: 4/5;
  object-fit: cover;
  border-radius: 3px;
}

.portrait figcaption {
  font-size: .875rem;
  color: var(--muted);
  padding-top: 10px;
}

/* Reusable link rows and section layout. */
.inline-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  font-size: .94rem;
  margin-top: 20px;
}

.section {
  padding: 36px 0 40px;
  border-top: 2px solid var(--line);
}

.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.section-heading h2 {
  margin: 0;
}

.section-heading>a {
  font-size: .94rem;
}

.section-intro {
  color: var(--muted);
  max-width: 740px;
}

/* Lists of research work and publications. */
.work-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.work-list>li {
  display: grid;
  grid-template-columns: 120px minmax(0,1fr);
  gap: 26px;
  padding: 24px 0;
  border-bottom: 1px solid var(--line);
}

.work-list>li:first-child {
  padding-top: 0;
}

.work-list>li:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.meta {
  font-size: .9rem;
  color: var(--muted);
  line-height: 1.6;
}

.meta strong {
  display: block;
  color: var(--teal);
  font-weight: 600;
}

.work-list h3 a {
  color: var(--ink);
  text-decoration: none;
}

.work-list h3 a:hover {
  text-decoration: underline;
  text-decoration-color: var(--teal);
}

.work-list p {
  color: var(--muted);
  margin-bottom: 8px;
}

.work-list .inline-links {
  margin-top: 12px;
}

/* Page titles and introductory text. */
.page-title {
  padding: 54px 0 34px;
  max-width: 820px;
}

.page-title p:last-child {
  color: var(--muted);
  font-size: 1.1rem;
  margin-bottom: 0;
}

/* Research descriptions and equations. */
.research-section {
  display: grid;
  grid-template-columns: 180px minmax(0,1fr);
  gap: 35px;
  padding: 36px 0;
  border-top: 1px solid var(--line);
}

.research-section .eyebrow {
  padding-top: 6px;
}

.research-section p {
  max-width: 720px;
}

.research-section h2 {
  font-size: 1.8rem;
}

.equation {
  font-family: Georgia,serif;
  font-size: 1.35rem;
  padding: 15px 22px;
  border-left: 2px solid var(--teal);
  background: #edf3ef;
  overflow-wrap: anywhere;
}

.equation sup {
  font-size: .75em;
}

.research-section .inline-links {
  margin-top: 12px;
}

/* Contact information. */
.contact {
  display: grid;
  grid-template-columns: 180px minmax(0,1fr);
  gap: 35px;
}

.contact p {
  margin-bottom: 8px;
}

.email {
  overflow-wrap: anywhere;
}

.contact small {
  font-size: .9rem;
  color: var(--muted);
}

/* Conference and teaching event lists. */
.event-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.event-list li {
  display: grid;
  grid-template-columns: 150px minmax(0,1fr);
  gap: 28px;
  border-top: 1px solid var(--line);
  padding: 25px 0;
}

.event-list li:first-child {
  border-top: 0;
  padding-top: 0;
}

.event-list h3 {
  font-size: 1.4rem;
}

.event-list p {
  color: var(--muted);
  margin: 0 0 6px;
}

.event-date {
  font-size: 1rem;
  color: var(--teal);
  font-variant-numeric: tabular-nums;
}

.course-list {
  padding-left: 20px;
  margin: 8px 0 0;
}

.course-list li {
  margin-bottom: 5px;
}

.publication-title {
  max-width: 780px;
}

.authors {
  color: var(--ink)!important;
}

.status {
  color: var(--accent);
  font-size: .9rem;
}

/* Expandable content: HTML handles the toggle; CSS controls its appearance. */
details {
  margin-top: 14px;
}

summary {
  cursor: pointer;
  color: var(--teal);
  width: fit-content;
  font-size: .94rem;
}

details p {
  padding-top: 12px;
  max-width: 740px;
}

/* Footer and text selection. */
footer {
  border-top: 1px solid var(--line);
  margin-top: 28px;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding-top: 24px;
  padding-bottom: 28px;
  font-size: .875rem;
  color: var(--muted);
}

.footer-inner p {
  margin: 0;
}

::selection {
  background: #c8e2d9;
}

/* Tablet and narrow-screen layout. */
@media(max-width:760px) {
  main,.header-inner,.footer-inner {
    padding-left: 24px;
    padding-right: 24px;
  }

  .header-inner {
    align-items: flex-start;
    flex-direction: column;
    padding-top: 18px;
    padding-bottom: 12px;
    gap: 8px;
  }

  nav {
    gap: 4px 18px;
  }

  .hero {
    grid-template-columns: minmax(0,1fr) 135px;
    gap: 24px;
    padding-top: 36px;
  }

  .portrait img {
    width: 135px;
  }

  .research-section,.contact {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .research-section .eyebrow {
    margin-bottom: 5px;
  }

  .work-list>li {
    grid-template-columns: 95px minmax(0,1fr);
    gap: 18px;
  }

  .event-list li {
    grid-template-columns: 120px minmax(0,1fr);
    gap: 20px;
  }

  .page-title {
    padding-top: 36px;
  }

  .section-heading {
    align-items: flex-start;
  }

  .footer-inner {
    flex-wrap: wrap;
  }

}

/* Phone layout. */
@media(max-width:480px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .portrait {
    display: flex;
    gap: 18px;
    align-items: center;
    margin: 0;
  }

  .portrait img {
    width: 92px;
  }

  .portrait figcaption {
    padding: 0;
  }

  .hero h1 {
    font-size: 2.6rem;
  }

  .work-list>li,.event-list li {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .meta strong {
    display: inline;
    margin-right: 8px;
  }

  .section-heading {
    flex-direction: column;
    gap: 8px;
  }

  .section {
    padding: 28px 0;
  }

  .page-title h1 {
    font-size: 2.6rem;
  }

}

/* Respect reduced-motion preferences. */
@media(prefers-reduced-motion:reduce) {
  html {
    scroll-behavior: auto;
  }

}

/* Print layout. */
@media print {
  body {
    background: white;
    font-size: 11pt;
  }

  nav,.skip-link {
    display: none;
  }

  main,.header-inner,.footer-inner {
    max-width: none;
    padding-left: 0;
    padding-right: 0;
  }

  .site-header {
    border-top: 0;
  }

  .hero {
    padding-top: 25px;
  }

  .section,.research-section {
    break-inside: avoid;
  }

  .footer-inner {
    padding-bottom: 0;
  }

}

/* Compact bibliography; homepage work previews retain their own spacing. */
.publications-page .page-title {
  padding-bottom: 26px;
}

.publications-page .page-title h1 {
  font-size: clamp(2rem,4vw,2.8rem);
}

.publications-page .page-title p:last-child {
  font-size: 1rem;
}

.publications-page .section {
  padding: 24px 0 28px;
}

.publications-page .section>h2 {
  font-size: 1.4rem;
  margin-bottom: 20px;
}

.publications-page .work-list>li {
  grid-template-columns: 95px minmax(0,1fr);
  gap: 22px;
  padding: 18px 0;
}

.publications-page .work-list>li:first-child {
  padding-top: 0;
}

.publications-page .work-list>li:last-child {
  padding-bottom: 0;
}

.publications-page .publication-title {
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.5;
  margin-bottom: 5px;
}

.publications-page .work-list p {
  margin-bottom: 4px;
  line-height: 1.6;
}

.publications-page .inline-links {
  font-size: .875rem;
  gap: 4px 16px;
  margin-top: 8px;
}

.publications-page details {
  margin-top: 8px;
}

.publications-page summary {
  font-size: .875rem;
}

.publications-page details p {
  padding-top: 8px;
}

/* Compact ANR meeting entry. */
.project-meetings {
  padding-top: 24px;
  padding-bottom: 24px;
}

.project-meetings h2 {
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 10px;
}

.project-meetings p {
  color: var(--muted);
  margin: 0;
}

.project-meetings strong {
  font-weight: 600;
}

/* Phone layout. */
@media(max-width:480px) {
  .publications-page .work-list>li {
    grid-template-columns: 1fr;
    gap: 7px;
  }

}

/* Biological schematics and captions. */
.fungal-model {
  margin: 24px 0;
}

.fungal-model-panels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.fungal-model-panels>div {
  background: #fff;
  border: 1px solid var(--line);
  padding: 12px;
}

.fungal-model-panels img {
  width: 100%;
  height: auto;
  aspect-ratio: 725/427;
  object-fit: contain;
}

.fungal-model-panels p {
  font-size: .9rem;
  font-weight: 600;
  margin: 10px 0 0;
  color: var(--ink);
  text-align: center;
}

.fungal-model figcaption {
  font-size: .9rem;
  line-height: 1.6;
  color: var(--muted);
  margin-top: 12px;
}

@media(max-width:540px) {
  .fungal-model-panels {
    grid-template-columns: 1fr;
  }

}

/* Explanation of the mathematical approximations. */
.model-approximations {
  margin: 20px 0;
}

.model-approximations ol {
  padding-left: 22px;
  margin: 14px 0;
}

.model-approximations li {
  margin-bottom: 10px;
  color: var(--muted);
}

.model-approximations strong {
  color: var(--ink);
  font-weight: 600;
}

.model-approximations p {
  padding-top: 0;
}

.research-connection {
  margin-top: 20px;
}

/* Mathematical diagrams. */
.technical-figure {
  margin: 22px 0;
}

.technical-figure img {
  width: 100%;
  height: auto;
  background: #fff;
}

.technical-figure>a {
  display: block;
}

.domain-figure img {
  max-width: 440px;
  margin: auto;
}

.technical-figure figcaption {
  font-size: .9rem;
  line-height: 1.6;
  color: var(--muted);
  margin-top: 12px;
}

/* A concise record of tutorial teaching. */
.teaching-page .page-title {
  padding: 32px 0 20px;
}

.teaching-page .page-title h1 {
  font-size: 2.2rem;
  margin-bottom: 12px;
}

.teaching-page .page-title p {
  font-size: 1rem;
}

.teaching-page .section {
  padding: 18px 0;
}

.teaching-list {
  margin: 0 0 16px;
}

.teaching-list>div {
  display: grid;
  grid-template-columns: 150px minmax(0,1fr);
  gap: 22px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.teaching-list>div:first-child {
  padding-top: 0;
}

.teaching-list dt {
  font-weight: 600;
}

.teaching-list dt span {
  display: block;
  font-size: .9rem;
  font-weight: 400;
  color: var(--muted);
}

.teaching-list dd {
  margin: 0;
  line-height: 1.6;
}

@media(max-width:540px) {
  .teaching-list>div {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .teaching-list dt span {
    display: inline;
    margin-left: 12px;
  }

}

/* Photograph of the fungal network. */
.fungus-photo {
  margin: 18px 0 24px;
  max-width: 430px;
}

.fungus-photo img {
  display: block;
  width: 100%;
  height: auto;
}

.fungus-photo figcaption {
  font-size: .875rem;
  line-height: 1.5;
  color: var(--muted);
  margin-top: 10px;
}
