:root {
  --background: #ffffff;
  --surface: #f7f8fa;
  --surface-blue: #f3f7fc;
  --text: #20242c;
  --muted: #5e6673;
  --blue: #215a9a;
  --blue-dark: #173f6d;
  --border: #dfe3e8;
  --font-serif: Georgia, "Times New Roman", serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --content-width: 1080px;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
}

body {
  margin: 0;
  color: var(--text);
  background: var(--background);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

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

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

a:hover {
  color: var(--blue-dark);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

button {
  font: inherit;
}

h1,
h2,
h3,
p,
dl,
dd,
ol,
ul,
figure {
  margin-top: 0;
}

h1,
h2,
h3 {
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

section,
article,
footer {
  scroll-margin-top: 5rem;
}

:focus-visible {
  outline: 3px solid #f2a900;
  outline-offset: 3px;
}

::selection {
  color: #fff;
  background: var(--blue);
}

.shell {
  width: min(var(--content-width), calc(100% - 48px));
  margin-inline: auto;
}

.skip-link {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 2000;
  padding: 0.65rem 0.9rem;
  color: #fff;
  background: var(--text);
  transform: translateY(-160%);
}

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

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

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

.wordmark {
  display: inline-flex;
  align-items: baseline;
  color: var(--text);
  font-family: var(--font-serif);
  font-size: 1.3rem;
  font-weight: 700;
}

.wordmark:hover {
  text-decoration: none;
}

.wordmark__mark {
  display: none;
}

.nav__links {
  display: flex;
  align-items: center;
  gap: 1.45rem;
}

.nav__links a {
  color: var(--muted);
  font-size: 0.88rem;
}

.nav__links a:hover,
.nav__links a[aria-current="true"] {
  color: var(--blue);
  text-decoration: none;
}

.nav__links .nav__contact {
  padding-left: 1.45rem;
  border-left: 1px solid var(--border);
}

.menu-toggle {
  width: 42px;
  height: 42px;
  display: none;
  border: 1px solid var(--border);
  border-radius: 3px;
  color: var(--text);
  background: #fff;
  cursor: pointer;
}

.menu-toggle span {
  width: 18px;
  height: 1px;
  display: block;
  margin: 5px auto;
  background: currentColor;
  transition: transform 160ms ease;
}

.menu-toggle[aria-expanded="true"] span:first-child {
  transform: translateY(3px) rotate(45deg);
}

.menu-toggle[aria-expanded="true"] span:last-child {
  transform: translateY(-3px) rotate(-45deg);
}

/* Shared components */
.eyebrow,
.section-kicker,
.software-card__label,
.service-grid__label,
.timeline__type {
  color: var(--blue);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

.eyebrow {
  margin-bottom: 0.8rem;
}

.section-kicker {
  margin-bottom: 0;
}

.section-kicker span {
  display: none;
}

.button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.55rem 0.9rem;
  border: 1px solid var(--blue);
  border-radius: 3px;
  font-size: 0.86rem;
  font-weight: 600;
}

.button:hover {
  text-decoration: none;
}

.button--primary {
  color: #fff;
  background: var(--blue);
}

.button--primary:hover {
  color: #fff;
  background: var(--blue-dark);
}

.button--outline {
  color: var(--blue);
  background: #fff;
}

.text-link {
  font-size: 0.88rem;
  font-weight: 600;
}

/* Introduction */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 255px;
  align-items: start;
  gap: clamp(3rem, 7vw, 6.5rem);
  padding-block: clamp(4.5rem, 8vw, 7rem);
}

.hero__copy {
  padding-top: 0.5rem;
}

.hero__copy h1 {
  margin-bottom: 1.25rem;
  color: var(--text);
  font-family: var(--font-serif);
  font-size: clamp(3rem, 6vw, 4.8rem);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.05;
}

.hero__statement {
  max-width: 720px;
  margin-bottom: 1rem;
  color: #343a43;
  font-family: var(--font-serif);
  font-size: clamp(1.25rem, 2.2vw, 1.65rem);
  line-height: 1.45;
}

.hero__intro {
  max-width: 710px;
  margin-bottom: 1.7rem;
  color: var(--muted);
}

.hero__actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.25rem;
}

.portrait-card {
  padding: 0;
  background: transparent;
}

.portrait-card img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  object-position: center 35%;
  border: 1px solid var(--border);
  border-radius: 4px;
}

.portrait-card__index,
.portrait-card__caption {
  display: none;
}

