:root {
  --bg: #ffffff;
  --text: #1b1d1f;
  --muted: #5b6068;
  --accent: #00337c;
  --accent-dark: #002147;
  --accent-underline: rgba(0, 51, 124, 0.35);
  --border: #e4e6ea;

  --font-serif: "Newsreader", Georgia, "Times New Roman", serif;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;

  --sidebar-width: 180px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

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

.container {
  max-width: 880px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

h1, h2, h3 {
  font-family: var(--font-serif);
  color: var(--accent-dark);
  line-height: 1.2;
  margin: 0 0 0.5rem;
}

h2 {
  font-size: 1.6rem;
  margin-bottom: 1.25rem;
}

h3 {
  font-size: 1.1rem;
  margin-top: 1.5rem;
}

p {
  margin: 0 0 1rem;
}

a {
  color: var(--accent);
  text-decoration-line: underline;
  text-decoration-color: var(--accent-underline);
  text-decoration-skip-ink: auto;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: text-decoration-color 0.15s ease;
}

a:hover,
a:focus-visible {
  text-decoration-color: var(--accent);
}

a:focus-visible,
button:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--accent-dark);
  color: #fff;
  padding: 0.6rem 1rem;
  z-index: 100;
  border-radius: 0 0 6px 0;
}

.skip-link:focus {
  left: 0;
}

/* Sidebar */

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--sidebar-width);
  display: flex;
  align-items: center;
  background: var(--bg);
  z-index: 10;
}

.sidebar-links {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
  width: 100%;
  padding: 2rem;
  font-size: 0.95rem;
}

.sidebar-links a {
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}

.sidebar-links a:hover,
.sidebar-links a:focus-visible {
  color: var(--accent);
}

.sidebar-links a.is-active {
  color: var(--accent-dark);
  font-weight: 600;
}

.page {
  margin-left: var(--sidebar-width);
  margin-right: var(--sidebar-width);
}

/* Hero */

.hero {
  padding: 3rem 0 2.5rem;
}

.hero-banner {
  text-align: center;
  margin-bottom: 2.75rem;
}

.hero-banner h1 {
  font-size: 2.6rem;
  margin-bottom: 0.3rem;
}

.hero-subtitle {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 1.1rem;
  color: var(--muted);
  letter-spacing: 0.01em;
  margin: 0 0 1.5rem;
}

.hero-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px;
  gap: 2.5rem;
  align-items: start;
}

.hero-text {
  min-width: 0;
}

.transport-photo {
  margin: 0;
  width: 240px;
}

.transport-photo img {
  width: 100%;
  height: auto;
  object-fit: cover;
  object-position: 50% 50%;
  border-radius: 14px;
  box-shadow: 0 2px 12px rgba(0, 33, 71, 0.1);
  display: block;
  outline: 1px solid var(--border);
  outline-offset: -1px;
  will-change: opacity;
}

.image-transport-canvas {
  contain: strict;
  display: none;
  height: 100vh;
  inset: 0;
  pointer-events: none;
  position: fixed;
  width: 100vw;
  z-index: 9;
}

body.image-transport-active .image-transport-canvas {
  display: block;
}

.photo-caption {
  margin: 0.55rem 0 0;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  line-height: 1.4;
  text-align: center;
  will-change: opacity;
}

.caption-narrow {
  display: none;
}

.intro,
.research-copy {
  max-width: 65ch;
}

.contact-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin-top: 1.25rem;
  font-size: 0.95rem;
}

.contact-row a {
  font-weight: 500;
}

.contact-row .sep {
  color: var(--muted);
}

/* Sections */

section {
  padding: 3.5rem 0;
}

section h2 {
  margin-bottom: 1.25rem;
}

.research-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px;
  grid-template-areas:
    "heading heading"
    "text photo";
  column-gap: 2.5rem;
  row-gap: 0;
  align-items: start;
}

.research-body > h2 {
  grid-area: heading;
}

.research-text {
  grid-area: text;
  min-width: 0;
}

.research-photo {
  grid-area: photo;
  justify-self: end;
}

.research-keywords {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.6;
  margin: 1.25rem 0 0;
}

/* Publications */

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

.pub {
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--border);
}

.pub:last-child {
  border-bottom: none;
}

.pub-title {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--accent-dark);
  margin: 0 0 0.3rem;
  text-wrap: pretty;
}

.pub-title a {
  color: inherit;
}

.pub-meta {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 0.3rem;
}

.pub-status {
  font-family: var(--font-serif);
  font-style: italic;
}

