/* =========================================================
   GLOBAL
   ========================================================= */

html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

body {
  font-size: 1rem;
  line-height: 1.6;
  color: #292d32;
}

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

.navbar {
  padding: 1rem 1.5rem;
  background: #ffffff;
  border-bottom: 1px solid #eeeeee;
}

.navbar-brand {
  font-weight: 650;
  letter-spacing: -0.02em;
}


/* =========================================================
   HOMEPAGE — MASTER LAYOUT
   ========================================================= */

.home-layout {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 3rem 3rem 7rem 3rem;
  box-sizing: border-box;

  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  column-gap: 4rem;
  align-items: start;
}

.home-sidebar,
.home-main {
  min-width: 0;
}

/* =========================================================
   REMOVE QUARTO EXTERNAL / PDF LINK ICONS
   ========================================================= */

.home-layout a[href$=".pdf"]::after,
.home-layout a.external::after,
.home-layout a.external .external-icon,
.home-layout .external-link::after {
  display: none !important;
  content: none !important;
  background-image: none !important;
  width: 0 !important;
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* ---------- Left profile ---------- */

.sidebar-profile {
  margin-bottom: 4rem;
}

.sidebar-photo {
  width: 100%;
  max-width: 260px;
  margin-bottom: 1.75rem;
}

.sidebar-photo img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
  margin: 0;
}

.sidebar-profile h2 {
  font-size: 1.7rem;
  font-weight: 650;
  letter-spacing: -0.025em;
  border: 0;
  margin: 0 0 0.8rem 0;
}

.sidebar-profile p {
  font-size: 0.9rem;
  line-height: 1.6;
  color: #555b61;
  margin-bottom: 0.75rem;
}

.sidebar-profile p a {
  text-decoration: none;
}

.sidebar-links {
  display: flex;
  align-items: center;
  gap: 1.35rem;
  margin-top: 1.25rem;
}

.sidebar-links a {
  color: #292d32;
  font-size: 0.9rem;
  font-weight: 650;
  text-decoration: none;
}

.sidebar-links i {
  font-size: 1.2rem;
}

/* ---------- Sidebar funding ---------- */

.sidebar-funding {
  border-top: 2px solid #292d32;
  padding-top: 2rem;
}

.sidebar-funding > h2 {
  font-size: 1.4rem;
  font-weight: 650;
  border: 0;
  margin: 0 0 2rem 0;
}

.sidebar-grant {
  border-top: 1px solid #cfd2d4;
  padding: 1.75rem 0;
}

.sidebar-grant:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.sidebar-grant-logo {
  margin-bottom: 1rem;
}

.sidebar-grant-logo img {
  display: block;
  width: auto;
  height: 58px;
  max-width: 120px;
  object-fit: contain;
  object-position: left center;
  margin: 0;
}

.sidebar-agency {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: #8a8f94;
  margin-bottom: 0.65rem;
}

.sidebar-grant-content h3 {
  font-size: 0.95rem;
  font-weight: 650;
  line-height: 1.4;
  margin: 0 0 0.65rem 0;
}

.sidebar-grant-content p {
  font-size: 0.78rem;
  line-height: 1.5;
  margin: 0.3rem 0;
}

.sidebar-grant-meta {
  font-size: 0.72rem;
  line-height: 1.55;
  color: #777c81;
  margin-top: 0.5rem;
}

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

.home-hero {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0 0 5rem 0;
}

.hero-tagline {
  width: 100%;
  max-width: 1150px;
  font-size: clamp(2.6rem, 3.4vw, 3.8rem);
  font-weight: 400;
  line-height: 1.18;
  letter-spacing: -0.04em;
  margin-bottom: 2rem;
}

.hero-description {
  max-width: 850px;
  font-size: 1.05rem;
  line-height: 1.7;
  color: #555b61;
  margin-bottom: 2rem;
}

.hero-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-bottom: 2.5rem;
}

.hero-button {
  display: inline-block;
  padding: 0.65rem 1.1rem;
  border: 1px solid #292d32;
  border-radius: 2px;
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.2;
  color: #292d32;
  text-decoration: none;
}

.hero-button:hover {
  background: #f2f2f2;
  color: #292d32;
  text-decoration: none;
}

.hero-button.primary {
  background: #292d32;
  color: #fff;
}

.hero-button.primary:hover {
  background: #44484d;
  color: #fff;
}

