:root {
  --ink: #1f2530;
  --text: #3c4656;
  --muted: #667282;
  --line: #dbe4ef;
  --paper: #ffffff;
  --wash: #f5f7fb;
  --tint: #edf4fb;
  --green: #275f9f;
  --green-dark: #17365f;
  --blue: #6b88b0;
  --gold: #8a6b22;
  --coral: #a95656;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--wash);
  font-family: "Ubuntu Mono", "Roboto Mono", "SFMono-Regular", "Menlo", "Monaco", "Consolas", "Liberation Mono", monospace;
  line-height: 1.65;
}

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

a {
  color: inherit;
}

button,
input {
  font: inherit;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

.skip-link {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 40;
  transform: translateY(-150%);
  background: var(--green-dark);
  color: var(--paper);
  padding: 0.55rem 0.75rem;
  border-radius: 4px;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem max(1rem, calc((100vw - 1180px) / 2));
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.site-name {
  color: var(--ink);
  font-size: 1.02rem;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.site-header nav {
  display: none;
  align-items: center;
  gap: 0.35rem;
}

.site-header nav a {
  padding: 0.45rem 0.55rem;
  color: var(--muted);
  font-size: 0.93rem;
  font-weight: 700;
  text-decoration: none;
}

.site-header nav a:hover,
.site-header nav a:focus,
.site-header nav a.is-active {
  color: var(--green);
}

.banner {
  position: relative;
  height: 12rem;
  overflow: hidden;
  background: linear-gradient(135deg, var(--green-dark), var(--blue));
}

.banner::after {
  position: absolute;
  inset: 0;
  content: "";
  background:
    linear-gradient(90deg, rgba(23, 54, 95, 0.84), rgba(23, 54, 95, 0.24)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(23, 54, 95, 0.68));
}

.banner-image {
  width: 100%;
  height: 12rem;
  object-fit: cover;
  object-position: center;
  filter: saturate(0.86) contrast(1.02);
}

.page-shell {
  display: grid;
  gap: 2rem;
  width: min(1180px, calc(100% - 2rem));
  margin: -2.25rem auto 0;
  position: relative;
  z-index: 2;
}

.profile-sidebar,
.content-column {
  min-width: 0;
}

.profile-sidebar {
  align-self: start;
  padding: 1.1rem;
  background: var(--paper);
  border: 1px solid var(--line);
}

.avatar-wrap {
  width: min(11.5rem, 54vw);
  aspect-ratio: 1;
  margin: 0 auto 1rem;
  overflow: hidden;
  border: 6px solid var(--paper);
  box-shadow: 0 0 0 1px var(--line);
}

.avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 52% 24%;
}

.profile-sidebar h1 {
  margin-bottom: 0.3rem;
  text-align: center;
  font-size: 1.55rem;
  line-height: 1.2;
}

.role,
.affiliation,
.tagline {
  text-align: center;
}

.role {
  margin-bottom: 0.25rem;
  color: var(--green);
  font-weight: 800;
}

.affiliation {
  margin-bottom: 0.85rem;
  color: var(--muted);
}

.tagline {
  margin: 0 0 1rem;
  color: var(--text);
  font-size: 0.92rem;
}

.theme-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.25rem;
  border: 1px solid var(--green);
  border-radius: 4px;
  color: var(--green);
  font-size: 0.85rem;
  font-weight: 800;
  text-decoration: none;
}

.theme-button:hover,
.theme-button:focus {
  background: var(--green);
  color: var(--paper);
}

.sidebar-links {
  display: grid;
  gap: 0.65rem;
  margin-top: 1.1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.sidebar-links a {
  display: grid;
  grid-template-columns: 1.35rem minmax(0, 1fr);
  align-items: center;
  gap: 0.65rem;
  color: var(--ink);
  text-decoration: none;
}

.social-icon {
  width: 1.2rem;
  height: 1.2rem;
  color: var(--green);
  fill: currentColor;
}

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

.sidebar-links span,
.contact-grid span {
  display: grid;
  min-width: 0;
}

.sidebar-links em,
.contact-grid em {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  font-style: normal;
}

.sidebar-links strong {
  overflow-wrap: anywhere;
  font-size: 0.9rem;
}

.content-column {
  background: var(--paper);
  border: 1px solid var(--line);
}

.content-section {
  padding: 1.4rem;
  border-bottom: 1px solid var(--line);
  content-visibility: auto;
  contain-intrinsic-size: 760px;
}

.content-section:last-child {
  border-bottom: 0;
}

.section-kicker {
  margin-bottom: 0.55rem;
  color: var(--green);
  font-size: 0.8rem;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

.content-section h2 {
  margin-bottom: 0.85rem;
  color: var(--ink);
  font-size: 1.85rem;
  line-height: 1.22;
}

.lead {
  color: var(--text);
  font-size: 1.03rem;
}

.profile-copy {
  display: grid;
  gap: 0.9rem;
}

.profile-copy p,
.publication-header p,
.feature-panel p,
.updated-note {
  color: var(--text);
}

.publication-header {
  display: grid;
  gap: 1rem;
  align-items: end;
  margin-bottom: 0.75rem;
}

.publication-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.6rem;
  margin: 1rem 0 0.55rem;
}

.publication-stat {
  min-width: 0;
  padding: 0.75rem;
  background: var(--tint);
  border-left: 4px solid var(--green);
}

.publication-stat strong {
  display: block;
  color: var(--green-dark);
  font-size: 1.35rem;
  line-height: 1;
}

.publication-stat span {
  display: block;
  margin-top: 0.28rem;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.stats-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.paper-search {
  display: grid;
  gap: 0.35rem;
}

.paper-search span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.paper-search input {
  width: 100%;
  min-height: 2.6rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0 0.78rem;
  background: var(--paper);
  color: var(--ink);
}

.paper-search input:focus {
  outline: 3px solid rgba(39, 95, 159, 0.14);
  border-color: var(--green);
}

.publication-list {
  display: grid;
  gap: 1.6rem;
}

.publication-card {
  display: grid;
  gap: 1rem;
  padding-bottom: 1.6rem;
  border-bottom: 1px solid var(--line);
}

.publication-card:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.publication-card[hidden] {
  display: none;
}

.publication-thumb {
  display: block;
  align-self: start;
  aspect-ratio: 4 / 3;
  min-height: 8rem;
  overflow: hidden;
  background: var(--tint);
  border: 1px solid var(--line);
  text-decoration: none;
}

.publication-thumb picture,
.publication-thumb img {
  width: 100%;
  height: 100%;
}

.publication-thumb img {
  aspect-ratio: 4 / 3;
  object-fit: cover;
  object-position: center;
}

.publication-thumb span {
  display: grid;
  min-height: 8rem;
  place-items: center;
  color: var(--green);
  font-weight: 850;
}

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

.publication-meta span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.publication-meta span:not(:last-child)::after {
  content: "·";
  margin-left: 0.4rem;
  color: var(--line);
}

.publication-meta span:last-child:nth-child(4) {
  color: var(--coral);
}

.publication-body h3 {
  margin-bottom: 0.55rem;
  font-size: 1.18rem;
  line-height: 1.35;
}

.publication-body h3 a {
  color: var(--ink);
  text-decoration: none;
}

.publication-body h3 a:hover,
.publication-body h3 a:focus {
  color: var(--green);
}

.authors {
  margin-bottom: 0.7rem;
  color: var(--text);
  font-size: 0.93rem;
}

.publication-actions,
.feature-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 0.75rem;
}

.theme-button {
  padding: 0.34rem 0.6rem;
}

.theme-button-code {
  border-color: var(--gold);
  color: var(--gold);
}

.theme-button-code:hover,
.theme-button-code:focus {
  background: var(--gold);
  color: var(--paper);
}

.publication-details {
  color: var(--text);
}

.publication-details summary {
  cursor: pointer;
  color: var(--green);
  font-weight: 850;
}

.publication-details p {
  margin: 0.75rem 0 0;
}

.code-links {
  display: grid;
  gap: 0.65rem;
  margin-top: 1rem;
}

.code-links a {
  display: grid;
  gap: 0.08rem;
  padding: 0.78rem;
  background: var(--wash);
  border-left: 4px solid var(--gold);
  color: var(--ink);
  text-decoration: none;
}

.code-links span {
  color: var(--gold);
  font-size: 0.76rem;
  font-weight: 850;
}

.code-links small {
  color: var(--muted);
}

.figure-carousel {
  margin-top: 1rem;
}

.figure-stage {
  display: grid;
}

.paper-figure {
  display: none;
  margin: 0;
}

.paper-figure.is-active {
  display: block;
}

.paper-figure img {
  width: 100%;
  max-height: 28rem;
  object-fit: contain;
  padding: 0.45rem;
  background: var(--paper);
  border: 1px solid var(--line);
}

figcaption {
  margin-top: 0.65rem;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.55;
}

.figure-controls {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.7rem;
}

.figure-controls button {
  display: inline-grid;
  width: 2.2rem;
  height: 2.2rem;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--paper);
  color: var(--green);
  cursor: pointer;
  font-weight: 850;
}

.figure-controls button:hover,
.figure-controls button:focus {
  background: var(--green);
  color: var(--paper);
}

.figure-controls span {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.interest-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
  padding: 0;
  margin: 1rem 0 1.4rem;
  list-style: none;
}

.interest-list li {
  padding: 0.62rem 0.72rem;
  background: var(--wash);
  border-left: 4px solid var(--green);
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 700;
}

.feature-panel {
  display: grid;
  gap: 1rem;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}

.feature-panel h2 {
  font-size: 1.35rem;
}

.feature-panel figure {
  margin: 0;
}

.feature-panel img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: contain;
  background: var(--paper);
  border: 1px solid var(--line);
}

