:root {
  --ink: #202428;
  --muted: #5c646b;
  --accent: #176a70;
  --accent-dark: #104f54;
  --line: #dcdfe1;
  --soft: #f6f7f7;
  --paper: #ffffff;
  --max: 1080px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 15px;
  line-height: 1.58;
}

a {
  color: var(--accent-dark);
  text-underline-offset: 0.18em;
}

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

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

.skip-link {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 1000;
  padding: 0.55rem 0.8rem;
  color: #ffffff;
  background: var(--accent-dark);
  transform: translateY(-180%);
}

.skip-link:focus {
  transform: translateY(0);
}

.shell {
  width: min(calc(100% - 2.5rem), var(--max));
  margin-inline: auto;
}

.site-header {
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.98);
}

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

.site-name {
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
}

.site-name small {
  display: block;
  margin-top: 0.18rem;
  color: var(--muted);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.76rem;
  font-weight: 400;
  letter-spacing: 0.02em;
}

.site-name small + small {
  margin-top: 0.05rem;
}

.nav-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem 1.25rem;
}

.nav-links a {
  padding: 0.35rem 0;
  color: #343a3f;
  border-bottom: 2px solid transparent;
  font-size: 0.92rem;
  text-decoration: none;
}

.nav-links a:hover,
.nav-links a[aria-current="page"] {
  color: var(--accent-dark);
  border-bottom-color: var(--accent);
}

.menu-button {
  display: none;
  padding: 0.45rem 0.65rem;
  border: 1px solid var(--line);
  color: var(--ink);
  background: #ffffff;
  font: inherit;
  cursor: pointer;
}

.page-title {
  padding: 2.1rem 0 1.45rem;
  border-bottom: 1px solid var(--line);
}

.page-title h1,
.hero h1,
.section h2,
.content h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 700;
}

.page-title h1 {
  margin: 0;
  font-size: clamp(1.55rem, 2.3vw, 1.95rem);
  line-height: 1.12;
}

.page-title p {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
}

.hero {
  padding: 3.25rem 0 3.5rem;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(230px, 300px) minmax(0, 1fr);
  gap: clamp(2.5rem, 6vw, 5rem);
  align-items: start;
}

.portrait {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: center 22%;
  border: 1px solid var(--line);
}

.profile-caption {
  margin-top: 1rem;
}

.profile-caption p {
  margin: 0.1rem 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.profile-caption strong {
  color: var(--ink);
}

.hero h1 {
  margin: -0.15rem 0 1.2rem;
  font-size: clamp(2.15rem, 4vw, 3.15rem);
  line-height: 1.04;
}

.hero .position {
  margin: 0 0 1.55rem;
  color: var(--accent-dark);
  font-size: 1.05rem;
  font-weight: 700;
}

.lead {
  max-width: 730px;
  margin: 0 0 1.25rem;
  color: #30363a;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.05rem, 1.7vw, 1.22rem);
  line-height: 1.55;
}

.hero-copy p:not(.position):not(.lead) {
  max-width: 730px;
  color: var(--muted);
}

.link-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 1.1rem;
  margin-top: 1.65rem;
}

.link-row a {
  font-size: 0.92rem;
  font-weight: 700;
}

.section {
  padding: 3.5rem 0;
  border-top: 1px solid var(--line);
}

.section.soft {
  background: var(--soft);
}

.section h2,
.content h2 {
  margin: 0 0 1.3rem;
  font-size: clamp(1.4rem, 2.2vw, 1.75rem);
  line-height: 1.2;
}

.section-intro {
  max-width: 760px;
  margin: -0.65rem 0 1.8rem;
  color: var(--muted);
}

.two-column {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2rem 3rem;
}

.topic {
  padding-top: 1rem;
  border-top: 2px solid var(--accent);
}

.topic h3 {
  margin: 0 0 0.55rem;
  font-size: 1.08rem;
}

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

/* News */
.news-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.news-list li {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 1rem;
  margin: 0;
  padding: 0.45rem 0;
  border: 0;
}