.hero-image {
  width: 100%;
  margin: 2rem 0 0 0;
}

.hero-image img {
  display: block;
  width: 100%;
  height: auto;
  margin: 0;
}

/* ---------- Homepage research ---------- */

.home-research {
  width: 100%;
  border-top: 1px solid #cfd2d4;
  padding-top: 4rem;
}

.home-research > h2 {
  font-size: 2.3rem;
  font-weight: 650;
  letter-spacing: -0.03em;
  border: 0;
  margin: 0 0 1rem 0;
}

.home-research-intro {
  max-width: 850px;
  font-size: 0.9rem;
  line-height: 1.65;
  color: #555b61;
  margin-bottom: 3rem;
}

.home-research .research-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2.5rem;
  width: 100%;
  margin: 0;
}

.home-research .research-card {
  border-top: 2px solid #292d32;
  padding-top: 1.35rem;
}

.home-research .research-card h3 {
  font-size: 1.1rem;
  font-weight: 650;
  line-height: 1.35;
  margin: 0 0 0.8rem 0;
}

.home-research .research-card p {
  font-size: 0.85rem;
  line-height: 1.6;
  color: #555b61;
}

.home-research .research-card a {
  font-size: 0.85rem;
  font-weight: 650;
  text-decoration: none;
}

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

@media (max-width: 1100px) {

  .home-layout {
    padding: 3rem 2rem 6rem 2rem;
    grid-template-columns: 230px minmax(0, 1fr);
    column-gap: 3rem;
  }

  .home-research .research-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

}

@media (max-width: 750px) {
  .home-layout {
    width: calc(100% - 3rem);
    display: flex;
    flex-direction: column;
    padding-top: 3rem;
  }

  .home-main { order: 1; }

  .home-sidebar {
    order: 2;
    width: 100%;
    border-top: 1px solid #cfd2d4;
    padding-top: 4rem;
    margin-top: 4rem;
  }

  .sidebar-photo { max-width: 200px; }
  .hero-tagline { font-size: 2.4rem; }
}

/* =========================================================
   RESEARCH PAGE
   ========================================================= */

.research-page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 3.5rem 2rem 6rem 2rem;
}


/* ---------- Introduction ---------- */

.research-intro {
  max-width: 1000px;
  padding-bottom: 6rem;
}

.research-page-title {
  font-size: 4rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.045em;
  margin-bottom: 3rem;
}

.research-intro h2 {
  max-width: 900px;
  font-size: 2.6rem;
  font-weight: 400;
  line-height: 1.25;
  letter-spacing: -0.03em;
  border: 0;
  margin-bottom: 2rem;
}

.research-intro-text {
  max-width: 850px;
}

.research-intro-text p {
  font-size: 1.15rem;
  font-weight: 400;
  line-height: 1.75;
  letter-spacing: normal;
  word-spacing: normal;
  color: #555b61;
  margin-bottom: 1.25rem;
}

/* ---------- Research areas ---------- */

.research-area {
  display: grid;
  grid-template-columns: 80px minmax(0, 1fr);
  column-gap: 2.5rem;

  border-top: 1px solid #cfd2d4;

  padding-top: 3rem;
  padding-bottom: 5rem;
}

.research-area-number {
  font-size: 0.9rem;
  font-weight: 600;
  color: #8a8f94;
  letter-spacing: 0.08em;
  padding-top: 0.5rem;
}

.research-area-content {
  max-width: 850px;
}

.research-area-content h2 {
  font-size: 2.4rem;
  font-weight: 650;
  line-height: 1.2;
  letter-spacing: -0.035em;
  margin-top: 0;
  margin-bottom: 1.5rem;
  border: 0;
}

.research-area-content p {
  font-size: 1.08rem;
  line-height: 1.75;
  color: #555b61;
}

.research-area-content a {
  font-weight: 600;
  text-decoration: none;
}


/* ---------- Research topic keywords ---------- */

.research-topics {
  margin-top: 1.75rem;
  margin-bottom: 1.75rem;

  font-size: 0.95rem;
  line-height: 1.8;
  color: #292d32;
}


/* ---------- Featured manifold area ---------- */

.research-area-figure {
  grid-column: 2;
  width: 100%;
  margin-top: 2rem;
}

.research-area-figure img {
  display: block;
  width: 100%;
  height: auto;
}

/* ---------- Current directions ---------- */

