@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

  /* ==========================================================
     LDIS — variant B: swiss grid
     Content lives in the DATA section at the bottom.
     Publications can be loaded from a published Google Sheet
     (set PUBS_SHEET_URL) or from the inline PAPERS array.
     ========================================================== */
  :root {
    --ink: #0c0c0c;
    --ink-soft: #4a4a4a;
    --ink-faint: #909090;
    --paper: #ffffff;
    --paper-2: #f1f1ee;
    --line: #dcdcd8;
    --line-dark: #b8b8b2;
    --accent: #004191;
    --accent-soft: #e9f0f9;
    --maxw: 1020px;
  }
  * { margin: 0; padding: 0; box-sizing: border-box; }
  html { scroll-behavior: smooth; }
  html, body { max-width: 100%; overflow-x: hidden; }
  body {
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    color: var(--ink);
    background: var(--paper);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
  }
  ::selection { background: var(--accent-soft); }
  h1, h2, h3 { font-family: 'Inter', sans-serif; font-weight: 700; letter-spacing: -0.025em; }
  .mono { font-family: 'Inter', sans-serif; }
  .wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 28px; }
  a { color: inherit; text-decoration: none; }
  p a, .foot a { border-bottom: 1px solid var(--line-dark); transition: border-color .15s, color .15s; }
  p a:hover, .foot a:hover { color: var(--accent); border-color: var(--accent); }

  /* ---------- nav ---------- */
  nav {
    position: sticky; top: 0; z-index: 50;
    background: var(--accent);
    color: #fff;
    border-bottom: none;
  }
  .nav-inner { position: relative; display: flex; justify-content: space-between; height: 58px; align-items: center; }
  .brand { font-weight: 800; font-size: 18px; letter-spacing: -0.02em; color: #fff; }
  .brand span { color: rgba(255,255,255,.7); font-family: 'Inter', sans-serif; font-weight: 400; font-size: 11.5px; margin-left: 10px; letter-spacing: .02em; }
  .nav-links { display: flex; gap: 22px; font-size: 13px; font-weight: 500; color: rgba(255,255,255,.85); font-family: 'Inter', sans-serif; }
  .nav-links a:hover { color: #fff; }
  .nav-toggle {
    display: none; background: none; border: none; color: #fff;
    font-size: 32px; line-height: 1; padding: 9px 7px; cursor: pointer;
    font-family: 'Inter', sans-serif;
  }

  /* ---------- hero ---------- */
  header { padding: 84px 0 68px; border-bottom: 1px solid var(--line-dark); }
  .overline {
    font-family: 'Inter', sans-serif; font-size: 11.5px;
    letter-spacing: .16em; text-transform: uppercase; color: var(--accent);
    margin-bottom: 24px; display: block;
  }
  h1 { font-size: clamp(28px, 4.2vw, 32px); line-height: 1.1; max-width: 820px; }
  h1 em { font-style: normal; color: var(--accent); }
  .hero-sub { margin-top: 26px; font-size: 14px; color: var(--ink-soft); max-width: 620px; }
  .hero-note { margin-top: 32px; font-size: 13px; color: var(--ink-soft); font-family: 'Inter', sans-serif; }
  .hero-note a { color: var(--accent); border-bottom: 1px solid var(--accent); }

  /* ---------- home page: two-column layout (main + news sidebar) ---------- */
  .home-grid {
    max-width: 1240px; margin: 0 auto; padding: 0 28px;
    display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 56px;
    align-items: start;
  }
  .home-main { min-width: 0; }
  .home-hero { padding: 56px 0 44px; border-bottom: 1px solid var(--line-dark); }
  .home-main > section { padding: 44px 0; border-bottom: 1px solid var(--line-dark); }
  .home-main > section:last-child { border-bottom: none; }
  .home-sidebar { position: sticky; top: 78px; padding: 56px 0 44px; }
  .news-card { border: 1px solid var(--line-dark); background: #fff; padding: 24px 22px; }
  .news-card h3 {
    font-size: 11px; font-family: 'Inter', sans-serif; font-weight: 600;
    letter-spacing: .16em; text-transform: uppercase; color: var(--ink-faint); margin-bottom: 18px;
  }
  .news-card .news-item-sm { padding: 12px 0; border-bottom: 1px solid var(--line); }
  .news-card .news-item-sm:first-child { padding-top: 0; }
  .news-card .news-item-sm:last-child { border-bottom: none; padding-bottom: 0; }
  .news-date-sm { font-size: 11px; color: var(--accent); font-weight: 500; display: block; margin-bottom: 3px; }
  .news-text-sm { font-size: 13px; color: var(--ink-soft); line-height: 1.5; }
  .news-view-all {
    display: block; width: fit-content; margin-top: 20px;
    font-size: 12.5px; color: var(--accent); border-bottom: 1px solid var(--accent);
  }
  @media (max-width: 900px) {
    .home-grid { grid-template-columns: minmax(0, 1fr); }
    .home-sidebar { position: static; padding-top: 0; }
  }

  /* ---------- sections ---------- */
  section { padding: 68px 0; border-bottom: 1px solid var(--line-dark); }
  .sec-head { margin-bottom: 38px; }
  .kicker {
    font-family: 'Inter', sans-serif; font-size: 11px;
    letter-spacing: .16em; text-transform: uppercase; color: var(--ink-faint);
    display: block; margin-bottom: 10px;
  }
  h2 { font-size: clamp(20px, 2.6vw, 22px); }
  .sec-intro { margin-top: 14px; color: var(--ink-soft); max-width: 660px; font-size: 14px; }

  /* ---------- research explorer ---------- */
  .view-tabs { display: flex; margin: 32px 0 0; border: 1px solid var(--ink); width: fit-content; max-width: 100%; }
  .view-tabs button {
    font-family: 'Inter', sans-serif; font-size: 12px; font-weight: 500;
    padding: 10px 18px; background: transparent; border: none; cursor: pointer;
    color: var(--ink-soft); border-right: 1px solid var(--ink);
    transition: background .15s, color .15s; white-space: nowrap; letter-spacing: .03em;
  }
  .view-tabs button:last-child { border-right: none; }
  .view-tabs button:hover { color: var(--ink); background: var(--paper-2); }
  .view-tabs button.on { background: var(--ink); color: var(--paper); }
  .view { display: none; margin-top: 34px; }
  .view.on { display: block; animation: fade .3s ease; }
  @keyframes fade { from { opacity: 0; } to { opacity: 1; } }
  .view-caption { font-size: 12.5px; color: var(--ink-faint); margin-top: 14px; font-family: 'Inter', sans-serif; }

  /* domains */
  .domain-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; border: 1px solid var(--ink); }
  .domain {
    border-right: 1px solid var(--ink); padding: 26px 24px;
    cursor: pointer; transition: background .15s; background: var(--paper);
  }
  .domain:last-child { border-right: none; }
  .domain:hover { background: var(--paper-2); }
  .domain.sel { background: var(--accent-soft); box-shadow: inset 0 -3px 0 var(--accent); }
  .domain h3 { font-size: 16px; }
  .domain p { font-size: 12px; color: var(--ink-soft); margin-top: 8px; line-height: 1.55; }

  /* layers */
  .layer-stack { max-width: 600px; border: 1px solid var(--ink); }
  .layer {
    padding: 17px 22px; cursor: pointer;
    display: flex; align-items: baseline; gap: 18px; background: var(--paper);
    transition: background .15s; border-bottom: 1px solid var(--ink);
  }
  .layer:last-child { border-bottom: none; }
  .layer:hover { background: var(--paper-2); }
  .layer.sel { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
  .layer .lnum { font-family: 'Inter', sans-serif; font-size: 11px; color: var(--ink-faint); }
  .layer h3 { font-size: 16px; font-weight: 600; }
  .layer .lhint { margin-left: auto; font-size: 11.5px; color: var(--ink-faint); font-family: 'Inter', sans-serif; }

  /* venn + axes */
  .diagram-box { display: flex; justify-content: center; padding: 10px 0; }
  .diagram-box svg { max-width: 440px; width: 100%; height: auto; }
  .venn-circle { fill: rgba(0,65,145,.05); stroke: var(--ink-soft); stroke-width: 1.6; cursor: pointer; transition: fill .2s, stroke .2s; }
  .venn-g:hover .venn-circle { fill: rgba(0,65,145,.12); stroke: var(--accent); }
  .venn-g.sel .venn-circle { fill: rgba(0,65,145,.17); stroke: var(--accent); stroke-width: 2.8; }
  .venn-label { font-family: 'Inter', sans-serif; font-weight: 600; font-size: 24px; fill: var(--ink); cursor: pointer; }
  .venn-g.sel .venn-label { fill: var(--accent); }
  .venn-highlight { fill: var(--accent); fill-opacity: .22; stroke: var(--accent); stroke-width: 2.1; pointer-events: none; }
  .axis-g { cursor: pointer; }
  .axis-line { stroke: var(--ink); stroke-width: 1.8; transition: stroke .2s; }
  .axis-hit { stroke: transparent; stroke-width: 22; }
  .axis-g:hover .axis-line, .axis-g.sel .axis-line { stroke: var(--accent); stroke-width: 2.8; }
  .axis-label { font-family: 'Inter', sans-serif; font-weight: 600; font-size: 22px; fill: var(--ink); }
  .axis-sub { font-family: 'Inter', sans-serif; font-size: 14px; fill: var(--ink-faint); }
  .axis-g:hover .axis-label, .axis-g.sel .axis-label { fill: var(--accent); }

  /* clickable subtype points along each axis (e.g. "Relation", "GPU") —
     the real unit papers are tagged with; see files/topics.js. */
  .axis-point { cursor: pointer; }
  .axis-point circle { fill: var(--paper); stroke: var(--ink-soft); stroke-width: 1.4; transition: fill .15s, stroke .15s; }
  .axis-point:hover circle { fill: var(--accent-soft); stroke: var(--accent); }
  .axis-point.sel circle { fill: var(--accent); stroke: var(--accent); }
  .axis-point text {
    font-family: 'Inter', sans-serif; font-size: 15px; fill: var(--ink-soft);
    transition: fill .15s;
  }
  .axis-point:hover text, .axis-point.sel text { fill: var(--accent); }
  .axis-point.sel text { font-weight: 600; }

  /* detail panel */
  .topic-detail { margin-top: 38px; border: 1px solid var(--ink); padding: 30px 32px; background: #fff; animation: fade .3s ease; }
  .topic-detail[hidden] { display: none; }
  .topic-detail h3 { font-size: 23px; }
  .topic-detail .t-tag { font-family: 'Inter', sans-serif; font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); display: block; margin-bottom: 8px; }
  .topic-detail > p { margin-top: 13px; color: var(--ink-soft); max-width: 700px; font-size: 14.5px; }
  .topic-examples { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 14px; }
  .topic-examples:empty { display: none; margin-top: 0; }
  .topic-papers { margin-top: 26px; }
  .topic-papers h4 { font-family: 'Inter', sans-serif; font-size: 11px; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-faint); margin-bottom: 10px; }
  .tp-empty { font-size: 13.5px; color: var(--ink-faint); }

  /* ---------- publications ---------- */
  .pub-item {
    padding: 17px 0; border-bottom: 1px solid var(--line);
    display: grid; grid-template-columns: 110px 1fr; gap: 22px; align-items: baseline;
  }
  .pub-item:last-child { border-bottom: none; }
  .pub-venue { font-family: 'Inter', sans-serif; font-size: 12px; color: var(--accent); font-weight: 500; }
  .pub-title { font-weight: 600; font-size: 15px; line-height: 1.45; }
  .pub-highlight {
    font-family: 'Inter', sans-serif; font-size: 10px; font-weight: 500;
    letter-spacing: .06em; text-transform: uppercase; color: var(--accent);
    background: var(--accent-soft); padding: 2px 8px; margin-left: 6px; white-space: nowrap;
  }
  .pub-authors { font-size: 13px; color: var(--ink-soft); margin-top: 3px; }
  .pub-authors u { text-decoration: none; color: var(--ink); }
  .pub-meta { margin-top: 6px; display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
  .pub-meta a { font-size: 12px; color: var(--accent); font-family: 'Inter', sans-serif; border-bottom: 1px solid transparent; }
  .pub-meta a:hover { border-color: var(--accent); }
  .pub-tags { display: flex; gap: 14px; flex-wrap: wrap; }
  .ptag { font-family: 'Inter', sans-serif; font-size: 10px; color: var(--ink-faint); border: 1px solid var(--line-dark); padding: 2px 7px; }
  .tag-group { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
  .tag-group-label {
    font-family: 'Inter', sans-serif; font-size: 9.5px; font-weight: 500;
    letter-spacing: .08em; text-transform: uppercase; color: var(--ink-faint);
  }

  /* homepage publications preview — items link through to publications.html */
  .pub-item.clickable { cursor: pointer; transition: background .15s; margin: 0 -12px; padding-left: 12px; padding-right: 12px; }
  .pub-item.clickable:hover { background: var(--paper-2); }
  .pub-view-all { margin-top: 22px; }
  .pub-view-all a {
    font-family: 'Inter', sans-serif; font-size: 13px; font-weight: 500;
    color: var(--accent); border-bottom: 1px solid var(--accent);
  }
  .pub-view-all a:hover { opacity: .75; }

  /* ---------- news ---------- */
  .news-item { display: grid; grid-template-columns: 110px 1fr; gap: 22px; padding: 12px 0; border-bottom: 1px solid var(--line); align-items: baseline; }
  .news-item:last-child { border-bottom: none; }
  .news-date { font-family: 'Inter', sans-serif; font-size: 12px; color: var(--ink-faint); }
  .news-item p { font-size: 14.5px; }

  /* ---------- people ---------- */
  .prof { display: flex; gap: 30px; align-items: flex-start; max-width: 720px; }
  .prof-photo {
    width: 104px; height: 104px; flex-shrink: 0;
    background: var(--paper-2); border: 1px solid var(--ink);
    display: grid; place-items: center;
    font-weight: 800; font-size: 32px; color: var(--ink-faint);
    overflow: hidden;
  }
  .prof-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
  .prof h3 { font-size: 20px; }
  .prof .role { font-size: 13px; color: var(--accent); margin-top: 2px; font-weight: 500; font-family: 'Inter', sans-serif; }
  .prof .bio { margin-top: 12px; font-size: 14px; color: var(--ink-soft); }
  .bio-history { margin: 0; padding: 0; list-style: none; }
  .bio-history li {
    font-size: 12.5px; color: var(--ink-soft); line-height: 1.7;
    font-family: 'Inter', sans-serif;
  }
  .bio-contact { margin-top: 10px; font-size: 14px; color: var(--ink-soft); }
  .bio-links { margin-top: 6px; font-size: 14px; color: var(--ink-soft); }
  .recruit-line { margin-top: 32px; padding: 18px 22px; border: 1px solid var(--ink); font-size: 14px; color: var(--ink-soft); max-width: 720px; background: #fff; }

  /* ---------- join ---------- */
  #join p { max-width: 700px; }
  #join p { color: var(--ink-soft); margin-top: 16px; font-size: 14.5px; }
  #join p strong { color: var(--ink); }
  .join-cta { margin-top: 28px; }
  .join-cta a {
    display: inline-block; border: 1.5px solid var(--ink); padding: 11px 26px;
    font-weight: 600; font-size: 13.5px; font-family: 'Inter', sans-serif;
    transition: background .15s, color .15s;
  }
  .join-cta a:hover { background: var(--ink); color: var(--paper); }

  /* ---------- footer ---------- */
  footer { padding: 40px 0 36px; }
  .foot { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 16px; font-size: 12.5px; color: var(--ink-soft); font-family: 'Inter', sans-serif; }
  .foot .brand { font-size: 15px; font-family: 'Inter', sans-serif; }

  /* Below this width the nav links no longer fit in one row next to the
     brand, so they're hidden behind a hamburger button (.nav-toggle) and
     shown as a full-width dropdown instead — see files/nav.js for the
     open/close logic. */
  @media (max-width: 820px) {
    .nav-toggle { display: block; }
    .nav-links {
      display: none; position: absolute; left: 0; right: 0; top: 100%;
      flex-direction: column; gap: 0; background: var(--accent);
      box-shadow: 0 10px 18px rgba(0,0,0,.18);
    }
    .nav-links.open { display: flex; }
    .nav-links a { padding: 14px 28px; width: 100%; border-top: 1px solid rgba(255,255,255,.12); }
  }

  @media (max-width: 480px) {
    .brand span { display: none; }
  }

  @media (max-width: 760px) {
    .domain-row { grid-template-columns: 1fr; }
    .domain { border-right: none; border-bottom: 1px solid var(--ink); }
    .domain:last-child { border-bottom: none; }
    .pub-item, .news-item { grid-template-columns: 1fr; gap: 3px; }
    .prof { flex-direction: column; }
    header { padding: 58px 0 48px; }
    section { padding: 52px 0; }
    .view-tabs { width: 100%; overflow-x: auto; }
  }

  .hero-sub strong { color: var(--ink); font-weight: 600; }

  /* ---------- projects & teaching accordions (shared) ---------- */
  .acc {
    border: 1px solid var(--line-dark); border-radius: var(--radius, 0);
    background: var(--card, var(--paper)); overflow: hidden;
  }
  .acc + .acc { margin-top: 12px; }
  .acc-head {
    width: 100%; display: flex; align-items: center; gap: 16px;
    padding: 18px 22px; cursor: pointer; background: none; border: none;
    text-align: left; font-family: inherit; color: inherit; font-size: inherit;
    transition: background .15s;
  }
  .acc-head:hover { background: var(--paper-2); }
  .acc.on > .acc-head { border-bottom: 1px solid var(--line); }
  .acc-title { font-weight: 600; font-size: 15.5px; flex: 1; line-height: 1.4; }
  .acc-meta { font-family: 'Inter', sans-serif; font-size: 11.5px; color: var(--ink-faint); white-space: nowrap; }
  .badge {
    font-family: 'Inter', sans-serif; font-size: 10.5px; font-weight: 500;
    letter-spacing: .08em; text-transform: uppercase;
    padding: 4px 10px; border-radius: var(--radius, 0); white-space: nowrap;
  }
  .b-ongoing { color: var(--accent); background: var(--accent-soft); }
  .b-open { color: var(--card, var(--paper)); background: var(--accent); }
  .b-code { color: var(--ink-soft); border: 1px solid var(--line-dark); }
  .chev {
    font-family: 'Inter', sans-serif; font-size: 16px; color: var(--ink-faint);
    transition: transform .25s ease; line-height: 1;
  }
  .acc.on .chev { transform: rotate(45deg); color: var(--accent); }
  .acc-body { display: none; padding: 4px 22px 26px; }
  .acc.on .acc-body { display: block; animation: fade .3s ease; }
  .p-field { margin-top: 18px; }
  .p-field h5 {
    font-family: 'Inter', sans-serif; font-size: 10.5px; font-weight: 500;
    letter-spacing: .13em; text-transform: uppercase; color: var(--ink-faint);
    margin-bottom: 6px;
  }
  .p-field p { font-size: 14.5px; color: var(--ink-soft); max-width: 720px; line-height: 1.65; }
  .ask { font-style: italic; color: var(--ink-faint) !important; }
  .p-note { margin-top: 20px; font-size: 14px; color: var(--ink-soft); }
  .p-note a { color: var(--accent); border-bottom: 1px solid var(--accent); }
  .syll-link {
    display: inline-block; margin-top: 18px; border: 1.5px solid var(--accent);
    color: var(--accent); padding: 9px 20px; border-radius: var(--radius, 0);
    font-size: 13.5px; font-weight: 600; transition: background .15s, color .15s;
  }
  .syll-link:hover { background: var(--accent); color: var(--card, #fff); }

  :root { --radius: 0px; }
