/* Public site styles. Area colours (--area-<id>) are emitted by base.html from site.yaml. */
:root {
  --navy: #0f1724;
  --navy-2: #24344d;
  --navy-rule: #34476a;
  --bg: #f4f6f9;
  --text: #1a2433;
  --muted: #5b6b82;
  --on-navy: #e6ebf2;
  --on-navy-muted: #a9b8cc;
  --link: #1f6fa8;
  --link-on-navy: #7fd8f5;
  --card: #fff;
  --rule: #e3e8ef;
  --radius: 10px;
  --shadow: 0 2px 8px #0f172414;
  --shadow-hover: 0 8px 18px #0f172422;
  --accent: #4cc9f0;
  --stripe: #6c7a90;
  --chip: #6c7a90;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
}
img, video, svg { max-width: 100%; }
a { color: var(--link); }
h1, h2, h3 { line-height: 1.2; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 28px; }
[data-area] { transition: opacity .2s; }
[hidden] { display: none !important; }

/* Header */
.site-header { background: var(--navy); color: var(--on-navy); }
.header-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 14px; padding-bottom: 14px; }
.who { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.who .avatar { width: 40px; height: 40px; border-radius: 50%; background: #2a3a52; object-fit: cover; }
.who b { display: block; color: #fff; font-size: 16px; }
.who small { display: block; color: var(--on-navy-muted); font-size: 12px; }
.site-nav { display: flex; gap: 20px; }
.site-nav a { color: #9fb0c6; text-decoration: none; font-size: 14px; padding-bottom: 3px; border-bottom: 2px solid transparent; }
.site-nav a:hover { color: #fff; }
.site-nav a[aria-current="page"] { color: #fff; border-bottom-color: var(--accent); }
.menu-button { display: none; background: transparent; color: #fff; border: 1px solid #34476a; border-radius: 6px; padding: 6px 12px; font: inherit; cursor: pointer; }

/* Main and footer */
.site-main { padding: 24px 0 40px; }
.site-footer { color: var(--muted); font-size: 13px; padding: 18px 0 30px; border-top: 1px solid var(--rule); }
.site-footer .wrap { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.site-footer .social a { margin-left: 14px; color: var(--muted); }

/* Building blocks */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
a.card, .card.lift { transition: transform .2s, box-shadow .2s, opacity .2s; }
a.card:hover, .card.lift:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }
a.card { display: block; color: inherit; text-decoration: none; }
.pad { padding: 18px 22px; }
.stripe { height: 4px; background: var(--stripe); }
.chip {
  display: inline-block; font-size: 11px; font-weight: 600; line-height: 1.6;
  padding: 1px 9px; border-radius: 10px; margin: 0 4px 4px 0;
  background: color-mix(in srgb, var(--chip) 18%, transparent);
  color: color-mix(in srgb, var(--chip) 55%, var(--text));
  border: 1px solid color-mix(in srgb, var(--chip) 45%, transparent);
}
button.chip { cursor: pointer; font-family: inherit; }
button.chip[aria-pressed="false"] { background: transparent; opacity: .55; }
.kicker { font-size: 11px; text-transform: uppercase; letter-spacing: .8px; color: var(--muted); font-weight: 600; }
.btn {
  display: inline-block; font: 600 13px/1 Inter, sans-serif; padding: 9px 14px; border-radius: 7px;
  background: var(--accent); color: var(--navy); text-decoration: none; border: 0; cursor: pointer;
}
.btn.ghost { background: transparent; color: inherit; border: 1px solid currentColor; }
.btn.small { padding: 5px 9px; font-size: 12px; }
.page h1 { margin: 6px 0 18px; }
.prose { max-width: 760px; }
.prose::after { content: ""; display: block; clear: both; }

/* Markdown attribute utilities */
.left { float: left; width: 40%; margin: 4px 20px 12px 0; }
.right { float: right; width: 40%; margin: 4px 0 12px 20px; }
.full { display: block; width: 100%; }
.w-25 { width: 25%; } .w-33 { width: 33.333%; } .w-40 { width: 40%; } .w-50 { width: 50%; }
.prose img { border-radius: 6px; height: auto; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; margin: 16px 0; }
.gallery p { display: contents; }
.gallery img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 4 / 3; }
.figure-row { display: flex; gap: 12px; margin: 16px 0; }
.figure-row p { display: contents; }
.figure-row img { flex: 1; min-width: 0; object-fit: cover; }
.custom-block { margin: 18px 0; clear: both; }
.custom-block.missing { padding: 12px; border: 2px dashed #f72585; color: #a0144f; border-radius: 6px; }

/* Contact */
.contact-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; align-items: start; }
.contact h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); margin: 14px 0 4px; }
.contact h2:first-child { margin-top: 0; }
.contact address { font-style: normal; }
.profiles { list-style: none; padding: 0; margin: 0; }
.profiles li { padding: 6px 0; border-bottom: 1px solid var(--rule); }
.profiles li:last-child { border-bottom: 0; }

@media (max-width: 760px) {
  .wrap { padding: 0 16px; }
  .menu-button { display: block; }
  .header-bar { flex-wrap: wrap; }
  .site-nav { display: none; width: 100%; flex-direction: column; gap: 0; }
  .site-nav.open { display: flex; }
  .site-nav a { padding: 10px 0; border-bottom: 1px solid #22314a; }
  .site-nav a[aria-current="page"] { border-bottom-color: var(--accent); }
  .no-js .site-nav { display: flex; }
  .contact-grid { grid-template-columns: 1fr; }
  .left, .right { float: none; width: 100%; margin: 12px 0; }
  .w-25, .w-33, .w-40, .w-50 { width: 100%; }
  .figure-row { flex-direction: column; }
}

/* Hero and chart */
.hero { display: grid; grid-template-columns: 1fr 1.3fr; gap: 28px; align-items: end; padding-top: 10px; padding-bottom: 28px; }
.hero h1 { color: #fff; font-size: 30px; margin: 0 0 12px; font-weight: 700; }
.hero .intro { color: #b5c2d4; }
.hero .intro p { margin: 0 0 8px; }
.hero .intro a { color: var(--link-on-navy); }
.chart { margin: 0; text-align: right; }
.chart-caption { font-size: 12px; color: #8a9bb3; margin-bottom: 4px; }
.chart-legend { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 2px 4px; margin-bottom: 6px; }
.chart-legend button { background: none; border: 0; color: #a9b8cc; font: 12px Inter, sans-serif; cursor: pointer; padding: 2px 6px; border-radius: 4px; }
.chart-legend button:hover, .chart-legend button:focus-visible { color: #fff; background: #ffffff14; }
.chart-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
.chart svg { display: block; height: auto; max-height: 170px; }
.chart-label { fill: #8a9bb3; font-size: 9px; font-family: Inter, sans-serif; }
.chart-range { fill: #ffffff1c; stroke: #ffffff55; stroke-dasharray: 3 2; }
.chart-year:hover .chart-hit { fill: #ffffff0d; }
.chart noscript, .chart .chart-fallback { color: #8a9bb3; font-size: 12px; }

/* Home bento */
.bento { display: grid; grid-template-columns: 1.6fr 1fr 1fr; grid-template-rows: auto auto; gap: 14px; }
.bento .featured { display: contents; }
.news-card { grid-row: span 2; background: var(--navy-2); color: #fff; padding: 6px 18px 12px; }
.news-card .kicker { color: var(--on-navy-muted); display: flex; justify-content: space-between; margin: 12px 0 6px; }
.news-card .kicker a { color: var(--link-on-navy); text-transform: none; letter-spacing: 0; text-decoration: none; font-weight: 500; }
.news-item { display: grid; grid-template-columns: 58px 1fr; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--navy-rule); color: inherit; text-decoration: none; }
.news-item:last-child { border-bottom: 0; }
.news-item:hover b { text-decoration: underline; }
.news-item .thumb { width: 58px; height: 42px; border-radius: 5px; border-left: 4px solid var(--stripe); object-fit: cover; background: repeating-linear-gradient(45deg, #ffffff14, #ffffff14 6px, #ffffff24 6px, #ffffff24 12px); }
.news-item time { display: block; font-size: 11px; color: var(--on-navy-muted); }
.news-item b { font-size: 13.5px; font-weight: 600; }
.project-card .thumb { display: block; width: 100%; height: 120px; object-fit: cover; }
.thumb.placeholder { background: repeating-linear-gradient(45deg, #dde3ea, #dde3ea 6px, #e8edf3 6px, #e8edf3 12px); }
.project-card .body { padding: 10px 14px 14px; font-size: 13px; color: #4a5a70; }
.project-card h3 { font-size: 15px; color: var(--text); margin: 0 0 3px; }
.project-card p { margin: 0; }
.empty { color: var(--muted); }

@media (max-width: 760px) {
  .hero { grid-template-columns: 1fr; }
  .hero h1 { font-size: 24px; }
  .bento { grid-template-columns: 1fr; }
  .news-card { grid-row: auto; }
}

/* Publications */
.no-js .js-only { display: none !important; }
.pubs-layout { display: grid; grid-template-columns: 200px 1fr; gap: 24px; align-items: start; }
.pub-filters { position: sticky; top: 14px; }
.pub-filters .kicker { margin: 16px 0 6px; font-size: 11px; }
.pub-filters .kicker:first-of-type { margin-top: 0; }
.filters-toggle { display: none; }
.pub-search { width: 100%; padding: 7px 10px; border: 1px solid #d5dce6; border-radius: 7px; font: inherit; font-size: 13px; background: #fff; }
.area-chips .chip { font-size: 11.5px; padding: 3px 10px; }
.dd { position: relative; }
.dd > summary { list-style: none; display: flex; justify-content: space-between; align-items: center; padding: 6px 10px; border: 1px solid #d5dce6; border-radius: 7px; background: #fff; font-size: 13px; cursor: pointer; }
.dd > summary::-webkit-details-marker { display: none; }
.dd > summary::after { content: "▾"; color: #8a97a8; margin-left: 6px; }
.dd > summary.active { border-color: var(--navy-2); box-shadow: inset 0 0 0 1px var(--navy-2); font-weight: 600; }
.dd .menu { position: absolute; z-index: 5; left: 0; right: -40px; top: calc(100% + 4px); background: #fff; border: 1px solid #d5dce6; border-radius: 8px; box-shadow: 0 8px 20px #0f172422; padding: 6px; }
.dd .menu label { display: flex; align-items: center; gap: 7px; padding: 4px 6px; border-radius: 5px; font-size: 13px; cursor: pointer; }
.dd .menu label:hover { background: var(--bg); }
.dd .menu .n { margin-left: auto; color: #8a97a8; font-size: 12px; }
.dd .menu .grp { font-size: 10px; text-transform: uppercase; letter-spacing: .6px; color: #8a97a8; padding: 6px 6px 2px; }
.dd .menu .links { display: flex; justify-content: space-between; border-top: 1px solid #eef1f5; margin-top: 4px; padding: 6px 6px 2px; font-size: 12px; }
.switch { display: flex; gap: 6px; align-items: center; font-size: 13px; cursor: pointer; }
.pubs-chart { background: var(--navy-2); padding: 12px 14px 6px; margin: 0 0 10px; }
.pubs-chart .chart-caption { color: var(--on-navy-muted); text-align: left; }
.pub-status { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); margin: 6px 0 4px; }
.pub-list h2.year { font-size: 17px; margin: 18px 0 8px; }
.pub { display: grid; grid-template-columns: 54px 1fr; gap: 14px; background: var(--card); border-radius: 8px; padding: 12px 14px; margin-bottom: 8px; box-shadow: 0 1px 3px #0f172412; border-left: 4px solid var(--stripe); scroll-margin-top: 16px; }
.pub:target { box-shadow: 0 0 0 2px var(--accent), var(--shadow); }
.pub .cover { width: 54px; height: auto; max-height: 76px; object-fit: cover; object-position: top; border: 1px solid #dde3ea; box-shadow: 1px 1px 0 #dde3ea, 2px 2px 0 #eef1f5; background: #fff; }
.pub .cover.blank { display: block; height: 70px; background: repeating-linear-gradient(180deg, #fff, #fff 6px, #eef1f5 6px, #eef1f5 8px); }
.pub .title { font-size: 14.5px; margin: 0 0 2px; font-weight: 600; }
.pub .title a { color: var(--text); text-decoration: none; }
.pub .title a:hover { text-decoration: underline; }
.pub .authors { font-size: 13px; color: #4a5a70; }
.pub .authors strong { color: var(--text); }
.pub .venue { font-size: 13px; color: #4a5a70; font-style: italic; }
.pub .acts { margin-top: 7px; display: flex; gap: 6px; flex-wrap: wrap; align-items: flex-start; }
.btn.soft { background: #eef2f7; color: #1f4f7a; }
.btn.soft:hover { background: #e1e8f1; }
.badge { font-size: 11px; font-weight: 700; padding: 4px 8px; border-radius: 5px; line-height: 1; }
.badge.rank { background: var(--navy-2); color: #fff; }
.badge.rank.q { background: #e6edf6; color: var(--navy-2); }
.badge.award { background: #fff4d6; color: #8a5a00; }
.bibtex summary { list-style: none; }
.bibtex summary::-webkit-details-marker { display: none; }
.bibtex[open] { flex-basis: 100%; }
.bibtex pre { font-size: 11.5px; background: #f6f8fb; border: 1px solid var(--rule); border-radius: 6px; padding: 10px; overflow: auto; white-space: pre-wrap; margin: 6px 0 0; }
.pub .tags { margin-top: 6px; }
.proj-link { font-size: 12px; margin-right: 10px; }

@media (max-width: 760px) {
  .pubs-layout { grid-template-columns: 1fr; }
  .pub-filters { position: static; }
  .filters-toggle { display: inline-block; }
  .filters-panel { display: none; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px; margin-top: 10px; }
  .filters-open .filters-panel { display: block; }
  .no-js .filters-panel { display: none; }
  .pub { grid-template-columns: 42px 1fr; gap: 10px; }
  .pub .cover { width: 42px; }
}

/* Projects list */
.list-filters { margin: 0 0 16px; display: flex; flex-wrap: wrap; align-items: center; }
.list-filters .chip { font-size: 12px; padding: 3px 11px; }
.list-filters button.chip[aria-pressed="false"] { background: #fff; opacity: 1; color: var(--muted); border-color: #d5dce6; }
.list-filters .sep { width: 1px; height: 20px; background: #d5dce6; margin: 0 10px 4px 6px; }
.project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.project-grid .project-card .thumb { height: 150px; }

/* Project page */
.project-hero { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; align-items: center; padding-top: 6px; padding-bottom: 34px; }
.breadcrumb { font-size: 12px; color: var(--on-navy-muted); margin-bottom: 10px; }
.breadcrumb a { color: var(--link-on-navy); text-decoration: none; }
.project-hero .meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.project-hero .chip { color: #fff; background: color-mix(in srgb, var(--chip) 30%, transparent); }
.project-hero .chip.kind { --chip: #a9b8cc; }
.project-hero .years { font-size: 12px; color: var(--on-navy-muted); margin: 0 0 4px 6px; }
.project-hero h1 { color: #fff; font-size: 34px; margin: 10px 0 8px; }
.project-hero .hook { color: #c9d4e3; font-size: 17px; margin: 0 0 18px; }
.project-hero .buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.project-hero .btn.ghost { color: #fff; border-color: #ffffff55; }
.project-hero .visual img, .project-hero .visual video { display: block; width: 100%; max-height: 360px; object-fit: cover; border-radius: var(--radius); box-shadow: 0 10px 30px #0008; }
.project-hero .visual .custom-block { background: #fff; color: var(--text); border-radius: var(--radius); padding: 10px; margin: 0; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin: -18px 0 20px; position: relative; }
.fact { padding: 14px 16px; border-top: 4px solid var(--stripe); }
.fact b { display: block; font-size: 26px; line-height: 1.1; }
.fact span { color: var(--muted); font-size: 13px; }
.project-layout { display: grid; grid-template-columns: 1fr 300px; gap: 20px; align-items: start; }
.story { max-width: none; padding: 22px 28px; }
.story h2 { font-size: 20px; margin-top: 1.4em; }
.story > :first-child, .story > h2:first-child { margin-top: 0; }
.fold-toggle { margin-top: 10px; color: var(--link); }
.project-side { display: grid; gap: 14px; }
.project-side .kicker { margin: 0 0 8px; }
.member { display: flex; gap: 10px; align-items: center; padding: 5px 0; }
.member img, .member .nophoto { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; flex: none; }
.member .nophoto { display: grid; place-items: center; background: #e6edf6; color: var(--navy-2); font-weight: 700; }
.member .name { font-weight: 600; color: var(--text); text-decoration: none; display: block; font-size: 14px; }
.member small, .paper small { display: block; color: var(--muted); font-size: 12px; }
.paper { padding: 7px 0; border-bottom: 1px solid var(--rule); font-size: 13.5px; }
.paper:last-child { border-bottom: 0; }
.paper a { font-weight: 600; text-decoration: none; }
.paper .badge { display: inline-block; margin-top: 4px; }
.funding img { max-height: 48px; margin: 4px 10px 4px 0; }

@media (max-width: 760px) {
  .project-hero { grid-template-columns: 1fr; }
  .project-hero h1 { font-size: 26px; }
  .facts { margin-top: 0; padding-top: 16px; }
  .project-layout { grid-template-columns: 1fr; }
  .story { padding: 18px; }
}

/* News */
.news-list h2 { font-size: 18px; margin: 22px 0 10px; }
.news-list section:first-child h2 { margin-top: 0; }
article.news { display: grid; grid-template-columns: 200px 1fr; gap: 0; margin-bottom: 12px; border-left: 4px solid var(--stripe); scroll-margin-top: 16px; }
article.news:not(:has(.news-image)) { grid-template-columns: 1fr; }
article.news:target { box-shadow: 0 0 0 2px var(--accent), var(--shadow); }
.news-image { width: 100%; height: 100%; max-height: 180px; object-fit: cover; }
.news-body { padding: 14px 18px; }
.news-body h3 { margin: 2px 0 6px; font-size: 16px; }
.news-body .prose p { margin: 0 0 8px; }
.news-links a { font-size: 13px; margin-right: 14px; }

@media (max-width: 760px) {
  article.news { grid-template-columns: 1fr; }
  .news-image { max-height: 200px; }
}