.research-future {
  border-top: 2px solid #292d32;
  padding-top: 4rem;
  margin-top: 2rem;
}

.research-future > h2 {
  font-size: 2.7rem;
  font-weight: 650;
  line-height: 1.2;
  letter-spacing: -0.035em;
  border: 0;
  margin-bottom: 3rem;
}

.future-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0 4rem;
}

.future-item {
  border-top: 1px solid #cfd2d4;
  padding: 2rem 0 2.5rem 0;
}

.future-item h3 {
  font-size: 1.35rem;
  font-weight: 650;
  margin-top: 0;
  margin-bottom: 1rem;
}

.future-item p {
  font-size: 1rem;
  line-height: 1.7;
  color: #555b61;
}


/* ---------- Research page mobile ---------- */

@media (max-width: 850px) {

  .research-page {
    padding: 3rem 1.5rem 4rem 1.5rem;
  }

  .research-page-title {
    font-size: 3rem;
  }

  .research-intro {
    padding-bottom: 4rem;
  }

  .research-intro h2 {
    font-size: 2rem;
  }

  .research-area,
  .research-area-featured {
    grid-template-columns: 1fr;
  }

  .research-area-number {
    margin-bottom: 1.5rem;
  }

  .research-area-content h2 {
    font-size: 2rem;
  }

  .research-area-figure {
    padding-left: 0;
    padding-top: 2rem;
  }

  .future-grid {
    grid-template-columns: 1fr;
  }

}

/* =========================================================
   PUBLICATIONS PAGE
   ========================================================= */

.pub-page {
  max-width: 1250px;
  width: calc(100% - 4rem);
  margin: 0 auto;
  padding: 3.5rem 0 5rem 0;
}

.pub-intro {
  max-width: 950px;
  padding-bottom: 3.5rem;
}

.pub-page-title {
  font-size: 4rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.045em;
  margin-bottom: 2rem;
}

.pub-intro-text {
  max-width: 750px;
  font-size: 0.95rem;
  font-weight: 400;
  line-height: 1.6;
  letter-spacing: normal;
  word-spacing: normal;
  color: #555b61;
  margin-bottom: 1.25rem;
}

.pub-top-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.1rem;
  align-items: center;
  margin-top: 1rem;
}

.pub-icon-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #292d32;
  text-decoration: none;
  font-size: 1.35rem;
  line-height: 1;
}

.pub-icon-link:hover {
  color: #555b61;
}

.pub-cv-link {
  display: inline-block;
  color: #292d32;
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 650;
  line-height: 1;
}

.pub-cv-link:hover {
  color: #555b61;
}


/* Section headings */

.pub-section-title {
  font-size: 1.8rem;
  font-weight: 650;
  letter-spacing: -0.025em;
  border-bottom: 2px solid #cfd2d4;
  padding-bottom: 0.8rem;
  margin: 2rem 0 0 0;
}


.pub-list {
  width: 100%;
}

/* Individual publications */

.publication {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr);
  gap: 2rem;
  
  width: 100%;
  padding: 1.35rem 0;
  border-bottom: 1px solid #e1e3e5;
}

.pub-entry {
  width: 100%;
  max-width: none;
}

.pub-year {
  font-size: 0.85rem;
  font-weight: 600;
  color: #8a8f94;
  padding-top: 0.15rem;
}

.pub-entry h3 {
  font-size: 1.12rem;
  font-weight: 650;
  line-height: 1.3;
  margin: 0 0 0.25rem 0;
}

.pub-entry p {
  font-size: 0.97rem;
  line-height: 1.45;
  margin: 0.15rem 0;
  color: #555b61;
}

.pub-entry strong {
  color: #292d32;
}


.pub-link {
  display: inline-block;
  margin: 0.35rem 0.9rem 0 0;
  font-size: 0.85rem;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.035em;
  text-decoration: none;
}


/* Mobile */

@media (max-width: 800px) {

  .pub-page {
    padding: 3rem 1.5rem;
  }

  .pub-page-title {
    font-size: 3rem;
  }

  .publication {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }

}

/* =========================================================
   SOFTWARE PAGE
   ========================================================= */

.software-page {
  max-width: 1200px;
  width: calc(100% - 4rem);
  margin: 0 auto;
  padding: 3.5rem 0 6rem 0;
}


/* Introduction */

.software-intro {
  max-width: 900px;
  padding-bottom: 4rem;
}

