:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-2: #f0f4fa;
  --text: #172033;
  --muted: #5e6a80;
  --border: #d8e0ec;
  --accent: #1f4b99;
  --accent-2: #17356d;
  --shadow: 0 18px 45px rgba(20, 35, 70, 0.08);
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --max-width: 1440px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Inter", Arial, sans-serif;
  background: linear-gradient(180deg, #f7f9fc 0%, #eef3fa 100%);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

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

a:hover {
  color: var(--accent-2);
  text-decoration: underline;
}

.site-shell {
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 32px;
  padding: 28px;
}

.sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  min-height: 100vh;
}

.sidebar-inner {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(216, 224, 236, 0.9);
  border-radius: 28px;
  box-shadow: var(--shadow);
  padding: 28px;
}

/* desktop/mobile visibility */
.mobile-topbar {
  display: none;
}

.desktop-sidebar-top {
  display: block;
}

.sidebar-content {
  display: block;
}

.menu-toggle {
  display: none;
}

.profile-link {
  display: inline-block;
  margin-bottom: 20px;
}

.mobile-profile-link {
  margin-bottom: 0;
}

.profile-photo {
  width: 132px;
  height: 132px;
  object-fit: cover;
  border-radius: 24px;
  border: 4px solid #fff;
  box-shadow: 0 12px 26px rgba(19, 40, 78, 0.12);
}

.identity-block {
  margin-bottom: 28px;
}

.site-title {
  font-size: 1.7rem;
  line-height: 1.15;
  margin: 0 0 8px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.site-subtitle {
  margin: 0 0 4px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--accent-2);
}

.site-meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.site-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 28px;
}

.site-nav a {
  display: block;
  padding: 10px 14px;
  border-radius: 12px;
  color: var(--text);
  font-weight: 600;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.site-nav a:hover {
  background: var(--surface-2);
  text-decoration: none;
  transform: translateX(2px);
}

.site-nav a.active {
  background: var(--accent);
  color: #fff;
}

.sidebar-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px;
}

.sidebar-card h2 {
  margin: 0 0 12px;
  font-size: 1rem;
}

.sidebar-card p {
  margin: 0 0 14px;
  color: var(--muted);
}

.social-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sidebar-institutions {
  margin: 0 0 14px;
  gap: 10px;
}

.sidebar-institutions img {
  max-height: 22px;
}

.sidebar-institutions a:first-child img {
  max-height: 21px;
}

.social-icons {
  flex-direction: row;
  flex-wrap: wrap;
  gap: 10px;
}

.social-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid var(--border);
  color: var(--accent-2);
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.social-icon:hover {
  transform: translateY(-1px);
  text-decoration: none;
  background: var(--surface-2);
  border-color: rgba(31, 75, 153, 0.35);
}

.social-icon svg,
.social-icon img {
  width: 22px;
  height: 22px;
  display: block;
}

.social-icon svg {
  fill: currentColor;
}

.orcid-icon {
  background: #fff;
  border-color: var(--border);
}

.orcid-icon:hover {
  background: var(--surface-2);
  border-color: rgba(31, 75, 153, 0.35);
}

.linkedin-icon {
  color: #0a66c2;
}

.x-icon {
  color: #111;
}

.main-content {
  padding: 8px 0 40px;
}

.hero,
.page-header,
.section,
.pub-section,
.quote-block,
.card {
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(216, 224, 236, 0.95);
  border-radius: 28px;
  box-shadow: var(--shadow);
}

.hero,
.page-header,
.section,
.pub-section,
.quote-block {
  padding: 34px;
  margin-bottom: 24px;
}

