:root {
  --bg: #fbfbf8;
  --paper: #ffffff;
  --ink: #222222;
  --muted: #646464;
  --line: #d8ddd9;
  --soft: #eef3ef;
  --accent: #226f54;
  --accent-strong: #174f3c;
  --link: #1667a6;
  --link-dark: #0d466f;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  font-size: 15.5px;
  line-height: 1.55;
}

a {
  color: var(--link);
  text-decoration: none;
}

a:hover,
a:focus {
  color: var(--link-dark);
  text-decoration: underline;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid var(--line);
  background: rgba(251, 251, 248, 0.96);
  backdrop-filter: blur(12px);
}

.nav {
  display: flex;
  align-items: center;
  gap: 24px;
  width: min(1160px, calc(100% - 32px));
  margin: 0 auto;
  min-height: 48px;
  overflow-x: auto;
  white-space: nowrap;
}

.nav a:first-child {
  color: var(--ink);
  font-weight: 700;
}

.layout {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  gap: 40px;
  width: min(1160px, calc(100% - 32px));
  margin: 0 auto;
  padding: 38px 0 60px;
}

.profile {
  position: sticky;
  top: 74px;
  align-self: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  padding: 24px;
  box-shadow: 0 18px 45px rgba(33, 44, 38, 0.06);
}

.profile-name {
  margin: 0 0 6px;
  font-size: 1.7rem;
  line-height: 1.2;
}

.profile .affiliation {
  margin: 0 0 12px;
  color: var(--muted);
}

.profile .focus {
  margin: 0 0 16px;
  text-align: left;
}

.profile ul {
  margin: 0;
  padding: 0;
  list-style: none;
  text-align: left;
}

.profile li {
  margin: 7px 0;
}

.social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 18px 0 16px;
}

.social-links a {
  display: inline-grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper);
  color: var(--ink);
}

.social-links a:hover,
.social-links a:focus {
  border-color: var(--accent);
  color: var(--accent-strong);
  text-decoration: none;
}

.social-links svg {
  width: 22px;
  height: 22px;
}

.gmail-icon .gmail-red {
  fill: #c5221f;
}

.gmail-icon .gmail-blue {
  fill: #4285f4;
}

.gmail-icon .gmail-green {
  fill: #34a853;
}

.gmail-icon .gmail-yellow {
  fill: #fbbc04;
}

.contact-label {
  display: inline-block;
  min-width: 66px;
  color: var(--muted);
}

.quick-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.quick-links a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper);
  color: var(--ink);
  font-weight: 600;
}

.quick-links a:hover,
.quick-links a:focus {
  border-color: var(--accent);
  color: var(--accent-strong);
  text-decoration: none;
}

main section {
  padding-top: 14px;
  margin-bottom: 34px;
}

h2 {
  margin: 0 0 14px;
  border-bottom: 1px solid var(--line);
  font-size: 1.55rem;
  line-height: 1.25;
}

h3 {
  margin: 22px 0 10px;
  font-size: 1rem;
}

p {
  margin: 0 0 12px;
}

.news,
.compact-list,
.pub-list {
  margin: 0;
  padding-left: 20px;
}

.news li,
.compact-list li,
.pub-list li {
  margin: 8px 0;
}

.pub-list li {
  margin-bottom: 13px;
}

.tag {
  display: inline-block;
  min-width: 94px;
  margin-right: 4px;
  color: var(--muted);
  font-family: Menlo, Consolas, monospace;
  font-size: 0.88rem;
}

.date {
  color: var(--muted);
  font-weight: 700;
}

.note {
  color: var(--muted);
  font-size: 0.92rem;
}

footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  width: min(1160px, calc(100% - 32px));
  margin: 0 auto;
  padding: 20px 0 36px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.92rem;
}

.view-counter {
  display: inline-flex;
  align-items: center;
  line-height: 1;
}

.view-counter img {
  display: block;
  height: 20px;
}