.software-intro-text {
  max-width: 750px;
}

.software-intro-text p {
  font-size: 0.95rem;
  font-weight: 400;
  line-height: 1.6;
  letter-spacing: normal;
  word-spacing: normal;
  color: #555b61;
  margin: 0;
}

.software-page-title {
  font-size: 4rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.045em;
  margin-bottom: 2rem;
}


/* Featured package */

.software-featured {
  border-top: 2px solid #292d32;
  border-bottom: 1px solid #cfd2d4;
  padding: 3rem 0 3.5rem 0;
  margin-bottom: 5rem;
}

.software-featured-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: #8a8f94;
  margin-bottom: 1.5rem;
}

.software-featured h2 {
  font-size: 3rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  border: 0;
  margin: 0 0 0.4rem 0;
}

.software-featured h3 {
  font-size: 1.4rem;
  font-weight: 400;
  margin: 0 0 1.5rem 0;
}

.software-featured > p {
  max-width: 800px;
  font-size: 1.05rem;
  line-height: 1.7;
  color: #555b61;
}

.software-meta {
  margin: 1.5rem 0;
  font-size: 0.9rem;
}


/* Buttons */

.software-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 1.5rem;
}

.software-button {
  display: inline-block;
  padding: 0.55rem 1rem;
  border: 1px solid #292d32;
  color: #292d32;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
}

.software-button:hover {
  background: #f2f2f2;
  color: #292d32;
}

.software-button-primary {
  background: #292d32;
  color: white;
}

.software-button-primary:hover {
  background: #44484d;
  color: white;
}


/* Research software */

.software-section-title {
  font-size: 2rem;
  font-weight: 650;
  letter-spacing: -0.025em;
  border: 0;
  margin-bottom: 2.5rem;
}

/* ---------- Research software cards ---------- */

.software-project-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 3rem;
  row-gap: 4rem;
  width: 100%;
}

.software-project {
  display: flex;
  flex-direction: column;
  min-width: 0;
  border-top: 1px solid #292d32;
}


/* Figure */

.software-project-image {
  display: block;
  width: 100%;
  height: auto;
  object-fit: initial;
  margin: 0;
  padding: 0;
  background: transparent;
}


/* Text area */

.software-project-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding-top: 1.25rem;
}

.software-project-number {
  font-size: 0.72rem;
  font-weight: 600;
  color: #8a8f94;
  margin-bottom: 0.8rem;
}


/* Package name */

.software-project h3 {
  font-size: 1.25rem;
  font-weight: 650;
  line-height: 1.2;
  margin: 0 0 0.75rem 0;
}


/* Short research description / subtitle */

.software-project-body > p {
  margin: 0;
}

.software-project-body > p strong {
  display: block;
  max-width: 480px;
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.4;
  color: #292d32;
  margin-bottom: 0.8rem;
}


/* Description */

.software-project-description {
  max-width: 480px;
  font-size: 0.82rem;
  font-weight: 400;
  line-height: 1.55;
  color: #666b70;
  margin: 0 0 0.9rem 0;
}


/* Tags */

.software-tags {
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.5;
  color: #777c81;
  margin: 0 0 1.25rem 0;
}


/* GitHub link */

.software-project-link {
  display: inline-block;
  margin-top: auto;
  padding-top: 0.5rem;
  font-size: 0.82rem;
  font-weight: 650;
  text-decoration: none;
}


/* Bottom statement */

.software-bottom {
  border-top: 2px solid #292d32;
  margin-top: 5rem;
  padding-top: 3rem;
  max-width: 850px;
}

.software-bottom h2 {
  font-size: 2rem;
  font-weight: 650;
  border: 0;
}

.software-bottom p {
  line-height: 1.7;
  color: #555b61;
}


/* Mobile */

@media (max-width: 800px) {

  .software-page {
    width: calc(100% - 3rem);
    padding-top: 3rem;
  }

  .software-page-title {
    font-size: 3rem;
  }

  .software-featured h2 {
    font-size: 2.4rem;
  }

  .software-project-grid {
    grid-template-columns: 1fr;
  }

}
/* =========================================================
   TEACHING PAGE
   ========================================================= */

.teaching-page {
  max-width: 1200px;
  width: calc(100% - 4rem);
  margin: 0 auto;
  padding: 3.5rem 0 6rem 0;
}