.news-list li.year-end {
  margin-bottom: 0.35rem;
  padding-bottom: 0.8rem;
  border-bottom: 1px solid var(--line);
}

.news-list li.year-end:last-child {
  border-bottom: 0;
}

.news-list time {
  color: var(--accent-dark);
  font-size: 0.94rem;
  font-weight: 700;
  line-height: 1.4;
}

.news-list p {
  margin: 0;
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.5;
}

.news-list a {
  color: var(--accent-dark);
}

.news-list a:hover {
  color: var(--accent);
}

.content {
  padding: 2.35rem 0 4rem;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 250px;
  gap: 4rem;
  align-items: start;
}

.main-column > section + section {
  margin-top: 3.2rem;
}

.main-column section > h2 {
  margin-bottom: 1rem;
}

.main-column h3 {
  font-size: 1.02rem;
}

.aside {
  position: sticky;
  top: 1.5rem;
  padding: 1.25rem;
  border: 1px solid var(--line);
  background: var(--soft);
}

.aside h2 {
  margin: 0 0 0.8rem;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.aside ul {
  margin: 0;
  padding-left: 1.1rem;
}

.aside li + li {
  margin-top: 0.45rem;
}

.detail-list {
  margin: 0;
}

.detail-list > div {
  display: grid;
  grid-template-columns: minmax(150px, 220px) minmax(0, 1fr);
  gap: 1.25rem;
  padding: 1rem 0;
  border-top: 1px solid var(--line);
}

.detail-list > div:first-child {
  border-top: 0;
}

.detail-list dt {
  font-weight: 700;
}

.detail-list dd {
  margin: 0;
  color: var(--muted);
}

/* Publications */
.publication-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.publication-list > li {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 1rem;
  margin: 0;
  padding: 0.28rem 0;
  border: 0;
}

.publication-list > li.year-end {
  border-bottom: 1px solid var(--line);
}

.publication-list > li.year-end:last-child {
  border-bottom: 0;
}

.publication-entry {
  margin: 0;
  line-height: 1.45;
}

.publication-entry strong {
  color: var(--ink);
  font-weight: 700;
}

.publication-entry a,
.publication-entry a:visited,
.publication-entry a:hover,
.publication-entry a:focus {
  color: var(--accent-dark);
  border-bottom: 0;
  text-decoration: none;
}

.publication-entry a:hover,
.publication-entry a:focus {
  color: var(--accent);
}

.pub-year {
  color: var(--accent-dark);
  font-weight: 700;
}

.pub-title {
  margin: 0 0 0.25rem;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.06rem;
  font-weight: 700;
  line-height: 1.45;
}

.pub-meta,
.pub-note {
  margin: 0.16rem 0 0;
  color: var(--muted);
  font-size: 0.94rem;
}

.pub-venue {
  color: var(--ink);
  font-weight: 700;
}

/* Teaching page */
.teaching-page .main-column section > h2 {
  margin: 0 0 0.2rem;
  color: var(--accent-dark);
  font-size: 1.18rem;
  line-height: 1.25;
}

.teaching-page .institution-location {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.4;
}

.teaching-page .course-group {
  margin: 0 0 1.25rem;
}

.teaching-page .course-group:last-child {
  margin-bottom: 0;
}

.teaching-page .course-group h3 {
  margin: 0 0 0.4rem;
  font-size: 1.08rem;
  line-height: 1.3;
}

.teaching-page .course-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.teaching-page .course-list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.75rem;
  margin: 0;
  padding: 0.12rem 0;
  border: 0;
  line-height: 1.4;
}

/* Semester and year: black and regular weight */
.teaching-page .course-list li > span:last-child:not(:only-child) {
  color: var(--ink);
  font-weight: 400;
  white-space: nowrap;
}

.teaching-page .course-list li > span:only-child {
  color: var(--ink);
}

/* Tables */
.compact-table {
  width: 100%;
  border-collapse: collapse;
}