@media (max-width: 820px) {
  .layout {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .profile {
    position: static;
  }

}

/* Research highlights and accessible navigation. */
:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
.skip-link { position: absolute; top: -80px; left: 16px; z-index: 30; background: var(--paper); padding: 12px 18px; }
.skip-link:focus { top: 8px; }
section[id] { scroll-margin-top: 72px; }
.nav { gap: 28px; }
.nav a:first-child { color: var(--link); font-weight: 400; }
.eyebrow { font-size: .8rem; letter-spacing: .12em; text-transform: uppercase; }
.quick-links a:first-child { color: white; background: var(--accent); border-color: var(--accent); }
.quick-links a:first-child:hover { background: var(--accent-strong); }
.section-intro { color: var(--muted); margin-bottom: 20px; }
.section-links, .resource-links { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: .9rem; }
.section-links { margin-top: 16px; }
.research-list { display: grid; gap: 20px; }
.research-item { display: grid; grid-template-columns: 220px minmax(0, 1fr); align-items: center; gap: 24px; padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.research-item:last-child { border-bottom: 0; padding-bottom: 0; }
.research-figure { display: block; padding: 6px; border: 1px solid var(--line); border-radius: 6px; background: white; }
.research-figure img { display: block; width: 100%; height: 150px; object-fit: contain; }
.research-item h3 { margin: 4px 0 8px; font-size: 1.12rem; line-height: 1.35; }
.research-item p { font-size: .94rem; }
.research-topic { color: var(--accent-strong); font-size: .76rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.pub-list .resource-links { margin-top: 7px; }
.pub-list strong { font-weight: 650; }
.news-archive { margin-top: 12px; }
summary { cursor: pointer; color: var(--link); }
summary:hover { text-decoration: underline; }
.news-archive summary { font-size: .9rem; }
.news-archive[open] summary { margin-bottom: 12px; }
.software-list { display: grid; gap: 0; }
.software-item { padding: 18px 0; border-bottom: 1px solid var(--line); }
.software-item:first-child { padding-top: 0; }
.software-item:last-child { border-bottom: 0; }
.software-item h3 { margin: 0 0 6px; font-size: 1.05rem; }
.software-item p { margin-bottom: 8px; }
pre { overflow-x: auto; }
@media (max-width: 1000px) and (min-width: 821px) {
  .layout { grid-template-columns: 220px minmax(0, 1fr); gap: 28px; }
  .research-item { grid-template-columns: 170px minmax(0, 1fr); gap: 18px; }
}
@media (max-width: 820px) {
  .layout { padding-top: 24px; gap: 20px; }
  .profile { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 0 18px; padding: 0 0 20px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; box-shadow: none; }
  .profile-name { align-self: end; font-size: 1.5rem; }
  .profile .affiliation { margin: 0; font-size: .9rem; }
  .profile .focus { display: none; }
  .profile .social-links { grid-column: 1 / -1; margin: 14px 0 8px; }
  .profile ul { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 0 20px; font-size: .85rem; }
  .profile li { margin: 2px 0; }
  .contact-label { min-width: auto; margin-right: 8px; }
  .nav { gap: 20px; min-height: 52px; font-size: .9rem; }
}
@media (max-width: 520px) {
  .nav { gap: 0; justify-content: space-between; }
  .nav a { padding: 14px 0; }
  .research-item { grid-template-columns: 1fr; gap: 14px; }
  .research-figure img { height: auto; max-height: 230px; }
  .quick-links { gap: 8px; }
  .quick-links a { padding: 0 10px; font-size: .9rem; }
  .pub-list { padding-left: 18px; }
  .tag { min-width: 0; margin-right: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

/* The opening Home section showcases the existing full-resolution portrait. */
.home {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 350px);
  align-items: center;
  gap: clamp(32px, 6vw, 80px);
  width: min(1160px, calc(100% - 32px));
  margin: 0 auto;
  padding: 52px 0 44px;
  border-bottom: 1px solid var(--line);
}
.home h1 {
  margin: 0 0 8px;
  font-size: clamp(2.8rem, 5.5vw, 4.5rem);
  line-height: 1.08;
  letter-spacing: -.045em;
}
.home-role { color: var(--muted); margin-bottom: 26px; }
.home h2 { border: 0; margin-bottom: 14px; font-size: clamp(1.3rem, 2.4vw, 1.8rem); line-height: 1.3; }
.home .lead { max-width: 600px; font-size: 1.05rem; color: #3d3d3d; }
.home-portrait { display: block; width: 100%; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); box-shadow: 0 18px 45px rgba(33, 44, 38, .08); }
.home-portrait img { display: block; width: 100%; height: auto; }
.profile-name { font-weight: 700; }
.nav a:first-child { color: var(--ink); font-weight: 700; }
@media (max-width: 820px) {
  .home { grid-template-columns: minmax(0, 1fr) minmax(180px, 240px); gap: 28px; padding: 32px 0; }
  .home-role { margin-bottom: 18px; }
  .profile { display: block; padding-bottom: 16px; }
  .profile-name { display: none; }
  .profile .social-links { margin: 10px 0; }
  .nav { gap: 18px; }
}
@media (max-width: 600px) {
  .home { grid-template-columns: 1fr; gap: 24px; }
  .home-portrait { grid-row: 1; width: min(72vw, 280px); justify-self: center; }
  .home-intro { text-align: center; }
  .home .quick-links { justify-content: center; }
  .home .eyebrow { font-size: .72rem; letter-spacing: .08em; }
  .home h1 { font-size: 2.8rem; }
  .home-role { font-size: .9rem; }
  .home .lead { font-size: 1rem; }
}
@media (max-width: 520px) {
  .nav { gap: 0; font-size: .82rem; }
}