.teaching-intro {
  max-width: 1000px;
  padding-bottom: 5rem;
}

.teaching-page-title {
  font-size: 4rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.045em;
  margin-bottom: 2.5rem;
}

.teaching-intro h2 {
  max-width: 900px;
  font-size: 2.5rem;
  font-weight: 400;
  line-height: 1.25;
  letter-spacing: -0.03em;
  border: 0;
  margin-bottom: 2rem;
}

.teaching-intro-text,
.mentoring-intro {
  max-width: 800px;
  font-size: 0.95rem;
  line-height: 1.65;
  color: #555b61;
}

.teaching-intro-text p {
  font-size: 0.95rem;
  font-weight: 400;
  line-height: 1.6;
  letter-spacing: normal;
  word-spacing: normal;
  color: #555b61;
  margin: 0;
}

.teaching-section-title {
  font-size: 2rem;
  font-weight: 650;
  letter-spacing: -0.025em;
  border-bottom: 1px solid #cfd2d4;
  padding-bottom: 1rem;
  margin: 0 0 2.5rem 0;
}


/* Courses */

.course-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 3rem;
  margin-bottom: 5rem;
}

.course-card {
  border-top: 2px solid #292d32;
  padding-top: 1.5rem;
}

.course-level {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: #8a8f94;
  margin-bottom: 1rem;
}

.course-card h3,
.teaching-feature h3 {
  font-size: 1.35rem;
  font-weight: 650;
  margin-bottom: 0.8rem;
}

.course-card p,
.teaching-feature p {
  font-size: 0.92rem;
  line-height: 1.65;
  color: #555b61;
}

.course-meta {
  font-size: 0.8rem;
  font-weight: 600;
  color: #8a8f94;
  margin-top: 1rem;
}


/* Workshops */

.teaching-feature {
  max-width: 900px;
  border-bottom: 1px solid #e1e3e5;
  padding: 0 0 2.5rem 0;
  margin-bottom: 2.5rem;
}


/* Mentoring */

.mentoring-intro {
  margin-bottom: 2.5rem;
}

.mentoring-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2.5rem;
  margin-bottom: 5rem;
}

.mentoring-card {
  border-top: 1px solid #292d32;
  padding-top: 1.5rem;
}

.mentoring-number {
  font-size: 2.5rem;
  font-weight: 650;
  letter-spacing: -0.04em;
  margin-bottom: 1rem;
}

.mentoring-card h3 {
  font-size: 1.15rem;
}

.mentoring-card p {
  font-size: 0.9rem;
  line-height: 1.6;
  color: #555b61;
}


/* Bottom */

.teaching-bottom {
  border-top: 2px solid #292d32;
  padding-top: 3rem;
}

.teaching-bottom h2 {
  border: 0;
}


/* Mobile */

@media (max-width: 800px) {

  .teaching-page {
    width: calc(100% - 3rem);
  }

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

  .teaching-intro h2 {
    font-size: 2rem;
  }

  .course-grid,
  .mentoring-grid {
    grid-template-columns: 1fr;
  }

}

/* =========================================================
   CV PAGE
   ========================================================= */

.cv-page {
  max-width: 1300px;
  width: calc(100% - 4rem);
  margin: 0 auto;
  padding: 3.5rem 0 5rem 0;
}

.cv-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 2rem;
  margin-bottom: 2rem;
}

.cv-actions {
  display: flex;
  gap: 0.75rem;
}

.cv-button {
  display: inline-block;
  padding: 0.6rem 1rem;
  border: 1px solid #292d32;
  color: #292d32;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
}

.cv-button:hover {
  background: #292d32;
  color: white;
  text-decoration: none;
}


/* Embedded PDF */

.cv-viewer {
  width: 100%;
  height: 85vh;
  min-height: 900px;
  border-top: 1px solid #cfd2d4;
  padding-top: 1.5rem;
}

.cv-viewer iframe {
  width: 100%;
  height: 100%;
  border: 1px solid #e1e3e5;
  background: #f7f7f7;
}


/* Mobile */

@media (max-width: 800px) {

  .cv-page {
    width: calc(100% - 3rem);
  }

  .cv-header {
    display: block;
  }

  .cv-page-title {
    font-size: 3rem;
    margin-bottom: 1.5rem;
  }

  .cv-viewer {
    height: 75vh;
    min-height: 600px;
  }

}