.hero__facts {
  margin: 1rem 0 0;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.hero__facts div {
  display: grid;
  grid-template-columns: 70px 1fr;
  gap: 0.75rem;
  padding-block: 0.3rem;
}

.hero__facts dt {
  color: var(--muted);
  font-size: 0.72rem;
}

.hero__facts dd {
  margin: 0;
  color: var(--text);
  font-size: 0.78rem;
}

.latest {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr) auto;
  align-items: center;
  gap: 1.25rem;
  padding-block: 0.9rem;
  border-top: 1px solid #cbd9e8;
  border-bottom: 1px solid #cbd9e8;
  background: var(--surface-blue);
  box-shadow: 24px 0 var(--surface-blue), -24px 0 var(--surface-blue);
}

.latest__label {
  color: var(--blue);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
}

.latest p {
  margin: 0;
  color: #343a43;
  font-size: 0.9rem;
}

.latest a {
  font-size: 0.78rem;
  font-weight: 600;
}

/* Sections */
.section {
  padding-block: clamp(4.5rem, 7vw, 6.5rem);
  border-top: 1px solid var(--border);
}

.section-heading {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  gap: 2.5rem;
  margin-bottom: 2.5rem;
}

.section-heading h2 {
  margin-bottom: 0.65rem;
  font-family: var(--font-serif);
  font-size: clamp(2rem, 3.5vw, 2.8rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.15;
}

.section-heading > div > p {
  max-width: 700px;
  margin-bottom: 0;
  color: var(--muted);
}

/* Research */
.research-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--border);
  border-left: 1px solid var(--border);
}

.research-card,
.research-card--blue,
.research-card--orange,
.research-card--ink {
  min-height: 0;
  padding: 1.6rem;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  color: var(--text);
  background: #fff;
}

.research-card__number {
  display: none;
}

.research-card h3 {
  margin-bottom: 0.7rem;
  color: var(--text);
  font-family: var(--font-serif);
  font-size: 1.35rem;
}

.research-card p {
  margin-bottom: 1.1rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.research-card ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.research-card li {
  padding: 0.2rem 0.45rem;
  border: 1px solid var(--border);
  border-radius: 3px;
  color: var(--muted);
  background: var(--surface);
  font-size: 0.68rem;
}

/* Publications */
.section--publications {
  color: var(--text);
  background: var(--background);
}

.section-heading--light .section-kicker,
.section-kicker--light {
  color: var(--blue);
}

.section-heading--light > div > p {
  color: var(--muted);
}

.publication-list {
  border-top: 1px solid var(--border);
}

.publication {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 2rem;
  padding-block: 2rem;
  border-bottom: 1px solid var(--border);
}

.publication__meta {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.publication__year {
  color: var(--text);
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 700;
}

.publication__venue {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 600;
}

.publication__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.55rem;
}

.badge {
  padding: 0.15rem 0.4rem;
  border: 1px solid #b9c6d6;
  border-radius: 3px;
  color: #49627e;
  background: var(--surface-blue);
  font-size: 0.64rem;
  font-weight: 600;
}

.badge--accepted,
.badge--award {
  color: #6b4b12;
  border-color: #dfc58b;
  background: #fff9e9;
}

.publication h3 {
  max-width: 900px;
  margin-bottom: 0.55rem;
  color: var(--text);
  font-family: var(--font-serif);
  font-size: clamp(1.2rem, 2.2vw, 1.5rem);
  font-weight: 700;
  line-height: 1.3;
}

.publication__authors {
  margin-bottom: 0.55rem;
  color: var(--muted);
  font-size: 0.86rem;
}

.publication__authors strong {
  color: var(--text);
}

.publication__summary {
  max-width: 820px;
  margin-bottom: 0.75rem;
  color: #454c57;
  font-size: 0.9rem;
}

.publication__status {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-style: italic;
}

.publication__links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.publication__links a {
  font-size: 0.78rem;
  font-weight: 600;
}

.publication-index-link {
  display: inline-block;
  margin-top: 1.5rem;
  font-size: 0.9rem;
  font-weight: 600;
}

/* Research software */
.software-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px auto;
  align-items: center;
  gap: 2rem;
  padding: 1.8rem 2rem;
  border: 1px solid var(--border);
  border-left: 4px solid var(--blue);
  background: #fff;
}

.software-card__label {
  display: block;
  margin-bottom: 0.35rem;
}

.software-card h3 {
  margin-bottom: 0.4rem;
  font-family: var(--font-serif);
  font-size: 1.8rem;
}