.pub-status::before {
  content: " · ";
  font-family: var(--font-sans);
  font-style: normal;
}

.pub-authors {
  font-size: 0.92rem;
  margin: 0 0 0.4rem;
}

.pub-authors strong {
  font-weight: 600;
}

.pub-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0;
}

.link-chip {
  display: inline-block;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.35;
  text-decoration: none;
  transition: color 0.15s ease;
}

.link-chip::before {
  content: "[";
}

.link-chip::after {
  content: "]";
}

.link-chip:hover,
.link-chip:focus-visible {
  color: var(--accent);
}

.pub-scholar-link {
  margin-top: 1.25rem;
  text-align: right;
}

.pub-row--with-thumb {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 1rem;
}

.pub-thumb {
  border-radius: 4px;
  display: block;
  height: 96px;
  object-fit: cover;
  width: 96px;
}

/* News */

.news-list {
  list-style: none;
  margin: 0.75rem 0 0;
  padding: 0;
}

.news-list li {
  display: flex;
  gap: 0.5rem 1rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border);
}

.news-list li:last-child {
  border-bottom: none;
}

.news-date {
  flex: 0 0 6.5rem;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 400;
  white-space: nowrap;
}

.news-text {
  flex: 1 1 auto;
  min-width: 0;
  overflow-wrap: break-word;
}

.news-earlier {
  margin-top: 1rem;
}

.news-earlier summary {
  color: var(--muted);
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: var(--accent-underline);
  text-underline-offset: 3px;
  width: max-content;
}

.news-earlier summary:hover,
.news-earlier summary:focus-visible {
  color: var(--accent);
  text-decoration-color: var(--accent);
}

.news-list--earlier {
  margin-top: 0.5rem;
}

/* Blog */

.blog-index h1,
.talks-index h1 {
  font-size: 2rem;
  margin-top: 0;
}

.blog-empty,
.talks-empty {
  color: var(--muted);
  font-family: var(--font-serif);
  font-style: italic;
  margin-top: 1.25rem;
}

.post-list {
  list-style: none;
  margin: 1.5rem 0;
  padding: 0;
}

.post-list li {
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--border);
}

.post-list li:last-child {
  border-bottom: none;
}

.post-date {
  display: inline-block;
  min-width: 5rem;
  color: var(--muted);
  font-size: 0.9rem;
}

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

.post {
  padding: 2.5rem 0;
}

.post-back {
  font-size: 0.9rem;
}

.post-meta {
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: -0.5rem;
}

.post-content {
  margin-top: 1.5rem;
}

/* Footer */

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

/* Responsive */

@media (max-width: 1099px) {
  html {
    scroll-padding-top: 84px;
  }

  .container {
    max-width: calc(65ch + 3rem);
  }

  .sidebar {
    position: sticky;
    top: 0;
    right: auto;
    bottom: auto;
    left: auto;
    width: auto;
    height: auto;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: saturate(180%) blur(8px);
  }

  .sidebar-links {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.4rem 1.15rem;
    padding: 0.9rem 1.5rem;
  }

  .page {
    margin-left: 0;
    margin-right: 0;
  }

  .hero {
    padding-top: 2.25rem;
  }

  .hero-body,
  .research-body {
    grid-template-columns: 1fr;
    margin-left: auto;
    margin-right: auto;
    max-width: 65ch;
  }

  .hero-body {
    gap: 1.5rem;
  }

  .research-body {
    grid-template-areas:
      "photo"
      "heading"
      "text";
    gap: 1.25rem;
  }

  .hero-photo {
    justify-self: center;
    order: -1;
  }

  .research-photo {
    justify-self: center;
  }

  .research-body > h2 {
    margin-bottom: 0;
  }

  .caption-wide {
    display: none;
  }

  .caption-narrow {
    display: inline;
  }
}

@media (max-width: 700px) {
  .transport-photo {
    width: min(220px, 78vw);
  }

  .contact-row .sep {
    display: none;
  }

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

  .pub-row--with-thumb {
    display: block;
  }

  .pub-thumb {
    display: none;
  }

  .news-list li {
    column-gap: 0.75rem;
  }
}

@media (max-width: 420px) {
  html {
    scroll-padding-top: 104px;
  }

  .container {
    padding-left: 1.1rem;
    padding-right: 1.1rem;
  }

  .sidebar-links {
    column-gap: 0.9rem;
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .news-list li {
    display: block;
  }

  .news-date {
    display: block;
    margin-bottom: 0.1rem;
  }
}
