  :root {
    --clr-bg: #f8f9fa;
    --clr-surface: #ffffff;
    --clr-text: #1f2937;
    --clr-text-muted: #6b7280;
    --clr-accent: #2d7d9a;
    --clr-accent-light: #d4eef4;
    --clr-border: #e2e8f0;
    --clr-highlight: #f4a030;
    --clr-outstanding: #bc3e33;
    --clr-header: rgba(248,249,250,.92);
    --clr-nav-mobile: rgba(248,249,250,.97);
    --font-serif: 'Source Serif 4', Georgia, serif;
    --font-sans: 'DM Sans', system-ui, sans-serif;
    --max-w: 960px;
    --header-h: 72px;
  }

  @media (prefers-color-scheme: dark) {
    :root {
      --clr-bg: #2e3440;
      --clr-surface: #3b4252;
      --clr-text: #eceff4;
      --clr-text-muted: #d0d8e4;
      --clr-accent: #5fb3d4;
      --clr-accent-light: #2a4558;
      --clr-border: #4c566a;
      --clr-highlight: #fbbf24;
      --clr-outstanding: #f87171;
      --clr-header: rgba(46,52,64,.95);
      --clr-nav-mobile: rgba(46,52,64,.97);
    }
  }

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

  html { scroll-behavior: smooth; }

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

  a { color: var(--clr-accent); text-decoration: none; transition: color .2s; }
  a:hover { color: var(--clr-highlight); }

  /* ── Header ── */
  header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--clr-header);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--clr-border);
  }

  .header-inner {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 24px;
    height: var(--header-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .logo-area {
    display: flex;
    flex-direction: column;
    gap: 0;
    cursor: pointer;
  }

  .logo-area .name {
    font-family: var(--font-serif);
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--clr-text);
    letter-spacing: -0.02em;
  }

  .logo-area .tagline {
    font-size: 0.72rem;
    color: var(--clr-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-weight: 500;
  }

  nav { display: flex; gap: 4px; align-items: center; }

  nav a {
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--clr-text-muted);
    padding: 6px 12px;
    border-radius: 6px;
    transition: all .2s;
    letter-spacing: 0.01em;
  }

  nav a:hover, nav a.active {
    color: var(--clr-accent);
    background: var(--clr-accent-light);
  }

  .menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
  }

  .menu-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--clr-text);
    margin: 5px 0;
    transition: all .3s;
    border-radius: 2px;
  }

  /* ── Main ── */
  main {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 24px;
  }

  .page { display: none; padding: 48px 0 80px; }
  .page.active { display: block; animation: fadeIn .35s ease; }

  @keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

  h1 {
    font-family: var(--font-serif);
    font-size: 2.4rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--clr-text);
    margin-bottom: 32px;
    line-height: 1.2;
  }

  h2 {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin: 40px 0 16px;
    color: var(--clr-text);
  }

  h3 {
    font-family: var(--font-sans);
    font-size: 1.05rem;
    font-weight: 600;
    margin: 28px 0 10px;
    color: var(--clr-accent);
  }

  h4 {
    font-family: var(--font-sans);
    font-size: 0.95rem;
    font-weight: 600;
    margin: 20px 0 8px;
  }

  p { margin-bottom: 16px; color: var(--clr-text); }
  p.muted { color: var(--clr-text-muted); font-size: 0.92rem; }

  hr {
    border: none;
    height: 1px;
    background: var(--clr-border);
    margin: 36px 0;
  }

  /* ── Publications section scroll targets ── */
  #pub-journals, #pub-conferences, #pub-seminars, #pub-other {
    scroll-margin-top: calc(var(--header-h) + 16px);
  }

  /* ── Publications jump nav ── */
  .pub-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 20px 0 36px;
  }

  .pub-nav-btn {
    font-family: var(--font-sans);
    font-size: 0.82rem;
    font-weight: 600;
    padding: 6px 16px;
    border-radius: 20px;
    border: 1px solid var(--clr-accent);
    color: var(--clr-accent);
    background: transparent;
    cursor: pointer;
    transition: background .15s, color .15s;
  }

  .pub-nav-btn:hover {
    background: var(--clr-accent);
    color: #fff;
  }

  #publications hr {
    width: 100%;
    max-width: calc(var(--max-w) - 48px);
    margin: 40px 0;
  }

  /* ── Welcome page ── */
  .welcome-hero {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    align-items: center;
    min-height: 60vh;
  }

  .welcome-text h1 {
    font-size: 3rem;
    margin-bottom: 8px;
  }

  .welcome-text .greeting {
    font-family: var(--font-serif);
    font-size: 1.15rem;
    color: var(--clr-text-muted);
    margin-bottom: 24px;
    font-style: italic;
  }

  .welcome-text p { font-size: 1.05rem; line-height: 1.8; }

  .welcome-photo {
    display: flex;
    justify-content: center;
  }

  .welcome-photo img {
    width: 280px;
    height: 280px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--clr-border);
    box-shadow: 0 12px 40px rgba(0,0,0,.08);
  }

  .contact-card {
    margin-top: 40px;
    background: var(--clr-surface);
    border: 1px solid var(--clr-border);
    border-radius: 12px;
    padding: 28px 32px;
  }

  .contact-card h3 { margin-top: 0; }

  .stats-bar {
    margin-top: 40px;
    background: var(--clr-surface);
    border: 1px solid var(--clr-border);
    border-radius: 12px;
    padding: 28px 32px 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 32px;
    align-items: flex-end;
  }

  .stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 80px;
  }

  .stat-number {
    font-family: var(--font-serif);
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--clr-accent);
    line-height: 1;
  }

  .stat-label {
    font-size: 0.78rem;
    color: var(--clr-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-top: 6px;
    font-weight: 500;
  }

  .stat-source {
    margin-left: auto;
    font-size: 0.75rem;
    color: var(--clr-text-muted);
    align-self: flex-end;
    line-height: 1.5;
  }

  .stat-source a { font-size: 0.75rem; }

  .contact-card .contact-line {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 10px;
    font-size: 0.92rem;
    color: var(--clr-text-muted);
  }

  .contact-card .contact-line .icon {
    flex-shrink: 0;
    width: 18px;
    text-align: center;
    font-style: normal;
    color: var(--clr-accent);
  }

  /* ── Bio page ── */
  .bio-section {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .bio-section p { font-size: 0.95rem; }

  /* ── Outreach Web Cards ── */
  .outreach-heading {
    margin-top: 40px;
    margin-bottom: 16px;
  }

  .web-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }

  @media (max-width: 600px) {
    .web-grid { grid-template-columns: 1fr; }
  }

  .web-card {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--clr-border);
    border-radius: 10px;
    padding: 20px;
    text-decoration: none;
    color: var(--clr-text);
    background: var(--clr-surface);
    transition: box-shadow .2s, background .2s;
  }

  .web-card:hover {
    box-shadow: 0 4px 20px rgba(0,0,0,.07);
    background: var(--clr-bg);
  }

  .web-card-title {
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 8px;
    color: var(--clr-accent);
  }

  .web-card-desc {
    font-size: 0.86rem;
    line-height: 1.6;
    color: var(--clr-text-muted);
    flex: 1;
    margin-bottom: 14px;
  }

  .web-card-link {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--clr-accent);
  }

  /* ── Bio Timeline ── */
  .timeline {
    position: relative;
    margin: 32px 0;
  }

  .timeline::before {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    top: 6px;
    bottom: 0;
    width: 2px;
    background: var(--clr-border);
    z-index: 0;
  }

  .timeline-row {
    display: grid;
    grid-template-columns: 1fr 32px 1fr;
    margin-bottom: 32px;
    align-items: start;
  }

  .timeline-row:last-child { margin-bottom: 0; }

  .timeline-main {
    padding-right: 20px;
    text-align: right;
  }

  .timeline-center {
    display: flex;
    justify-content: center;
    padding-top: 5px;
    position: relative;
    z-index: 1;
  }

  .timeline-dot {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: var(--clr-bg);
    border: 2px solid var(--clr-border);
    flex-shrink: 0;
  }

  .timeline-row.fellowship .timeline-dot {
    width: 15px;
    height: 15px;
    background: var(--clr-accent);
    border-color: var(--clr-accent);
    box-shadow: 0 0 0 3px var(--clr-accent-light);
    margin-top: -2px;
  }

  .timeline-extra {
    padding-left: 20px;
  }

  .timeline-badge {
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 2px 9px;
    border-radius: 20px;
    background: var(--clr-accent);
    color: #fff;
    margin-bottom: 5px;
  }

  .timeline-date {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--clr-text-muted);
    margin-bottom: 3px;
  }

  .timeline-title {
    font-size: 0.97rem;
    font-weight: 600;
    margin-bottom: 2px;
  }

  .timeline-place {
    font-size: 0.84rem;
    color: var(--clr-text-muted);
    line-height: 1.5;
  }

  .timeline-extra-item {
    margin-bottom: 8px;
  }

  .timeline-extra-item:last-child { margin-bottom: 0; }

  .timeline-extra-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--clr-text-muted);
    margin-bottom: 2px;
  }

  .timeline-extra-title {
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 1px;
  }

  .timeline-extra-place {
    font-size: 0.82rem;
    color: var(--clr-text-muted);
  }

  @media (max-width: 620px) {
    .timeline::before { left: 11px; transform: none; }

    .timeline-row {
      grid-template-columns: 24px 1fr;
      grid-template-rows: auto auto;
    }

    .timeline-center { grid-column: 1; grid-row: 1; }

    .timeline-main {
      grid-column: 2; grid-row: 1;
      text-align: left;
      padding-right: 0;
      padding-left: 12px;
    }

    .timeline-extra {
      grid-column: 2; grid-row: 2;
      padding-left: 12px;
      margin-top: 8px;
    }
  }

  .bio-img {
    display: block;
    width: 100%;
    max-width: 240px;
    border-radius: 10px;
    box-shadow: 0 4px 16px rgba(0,0,0,.10);
    margin-top: 10px;
    margin-bottom: 16px;
  }

  /* ── Publications ── */
  .pub-entry {
    margin-bottom: 20px;
    padding-left: 16px;
    border-left: 3px solid var(--clr-accent-light);
    font-size: 0.92rem;
    line-height: 1.7;
  }

  .pub-entry strong { color: var(--clr-accent); }
  .pub-entry em { color: var(--clr-text-muted); }
  .pub-entry a { font-size: 0.85rem; }

  .pub-year {
    font-family: var(--font-serif);
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--clr-highlight);
    margin: 32px 0 16px;
    padding-bottom: 6px;
    border-bottom: 2px solid var(--clr-highlight);
    display: inline-block;
  }

  /* ── Conferences ── */
  .conf-entry {
    margin-bottom: 20px;
    padding-left: 16px;
    border-left: 3px solid var(--clr-accent-light);
    font-size: 0.92rem;
    line-height: 1.7;
  }

  .conf-entry strong { color: var(--clr-accent); }
  .conf-badge {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 2px 8px;
    border-radius: 4px;
    background: var(--clr-accent);
    color: #fff;
    margin-left: 6px;
  }

  .conf-badge.poster { background: var(--clr-highlight); }
  .conf-badge.invited {background: var(--clr-outstanding);}


  /* ── Datasets ── */
  .dataset-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 24px;
  }

  @media (max-width: 600px) {
    .dataset-grid { grid-template-columns: 1fr; }
  }

  .dataset-card {
    background: var(--clr-surface);
    border: 1px solid var(--clr-border);
    border-radius: 10px;
    padding: 16px 20px;
    transition: box-shadow .2s;
  }

  .dataset-card:hover { box-shadow: 0 4px 20px rgba(0,0,0,.06); }

  .dataset-card h3 {
    font-size: 0.95rem;
    margin-top: 0;
    margin-bottom: 4px;
    line-height: 1.4;
  }

  .dataset-card .project-period {
    font-size: 0.78rem;
    color: var(--clr-text-muted);
    margin-bottom: 8px;
  }

  .dataset-card p { font-size: 0.85rem; margin-bottom: 6px; }

  /* ── Code Repositories ── */
  .repo-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 24px;
  }

  @media (max-width: 600px) {
    .repo-grid { grid-template-columns: 1fr; }
  }

  .repo-card {
    border: 1px solid var(--clr-border);
    border-radius: 8px;
    padding: 16px;
    color: var(--clr-text);
    background: var(--clr-bg);
    transition: background .15s, box-shadow .15s;
    cursor: pointer;
  }

  .repo-card:hover {
    background: var(--clr-surface);
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
  }

  .repo-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
  }

  .repo-card-name {
    font-weight: 600;
    font-size: 0.88rem;
    color: var(--clr-accent);
  }

  .repo-card-desc {
    font-size: 0.82rem;
    color: var(--clr-text-muted);
    line-height: 1.5;
    margin: 0 0 12px;
  }

  .repo-card-doi {
    font-size: 0.78rem;
    margin: 0 0 10px;
  }

  .repo-card-meta {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 0.76rem;
    color: var(--clr-text-muted);
  }

  .repo-lang {
    display: flex;
    align-items: center;
    gap: 5px;
  }

  .lang-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
  }

  /* ── Projects ── */
  .project-card {
    background: var(--clr-surface);
    border: 1px solid var(--clr-border);
    border-radius: 12px;
    padding: 28px 32px;
    margin-bottom: 24px;
    transition: box-shadow .2s;
  }

  .project-card:hover { box-shadow: 0 4px 20px rgba(0,0,0,.06); }

  .project-card h3 {
    font-size: 1.15rem;
    margin-top: 0;
    margin-bottom: 4px;
  }

  .project-card .project-period {
    font-size: 0.82rem;
    color: var(--clr-text-muted);
    margin-bottom: 12px;
  }

  .project-card p { font-size: 0.92rem; margin-bottom: 10px; }

  .project-keywords {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 12px;
  }

  .project-keywords span {
    font-size: 0.75rem;
    padding: 3px 10px;
    border-radius: 20px;
    background: var(--clr-accent-light);
    color: var(--clr-accent);
    font-weight: 500;
  }

  /* ── Code ── */
  .code-card {
    background: var(--clr-surface);
    border: 1px solid var(--clr-border);
    border-radius: 12px;
    padding: 24px 28px;
    margin-bottom: 20px;
  }

  .code-card h3 { margin-top: 0; }
  .code-card p { font-size: 0.92rem; }

  .github-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: #24292e;
    color: #fff;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 28px;
    transition: background .2s;
  }

  .github-link:hover { background: #444; color: #fff; }

  /* ── Blog ── */
  .blog-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
  }

  .blog-card {
    background: var(--clr-surface);
    border: 1px solid var(--clr-border);
    border-radius: 12px;
    overflow: hidden;
    transition: box-shadow .2s, transform .2s;
    cursor: pointer;
    color: inherit;
  }

  .blog-card:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,.08);
    transform: translateY(-2px);
    color: inherit;
  }

  .blog-card-img {
    width: 100%;
    height: 180px;
    background: var(--clr-accent-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--clr-accent);
    overflow: hidden;
  }

  .blog-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .blog-card-body {
    padding: 20px;
  }

  .blog-card-body .blog-date {
    font-size: 0.78rem;
    color: var(--clr-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
  }

  .blog-card-body h3 {
    font-family: var(--font-serif);
    font-size: 1rem;
    color: var(--clr-text);
    margin: 0 0 8px;
    line-height: 1.4;
  }

  .blog-card-body p {
    font-size: 0.85rem;
    color: var(--clr-text-muted);
    margin: 0;
    line-height: 1.6;
  }

  /* ── Outreach ── */
  .outreach-item {
    margin-bottom: 32px;
  }

  .outreach-item h3 { margin-bottom: 8px; }
  .outreach-item p { font-size: 0.92rem; }

  /* ── Footer ── */
  footer {
    text-align: center;
    padding: 40px 24px;
    font-size: 0.82rem;
    color: var(--clr-text-muted);
    border-top: 1px solid var(--clr-border);
    margin-top: 40px;
  }

  .footer-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 16px;
  }

  .footer-links a {
    color: var(--clr-text-muted);
    transition: color .2s;
    display: flex;
  }

  .footer-links a:hover { color: var(--clr-accent); }
  .footer-links a[aria-label="ORCID"]:hover { color: #A6CE39; }
  .footer-links a[aria-label="GitHub"]:hover { color: #181717; }
  .footer-links a[aria-label="Google Scholar"]:hover { color: #4285F4; }

  /* ── Back to top ── */
  #back-to-top {
    position: fixed;
    bottom: 32px;
    right: 32px;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: none;
    background: var(--clr-accent);
    color: #fff;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s, background .2s;
    z-index: 200;
  }

  #back-to-top.visible { opacity: 1; pointer-events: auto; }
  #back-to-top:hover { background: var(--clr-highlight); }

  /* ── Responsive ── */
  @media (max-width: 768px) {
    .header-inner { height: 60px; }

    nav {
      position: fixed;
      top: 60px;
      left: 0;
      right: 0;
      background: var(--clr-nav-mobile);
      backdrop-filter: blur(12px);
      flex-direction: column;
      padding: 16px;
      gap: 4px;
      border-bottom: 1px solid var(--clr-border);
      transform: translateY(-120%);
      visibility: hidden;
      transition: transform .3s ease, visibility .3s;
      z-index: 99;
    }

    nav.open { transform: translateY(0); visibility: visible; }

    nav a { padding: 10px 16px; width: 100%; }

    .menu-toggle { display: block; }

    .welcome-hero {
      grid-template-columns: 1fr;
      gap: 32px;
      text-align: center;
    }

    .welcome-photo { order: -1; }
    .welcome-photo img { width: 200px; height: 200px; }
    .welcome-text h1 { font-size: 2.2rem; }

    .bio-img { max-width: 180px; }

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

    h1 { font-size: 1.8rem; }
    h2 { font-size: 1.3rem; }
  }

  @media (max-width: 480px) {
    .contact-card { padding: 20px; }
  }