.compact-table th,
.compact-table td {
  padding: 0.72rem 0.6rem;
  border-top: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.compact-table th {
  width: 31%;
  color: var(--ink);
  font-size: 0.92rem;
}

.compact-table td {
  color: var(--muted);
}

.callout {
  padding: 1.35rem 1.5rem;
  border-left: 4px solid var(--accent);
  background: var(--soft);
}

.callout p:first-child {
  margin-top: 0;
}

.callout p:last-child {
  margin-bottom: 0;
}

.cv-frame {
  width: 100%;
  min-height: 820px;
  border: 1px solid var(--line);
  background: var(--soft);
}

.button-link {
  display: inline-block;
  padding: 0.65rem 0.95rem;
  border: 1px solid var(--accent-dark);
  color: var(--accent-dark);
  font-weight: 700;
  text-decoration: none;
}

.button-link:hover {
  color: #ffffff;
  background: var(--accent-dark);
}

.site-footer {
  padding: 2rem 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.88rem;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

/* Homepage */
.home-hero {
  min-height: calc(100vh - 170px);
}

.home-hero .hero-grid {
  align-items: start;
}

.home-hero .hero-copy {
  padding-top: 0.2rem;
}

.about-text {
  max-width: 760px;
  margin: 0;
  color: #3f474d;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.08rem, 1.8vw, 1.3rem);
  line-height: 1.75;
}

.profile-email {
  margin-top: 0.8rem !important;
  color: var(--ink) !important;
  font-weight: 700;
}

.home-hero .link-row {
  margin-top: 1.5rem;
}

.home-hero .link-row a {
  font-weight: 600;
}

/* Service page */

.service-page > section {
  margin: 0 0 1.6rem;
}

/* Main section titles: Committees, Peer review, Memberships */
.service-page > section > h2 {
  margin: 0 0 0.75rem;
  color: var(--accent-dark);
  font-size: clamp(1.2rem, 1.8vw, 1.45rem);
  line-height: 1.3;
}

/* Individual groups within each main section */
.service-group {
  margin: 0 0 1rem;
}

/* Subsection titles remain black */
.service-page .service-group h3 {
  margin: 0 0 0.3rem;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.35;
}

/* Service lists */
.service-list {
  margin: 0;
  padding-left: 1.35rem;
  list-style: disc;
}

.service-list li {
  display: list-item;
  margin: 0;
  padding: 0.12rem 0;
  color: var(--ink);
  border: 0;
  font-size: inherit;
  font-weight: 400;
  line-height: 1.5;
}

.service-list strong,
.service-list span,
.service-year {
  color: inherit;
  font-size: inherit;
  font-weight: 400;
  white-space: normal;
}

/* Service page title */
.service-page-view .page-title h1 {
  font-size: clamp(1.55rem, 2.3vw, 1.95rem);
}

/* Research page */

.research-page > section {
  margin: 0 0 1.6rem;
}

/* Main titles: Research Projects and Datasets and Testbeds */
.research-page > section > h2 {
  margin: 0 0 0.75rem;
  color: var(--accent-dark);
  font-size: clamp(1.2rem, 1.8vw, 1.45rem);
  line-height: 1.3;
}

/* Individual research projects */
.research-project {
  margin: 0 0 1.4rem;
}

/* Individual dataset and testbed entries */
.research-resource {
  margin: 0 0 1.25rem;
}

/* Project, dataset, and testbed titles remain black */
.research-page .research-project h3,
.research-page .research-resource h3 {
  margin: 0 0 0.3rem;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.35;
}

/* Project descriptions */
.research-page .research-project > p,
.research-page .research-resource > p {
  margin: 0 0 0.6rem;
  color: var(--ink);
  font-size: inherit;
  line-height: 1.5;
}

/* Selected publications heading */
.research-page .selected-publications-title {
  margin: 0.55rem 0 0.25rem;
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.35;
}

/* Compact publication spacing on the Research page */
.research-page .publication-list {
  margin: 0;
}

.research-page .publication-list > li {
  padding: 0.22rem 0;
}

/* Compact homepage profile layout */
.home-page .profile-caption {
  display: none;
}

.home-page .home-hero {
  min-height: auto;
  padding: 2.35rem 0 3rem;
}

.home-page .hero-copy {
  padding-top: 0;
}

.home-page .hero h1 {
  margin: 0 0 0.7rem;
  font-size: clamp(2rem, 3.2vw, 2.65rem);
  line-height: 1.06;
}

.home-page .homepage-position {
  margin: 0 0 0.9rem;
}

.home-page .homepage-position p {
  margin: 0.05rem 0;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1rem;
  line-height: 1.3;
}

.home-page .homepage-position p:first-child {
  font-weight: 700;
}

.home-page .homepage-info-block {
  margin-top: 0.9rem;
}

.home-page .homepage-info-block h2 {
  margin: 0 0 0.2rem;
  color: var(--accent-dark);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.04rem;
  line-height: 1.25;
}

.home-page .homepage-info-block p {
  margin: 0.12rem 0;
  color: var(--ink);
  font-size: 0.98rem;
  line-height: 1.38;
}

.home-page .homepage-info-block ul {
  margin: 0.15rem 0 0;
  padding-left: 1.15rem;
}

.home-page .homepage-info-block li {
  margin: 0.04rem 0;
  font-size: 0.98rem;
  line-height: 1.35;
}

.home-page .homepage-info-block a,
.home-page .homepage-position a {
  color: var(--accent-dark);
}

.home-page .homepage-info-block a:hover,
.home-page .homepage-position a:hover {
  color: var(--accent);
}

@media (max-width: 820px) {
  .header-inner {
    min-height: 72px;
    align-items: center;
  }

  .menu-button {
    display: inline-block;
  }

  .site-name small + small {
    margin-top: 0.05rem;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 72px;
    left: 0;
    right: 0;
    z-index: 20;
    padding: 1rem 1.25rem 1.2rem;
    border-bottom: 1px solid var(--line);
    background: #ffffff;
  }

  .nav-links.open {
    display: grid;
  }

  .nav-links a {
    padding: 0.5rem 0;
  }

  .site-header {
    position: relative;
  }

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

  .portrait {
    max-width: 330px;
  }

  .two-column {
    grid-template-columns: 1fr;
  }
}


/* Keep the Lab sidebar on the right on tablets and smaller laptop windows. */
@media (max-width: 820px) {
  .lab-page-view .content-grid {
    grid-template-columns: minmax(0, 1fr) 180px;
    gap: 1.5rem;
  }

  .lab-page-view .aside {
    position: sticky;
    top: 1.5rem;
  }

  .lab-page-view .page-title h1 {
    font-size: clamp(1.35rem, 3.5vw, 1.75rem);
    overflow-wrap: anywhere;
  }
}

/* Other internal pages may stack earlier, but the Lab page stays two-column. */
@media (max-width: 650px) {
  body:not(.lab-page-view) .content-grid {
    grid-template-columns: 1fr;
  }

  body:not(.lab-page-view) .aside {
    position: static;
  }
}

/* Stack the Lab page only on narrow phone screens. */
@media (max-width: 520px) {
  .lab-page-view .content-grid {
    grid-template-columns: 1fr;
  }

  .lab-page-view .aside {
    position: static;
  }
}

@media (max-width: 560px) {
  .shell {
    width: min(calc(100% - 1.5rem), var(--max));
  }

  .hero {
    padding-top: 2.4rem;
  }

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

  .home-hero {
    min-height: auto;
  }

  .two-column {
    gap: 1.5rem;
  }

  .news-list li,
  .publication-list > li,
  .detail-list > div,
  .course-list li {
    grid-template-columns: 1fr;
    gap: 0.15rem;
  }

  .teaching-page .course-list li > span:last-child:not(:only-child) {
    white-space: normal;
  }

  .footer-inner {
    display: block;
  }

  .cv-frame {
    min-height: 620px;
  }

  .home-page .hero h1 {
    font-size: 2rem;
  }
}