:root {
  --paper: #f7f9fb;
  --ink: #1f2a3d;
  --ink-soft: #5a6a80;
  --teal: #1f6f94;
  --teal-deep: #15516d;
  --rule: #d9e1e9;
  --card: #ffffff;
  --side: #e9eef4;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Literata", Georgia, serif;
  font-size: 1.02rem;
  line-height: 1.65;
}

a {
  color: var(--teal);
  text-decoration-color: color-mix(in srgb, var(--teal) 40%, transparent);
  text-underline-offset: 3px;
}
a:hover { color: var(--teal-deep); text-decoration-color: var(--teal-deep); }
a:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ---------- Two-column layout ---------- */

.layout {
  display: grid;
  grid-template-columns: 19rem minmax(0, 1fr);
  max-width: 72rem;
  margin: 0 auto;
  min-height: 100vh;
  background: linear-gradient(90deg,
    var(--side) 0,
    var(--side) calc(19rem - 1px),
    var(--rule) calc(19rem - 1px),
    var(--rule) 19rem,
    transparent 19rem);
}

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

.sidebar {
  padding: 2.75rem 1.75rem 2rem;
  position: sticky;
  top: 0;
  align-self: start;
  max-height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.portrait img,
.monogram {
  width: 9rem;
  height: 9rem;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--card);
  box-shadow: 0 2px 8px rgba(31, 42, 61, 0.18);
}

.monogram {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--teal);
  color: #f2f5f1;
  font-family: "Literata", Georgia, serif;
  font-weight: 600;
  font-size: 3rem;
  letter-spacing: 0.04em;
}

.sidebar h1 {
  margin: 1.2rem 0 0.3rem;
  font-size: 1.65rem;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.role {
  margin: 0 0 0.5rem;
  font-size: 0.96rem;
  color: var(--ink);
}

.affiliation {
  margin: 0 0 1.3rem;
  font-size: 0.88rem;
  color: var(--ink-soft);
  line-height: 1.5;
}

.side-links {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  width: 100%;
  padding-top: 1.1rem;
  border-top: 1px solid var(--rule);
  font-family: "Archivo", "Helvetica Neue", Arial, sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
}

.side-links a {
  text-decoration: none;
  padding: 0.15rem 0;
  overflow-wrap: anywhere;
}
.side-links a:hover { text-decoration: underline; }

.side-rule {
  width: 100%;
  border: none;
  border-top: 1px solid var(--rule);
  margin: 1.3rem 0 0;
}

.highlight {
  width: 100%;
  margin-top: 1.3rem;
  padding: 0.85rem 1rem 0.95rem;
  background: var(--card);
  border: 1px solid var(--rule);
  border-left: 3px solid var(--teal);
  border-radius: 0 6px 6px 0;
  text-align: left;
}

.highlight-label {
  margin: 0 0 0.25rem;
  font-family: "Archivo", "Helvetica Neue", Arial, sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink-soft);
}

.highlight-name {
  font-weight: 600;
  font-size: 1.02rem;
  text-decoration: none;
}
.highlight-name:hover { text-decoration: underline; }

.highlight-more {
  display: block;
  margin-top: 0.8rem;
  padding-top: 0.8rem;
  border-top: 1px solid var(--rule);
}

.highlight-desc {
  margin: 0.3rem 0 0;
  font-size: 0.86rem;
  color: var(--ink-soft);
  line-height: 1.5;
}

/* ---------- Right column ---------- */

.content { min-width: 0; }

.tabs {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--rule);
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  padding: 0.85rem 2.25rem;
  font-family: "Archivo", "Helvetica Neue", Arial, sans-serif;
  font-size: 0.92rem;
  font-weight: 500;
}

.tabs a {
  color: var(--ink);
  text-decoration: none;
  padding: 0.42rem 1.05rem;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--card);
  white-space: nowrap;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.tabs a:hover {
  background: var(--teal);
  border-color: var(--teal);
  color: #f2f5f1;
}

/* ---------- Sections ---------- */

main {
  max-width: 46rem;
  padding: 0 2.25rem 3rem;
}

section {
  padding-top: 2.4rem;
  scroll-margin-top: 4.2rem;
}

section + section {
  margin-top: 1.4rem;
  border-top: 1px solid var(--rule);
}

h2 {
  font-size: 1.55rem;
  font-weight: 600;
  margin: 0 0 1rem;
  letter-spacing: -0.005em;
}

h3 {
  font-family: "Archivo", "Helvetica Neue", Arial, sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink-soft);
  margin: 1.8rem 0 0.6rem;
}

.section-note {
  margin-top: -0.5rem;
  color: var(--ink-soft);
  font-size: 0.94rem;
}

.keywords {
  color: var(--ink-soft);
  font-size: 0.92rem;
  font-style: italic;
}

.research-threads { padding-left: 1.2rem; }
.research-threads li { margin-bottom: 0.7rem; }

/* ---------- Publications ---------- */

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

.pubs li {
  padding: 0.7rem 0.9rem;
  margin-bottom: 0.55rem;
  background: var(--card);
  border-left: 3px solid var(--teal);
  border-radius: 0 4px 4px 0;
}

.pubs .pub-title { display: block; font-weight: 500; }
.pubs .pub-title a { text-decoration: none; color: var(--ink); }
.pubs .pub-title a:hover { color: var(--teal-deep); text-decoration: underline; }

.pubs .pub-authors {
  display: block;
  font-size: 0.92rem;
  color: var(--ink-soft);
  margin-top: 0.15rem;
}
.pubs .pub-authors em { font-style: normal; font-weight: 600; color: var(--ink); }

.pubs .pub-venue {
  display: block;
  font-family: "Archivo", "Helvetica Neue", Arial, sans-serif;
  font-size: 0.8rem;
  color: var(--teal-deep);
  margin-top: 0.2rem;
}

/* ---------- Projects & service ---------- */

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

.projects li {
  margin-bottom: 0.9rem;
  padding-left: 1.1rem;
  border-left: 3px solid var(--rule);
}

.project-name {
  display: block;
  font-weight: 600;
}
.project-name a { text-decoration: none; }
.project-name a:hover { text-decoration: underline; }

.service-list { padding-left: 1.2rem; }
.service-list li { margin-bottom: 0.5rem; }

/* ---------- Footer ---------- */

footer {
  border-top: 1px solid var(--rule);
  color: var(--ink-soft);
  font-size: 0.9rem;
  padding: 1.4rem 2.25rem 2rem;
}

/* ---------- Small screens ---------- */

@media (max-width: 760px) {
  .layout {
    grid-template-columns: 1fr;
    background: none;
  }

  .sidebar {
    position: static;
    max-height: none;
    background: var(--side);
    border-bottom: 1px solid var(--rule);
    padding: 2.25rem 1.25rem 1.75rem;
  }

  .side-links {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.4rem 1.1rem;
  }

  .highlight { max-width: 24rem; margin-left: auto; margin-right: auto; }

  .tabs {
    padding: 0.7rem 1.25rem;
    flex-wrap: nowrap;
    overflow-x: auto;
  }

  main { padding: 0 1.25rem 3rem; }
  footer { padding: 1.4rem 1.25rem 2rem; text-align: center; }
}
