:root {
  --bg: #ffffff;
  --text-main: #111827;
  --text-muted: #6b7280;
  --accent: #1A4F7A;
  --accent-light: #2568A0;
  --accent-bg: #f0f4f8;
  --max-width: 720px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text-main);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.9;
  -webkit-font-smoothing: antialiased;
}

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

a:hover {
  color: var(--accent-light);
  text-decoration-thickness: 2px;
}

.container {
  max-width: var(--max-width);
  margin: 56px auto 80px;
  padding: 0 18px;
}

header {
  margin-bottom: 36px;
  padding-bottom: 20px;
}

.header-with-logo {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.header-email {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-top: 4px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.header-logo {
  height: 95px;
  width: auto;
  opacity: 0.8;
  flex-shrink: 0;
}

.name {
  font-size: 2.2rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 600;
  margin-bottom: 10px;
  color: var(--accent);
}

.subtitle {
  font-size: 1rem;
  color: var(--text-muted);
  margin-bottom: 14px;
  max-width: 32rem;
}

.subtitle span {
  color: var(--text-main);
  font-weight: 500;
}

nav {
  margin-top: 6px;
  font-size: 0.9rem;
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

nav a {
  text-decoration: none;
  border-bottom: 2px solid transparent;
  padding-bottom: 2px;
  color: var(--text-muted);
  transition: color 0.2s, border-color 0.2s;
}

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

nav a.active {
  border-bottom-color: var(--accent);
  color: var(--accent);
  font-weight: 500;
}

main {
  padding-top: 10px;
}

section {
  margin-top: 52px;
}

section:first-of-type {
  margin-top: 0;
}

.section-label {
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 4px;
  font-weight: 500;
}

h1, h2 {
  font-weight: 600;
}

h2 {
  font-size: 1.15rem;
  margin-bottom: 10px;
}

p {
  font-size: 0.96rem;
  margin-bottom: 12px;
  text-align: justify;
  hyphens: auto;
}

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

ul {
  padding-left: 1.1rem;
  font-size: 0.95rem;
}

ul li + li {
  margin-top: 6px;
}

strong {
  font-weight: 600;
}

.muted {
  color: var(--text-muted);
}

.about-grid {
  display: flex;
  gap: 32px;
}

.about-sidebar {
  flex-shrink: 0;
  width: 160px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.profile-photo {
  width: 160px;
  height: 160px;
  object-fit: cover;
  border-radius: 6px;
  background: var(--accent-bg);
  border: 1px solid #e5e7eb;
}

.sidebar-links {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 14px;
  font-size: 0.88rem;
  width: 100%;
}

.sidebar-links a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}

.sidebar-links a:hover {
  border-bottom-color: var(--accent);
}

.sidebar-email {
  margin-top: 12px;
  font-size: 0.78rem;
  color: var(--text-muted);
  word-break: break-all;
  text-align: center;
}

.about-text {
  flex: 1;
  min-width: 0;
}

.bio-entry {
  display: flex;
  gap: 20px;
  margin-bottom: 28px;
  align-items: flex-start;
}

.bio-logo {
  flex-shrink: 0;
  width: 60px;
}

.bio-logo img {
  width: 60px;
  height: auto;
  object-fit: contain;
}

.bio-details h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 2px;
}

.bio-details p {
  font-size: 0.93rem;
  margin-bottom: 4px;
}

.affiliations {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 32px;
  margin-top: 12px;
  margin-bottom: 40px;
}

.affiliations a {
  display: inline-block;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.affiliations a:hover {
  opacity: 1;
}

.affiliations img {
  height: 60px;
  width: auto;
  max-width: 200px;
  object-fit: contain;
}

.footer {
  margin-top: 52px;
  padding-top: 16px;
  border-top: 1px solid #e5e7eb;
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: right;
}

.footer-address {
  text-align: left;
  line-height: 1.5;
  margin-bottom: 10px;
}

.cv-link {
  margin-top: 6px;
  font-size: 0.9rem;
}

@media (max-width: 600px) {
  .container {
    margin: 32px auto 56px;
    padding: 0 14px;
  }

  .name {
    font-size: 1.5rem;
  }

  .header-with-logo {
    gap: 10px;
  }

  .header-logo {
    height: 55px;
  }

  .about-grid {
    flex-direction: column;
    align-items: center;
    gap: 20px;
  }

  /* Flatten the sidebar so the photo and links can be ordered
     independently around the About Me text. */
  .about-sidebar {
    display: contents;
  }

  .profile-photo {
    width: 210px;
    height: 210px;
    order: 1;
  }

  .about-text {
    order: 2;
    width: 100%;
  }

  .sidebar-links {
    order: 3;
    width: 100%;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px 18px;
  }

  .about-text h2 {
    text-align: center;
  }

  .bio-entry {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .affiliations {
    justify-content: center;
  }
}

.cv-link a {
  color: var(--accent);
}

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 10px;
  font-size: 0.9rem;
}

.links a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}

.links a:hover {
  border-bottom-color: var(--accent);
}

.pub-item {
  margin-bottom: 18px;
}

.pub-item .pub-title {
  font-weight: 600;
}

.pub-item .pub-venue {
  color: var(--text-muted);
  font-style: italic;
  font-size: 0.92rem;
}

.pub-item .pub-links {
  font-size: 0.88rem;
  margin-top: 3px;
}

.pub-item .pub-links a {
  margin-right: 10px;
}

.pub-item .pub-links .pub-action {
  background: none;
  border: none;
  padding: 0;
  margin-right: 10px;
  font-family: inherit;
  font-size: inherit;
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  cursor: pointer;
}

.pub-item .pub-links .pub-action:hover {
  color: var(--accent-light);
  text-decoration-thickness: 2px;
}

.pub-abstract {
  margin-top: 8px;
  font-size: 0.9rem;
}

.research-item {
  margin-bottom: 20px;
  padding-left: 14px;
  border-left: 3px solid var(--accent-bg);
}

.research-item h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.research-item p {
  font-size: 0.93rem;
  color: var(--text-main);
  margin-bottom: 0;
}

.research-item p + p {
  margin-top: 12px;
}

.research-item .key {
  color: var(--accent);
  font-weight: 600;
}