.hero h2,
.page-header h2 {
  margin: 0 0 18px;
  font-size: clamp(2rem, 4vw, 3.3rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
  max-width: 980px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.lead {
  font-size: 1.1rem;
  color: #2c3950;
  max-width: 880px;
  margin: 0;
}

.institution-logos {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.institution-logos a {
  display: inline-flex;
  align-items: center;
}

.institution-logos img {
  display: block;
  width: auto;
  max-width: 100%;
  object-fit: contain;
}

.hero-institutions {
  margin-top: 26px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.hero-institutions-main {
  gap: 18px;
}

.hero-institutions-main img {
  max-height: 50px;
}

.hero-institutions-main a:first-child img {
  max-height: 42px;
}

.hero-institutions-side {
  margin-left: auto;
}

.hero-institutions-side img {
  max-height: 72px;
}

.gaiha-header {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(220px, 0.65fr);
  gap: 28px;
  align-items: center;
}

.gaiha-header-copy .lead {
  max-width: none;
}

.gaiha-header-logo {
  display: flex;
  justify-content: center;
  align-items: center;
}

.gaiha-header-logo img {
  width: min(100%, 320px);
  height: auto;
  filter: drop-shadow(0 16px 30px rgba(20, 35, 70, 0.12));
}

.grant-feature {
  display: grid;
  grid-template-columns: minmax(220px, 0.75fr) minmax(0, 1.25fr);
  gap: 28px;
  align-items: center;
}

.grant-feature-logo {
  display: flex;
  align-items: center;
  justify-content: center;
}

.grant-feature-logo img {
  width: min(100%, 320px);
  height: auto;
  object-fit: contain;
}

.grant-feature-copy h3 {
  margin-top: 0;
}

.project-logo {
  display: inline-flex;
  align-items: center;
  margin-right: 10px;
  vertical-align: middle;
}

.project-logo img {
  display: block;
  width: auto;
  height: 24px;
  max-width: 88px;
  object-fit: contain;
}

.hero-actions {
  margin-top: 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  border-radius: 999px;
  font-weight: 700;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.button:hover {
  text-decoration: none;
  transform: translateY(-1px);
}

.button-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 10px 22px rgba(31, 75, 153, 0.22);
}

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

.button-secondary {
  background: #fff;
  color: var(--accent);
  border: 1px solid var(--border);
}

.grid-two {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  margin-bottom: 24px;
}

.card {
  padding: 28px;
}

.card h3,
.section h3,
.pub-section h3 {
  margin-top: 0;
  margin-bottom: 14px;
  font-size: 1.3rem;
  line-height: 1.2;
}

.stack p:last-child,
.card p:last-child {
  margin-bottom: 0;
}

.mini-stack p {
  margin: 0 0 16px;
}

.software-header {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 18px;
}

.software-header h3 {
  margin: 0;
}

.software-logo {
  margin: 0;
  flex: 0 0 auto;
}

.software-logo img {
  max-height: 120px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
}

.epl-card {
  position: relative;
  padding-right: 180px;
}

.teaching-institutions {
  position: absolute;
  top: 28px;
  right: 28px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.teaching-institutions img {
  max-width: 120px;
  max-height: 54px;
  width: auto;
  height: auto;
  object-fit: contain;
}

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

.clean-list li {
  position: relative;
  padding-left: 18px;
  margin-bottom: 10px;
}

.clean-list li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 800;
}

.link-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.section-heading {
  margin-bottom: 18px;
}

.section-intro {
  margin: 8px 0 0;
  color: var(--muted);
}

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

.publication-preview li {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  gap: 18px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}

.publication-preview li:last-child {
  border-bottom: 0;
}

.news-card {
  max-height: 420px;
  overflow-y: auto;
  scrollbar-gutter: stable;
}

.news-card::-webkit-scrollbar {
  width: 10px;
}

.news-card::-webkit-scrollbar-track {
  background: transparent;
}

.news-card::-webkit-scrollbar-thumb {
  background: rgba(31, 75, 153, 0.28);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

.news-card::-webkit-scrollbar-thumb:hover {
  background: rgba(31, 75, 153, 0.42);
  background-clip: padding-box;
}

.pub-year {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 92px;
  width: fit-content;
  height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--accent-2);
  font-weight: 800;
  font-size: 0.9rem;
  white-space: nowrap;
}

.pub-section h3 {
  margin-bottom: 18px;
}

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

.pub-list li {
  margin-bottom: 18px;
  color: #27344a;
}

.pub-list strong {
  color: #14213a;
}

.pub-list a strong {
  color: inherit;
}

.pub-type {
  display: inline-block;
  margin-right: 8px;
  margin-bottom: 8px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--accent-2);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.quote-block blockquote {
  margin: 0 0 8px;
  font-size: 1.3rem;
  line-height: 1.4;
  font-weight: 700;
  color: #20304e;
}

.quote-block p {
  margin: 0;
  color: var(--muted);
}

hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 28px 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: 18px;
  overflow: hidden;
}

th,
td {
  text-align: left;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

th {
  background: var(--surface-2);
  font-weight: 700;
}

/* mobile menu button styles */
.menu-toggle {
  appearance: none;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  border-radius: 999px;
  padding: 10px 16px;
  font: inherit;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.menu-toggle:hover {
  background: var(--surface-2);
  transform: translateY(-1px);
}

.menu-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

@media (max-width: 1100px) {
  :root {
    --mobile-topbar-height: 110px;
  }

  .site-shell {
    grid-template-columns: 1fr;
    padding-top: calc(var(--mobile-topbar-height) + 12px);
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 16px;
    right: 16px;
    z-index: 1000;
    min-height: auto;
  }

  .sidebar-inner {
    padding: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
    backdrop-filter: none;
  }

  .main-content {
    padding-top: 0;
  }

  .mobile-topbar {
    position: relative;
    z-index: 2;
    padding: 14px 18px;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(18px);
    border: 1px solid rgba(216, 224, 236, 0.95);
    border-radius: 0 0 22px 22px;
    box-shadow: 0 12px 28px rgba(20, 35, 70, 0.12);
  }

  .sidebar-content {
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(216, 224, 236, 0.95);
    border-top: 0;
    border-radius: 0 0 22px 22px;
    box-shadow: 0 12px 28px rgba(20, 35, 70, 0.12);
    margin: 0;
    padding: 18px;
  }

  .desktop-sidebar-top {
    display: none;
  }

  .mobile-topbar {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
  }

  .mobile-topbar .profile-photo {
    width: 64px;
    height: 64px;
    border-radius: 18px;
    border-width: 3px;
    box-shadow: 0 8px 18px rgba(19, 40, 78, 0.1);
  }

  .mobile-identity {
    margin-bottom: 0;
  }

  .mobile-identity .site-title {
    font-size: 1.1rem;
    margin: 0 0 4px;
  }

  .mobile-identity .site-subtitle {
    font-size: 0.9rem;
    margin: 0 0 2px;
  }

  .mobile-identity .site-meta {
    font-size: 0.82rem;
    margin: 0;
  }

  .menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 84px;
  }

  .sidebar-content {
    display: none;
    position: fixed;
    top: calc(var(--mobile-topbar-height) - 2px);
    left: 16px;
    right: 16px;
    z-index: 999;
    max-height: calc(100vh - var(--mobile-topbar-height) - 12px);
    overflow-y: auto;
  }

  .sidebar-content.is-open {
    display: block;
  }

  .site-nav {
    margin-bottom: 20px;
  }

  .sidebar-card {
    padding: 16px;
  }

  .grid-two {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  :root {
    --mobile-topbar-height: 104px;
  }

  .site-shell {
    padding: 16px;
    padding-top: calc(var(--mobile-topbar-height) + 10px);
    gap: 18px;
  }

  .hero,
  .page-header,
  .section,
  .pub-section,
  .quote-block,
  .card {
    border-radius: 22px;
    padding: 22px;
  }

  .hero h2,
  .page-header h2 {
    font-size: 2rem;
  }

  .publication-preview li {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .software-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .epl-card {
    padding-right: 22px;
    padding-top: 96px;
  }

  .teaching-institutions {
    top: 22px;
    right: 22px;
  }

  .teaching-institutions img {
    max-width: 96px;
    max-height: 42px;
  }

  .gaiha-header {
    grid-template-columns: 1fr;
  }

  .grant-feature {
    grid-template-columns: 1fr;
  }

  .gaiha-header-logo {
    order: -1;
  }

  .gaiha-header-logo img {
    width: min(100%, 240px);
  }

  .news-card {
    max-height: 360px;
  }

  .hero-institutions {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero-institutions-main img {
    max-height: 40px;
  }

  .hero-institutions-main a:first-child img {
    max-height: 34px;
  }

  .hero-institutions-side {
    margin-left: 0;
  }

  .hero-institutions-side img {
    max-height: 60px;
  }

  .sidebar-institutions img {
    max-height: 18px;
  }

  .sidebar-institutions a:first-child img {
    max-height: 17px;
  }

  .pub-year {
    width: fit-content;
    min-width: 92px;
  }

  .profile-photo {
    width: 112px;
    height: 112px;
  }

  .mobile-topbar .profile-photo {
    width: 60px;
    height: 60px;
  }
}

.pub-download {
  margin-left: 8px;
  font-weight: 700;
  white-space: nowrap;
}

.subtle-links {
  margin: 10px 0 0;
  font-size: 0.95rem;
}

.subtle-links a {
  color: var(--muted);
  font-weight: 600;
}

.subtle-links a:hover {
  color: var(--accent);
}
.bibtex-block {
  max-width: 100%;
  margin: 0;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}