.contact-grid {
  display: grid;
  gap: 0.8rem;
  margin-top: 1.2rem;
}

.contact-grid a {
  display: grid;
  grid-template-columns: 1.35rem minmax(0, 1fr);
  align-items: center;
  gap: 0.7rem;
  padding: 0.9rem;
  background: var(--wash);
  border-left: 4px solid var(--green);
  color: var(--ink);
  text-decoration: none;
}

.contact-grid a:hover,
.contact-grid a:focus {
  background: var(--tint);
}

.contact-grid strong {
  overflow-wrap: anywhere;
}

.updated-note {
  margin: 1rem 0 0;
  font-size: 0.88rem;
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 2rem 0 2.5rem;
  color: var(--muted);
}

.site-footer p {
  margin: 0;
}

.site-footer a {
  color: var(--green);
  font-weight: 800;
  text-decoration: none;
}

@media (min-width: 720px) {
  .site-header nav {
    display: flex;
  }

  .banner,
  .banner-image {
    height: 16rem;
  }

  .page-shell {
    grid-template-columns: minmax(15rem, 0.32fr) minmax(0, 0.68fr);
    align-items: start;
  }

  .profile-sidebar {
    position: sticky;
    top: 5.25rem;
  }

  .content-section {
    padding: 1.8rem;
  }

  .publication-header {
    grid-template-columns: minmax(0, 1fr) minmax(15rem, 0.34fr);
  }

  .publication-card {
    grid-template-columns: minmax(10rem, 0.32fr) minmax(0, 0.68fr);
  }

  .publication-thumb {
    height: 10.75rem;
  }

  .feature-panel {
    grid-template-columns: minmax(0, 0.9fr) minmax(16rem, 0.7fr);
    align-items: start;
  }

  .contact-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1040px) {
  .page-shell {
    grid-template-columns: 18rem minmax(0, 1fr);
    gap: 2.2rem;
  }

  .content-section {
    padding: 2rem 2.2rem;
  }
}

@media (max-width: 719px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .site-header nav {
    display: flex;
    width: 100%;
    overflow-x: auto;
    padding-bottom: 0.15rem;
  }

  .page-shell {
    width: min(100% - 1rem, 44rem);
  }

  .content-section {
    padding: 1.1rem;
  }

  .content-section h2 {
    font-size: 1.55rem;
  }

  .interest-list {
    grid-template-columns: 1fr;
  }

  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }
}