.software-card p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.software-card__topics {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  color: var(--muted);
  font-size: 0.78rem;
}

/* Experience and education */
.section--journey {
  background: var(--surface);
}

.timeline {
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--border);
  list-style: none;
}

.timeline li {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  gap: 2rem;
  padding-block: 1.35rem;
  border-bottom: 1px solid var(--border);
}

.timeline time {
  color: var(--muted);
  font-size: 0.86rem;
}

.timeline__type {
  display: block;
  margin-bottom: 0.15rem;
}

.timeline h3 {
  margin-bottom: 0.2rem;
  font-family: var(--font-serif);
  font-size: 1.2rem;
}

.timeline p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.timeline .timeline__description {
  max-width: 760px;
  margin-top: 0.4rem;
}

/* Service */
.service-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--border);
  border-left: 1px solid var(--border);
}

.service-grid article {
  min-height: 150px;
  padding: 1.4rem;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.service-grid__label {
  display: block;
  margin-bottom: 0.45rem;
}

.service-grid h3 {
  margin-bottom: 0.6rem;
  font-family: var(--font-serif);
  font-size: 1.15rem;
  line-height: 1.4;
}

.service-grid p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.8rem;
}

/* Contact */
.contact {
  border-top: 1px solid var(--border);
  background: var(--surface-blue);
}

.contact__inner {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  gap: 2.5rem;
  padding-block: 4rem;
}

.contact h2 {
  margin-bottom: 0.5rem;
  color: var(--text);
  font-family: var(--font-serif);
  font-size: 2.25rem;
}

.contact__inner > div > p {
  margin-bottom: 1.25rem;
  color: var(--muted);
}

.contact__links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.3rem;
}

.contact__links a {
  font-size: 0.88rem;
  font-weight: 600;
}

/* Footer */
.footer {
  min-height: 92px;
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 2rem;
  color: var(--muted);
  font-size: 0.75rem;
}

.footer p {
  margin: 0;
}

/* Responsive */
@media (max-width: 860px) {
  body.menu-open {
    overflow: hidden;
  }

  .menu-toggle {
    display: block;
  }

  .nav__links {
    position: fixed;
    top: 66px;
    right: 0;
    left: 0;
    min-height: calc(100dvh - 66px);
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 1rem 24px 2rem;
    visibility: hidden;
    background: #fff;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-0.5rem);
    transition: opacity 160ms ease, transform 160ms ease, visibility 160ms;
  }

  .nav__links.is-open {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
  }

  .nav__links a,
  .nav__links .nav__contact {
    padding: 0.9rem 0;
    border-left: 0;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    font-family: var(--font-serif);
    font-size: 1.25rem;
  }

  .hero {
    grid-template-columns: minmax(0, 1fr) 210px;
    gap: 2.5rem;
  }

  .section-heading,
  .contact__inner {
    grid-template-columns: 135px minmax(0, 1fr);
  }

  .software-card {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .software-card__topics {
    grid-column: 1 / -1;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 1rem;
  }
}

@media (max-width: 680px) {
  .shell {
    width: min(var(--content-width), calc(100% - 32px));
  }

  .hero {
    grid-template-columns: 1fr;
    padding-block: 3.5rem;
  }

  .hero__aside {
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr);
    align-items: start;
    gap: 1.25rem;
  }

  .hero__facts {
    margin-top: 0;
  }

  .hero__facts div {
    grid-template-columns: 60px 1fr;
  }

  .latest {
    grid-template-columns: 55px 1fr;
    gap: 0.65rem;
  }

  .latest a {
    grid-column: 2;
  }

  .section-heading,
  .contact__inner {
    grid-template-columns: 1fr;
    gap: 0.7rem;
  }

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

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

  .publication__meta {
    flex-direction: row;
    align-items: baseline;
    gap: 0.7rem;
  }

  .software-card {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .software-card__topics {
    grid-column: auto;
  }

  .software-card .button {
    width: 100%;
  }

  .timeline li {
    grid-template-columns: 1fr;
    gap: 0.35rem;
  }

  .footer {
    grid-template-columns: 1fr auto;
  }

  .footer p:nth-child(2) {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

@media print {
  .site-header,
  .hero__actions,
  .latest,
  .contact,
  .footer,
  .software-card .button {
    display: none !important;
  }

  body,
  .section--publications,
  .section--journey {
    color: #000;
    background: #fff;
  }

  .hero,
  .section {
    padding-block: 1.5rem;
  }

  a {
    color: #000;
    text-decoration: underline;
  }
}
