@font-face { font-family: "Albert Sans"; src: url("fonts/AlbertSans.ttf") format("truetype"); font-weight: 400 500; font-display: swap; }
:root {
  --bg: #f5f6f2;
  --panel: #ffffff;
  --ink: #111111;
  --muted: #6b6b6b;      /* 4.9:1 on --bg, 5.3:1 on --panel */
  --accent: #ff5f1f;     /* marks only what is selected */

  --s1: 6px;
  --s2: 12px;
  --s3: 24px;
  --s4: 48px;
  --s5: 96px;

  --text: 16px;
  --lh: 1.45;

  --panel-w: 410px;
  --bp: 1200px;  /* set by the page script: the narrowest window that fits map, gap and panel side by side */
  /* side margins grow from 48 px at --bp to their full size (130 and 175 px, as at 1440) on wider windows */
  --panel-right: clamp(48px, calc(48px + (100vw - var(--bp)) / 2), 175px);
  --panel-top: 100px;
  --map-left: clamp(48px, calc(48px + (100vw - var(--bp)) / 2), 130px);
  --map-top: 150px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Albert Sans", "Helvetica Neue", Helvetica, sans-serif;
  font-size: var(--text);
  line-height: var(--lh);
  letter-spacing: -0.01em;
}
a { color: var(--ink); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
p, ul { margin: 0; padding: 0; }
li { list-style: none; }
.muted, .muted a { color: var(--muted); }

/* ---------- map (left) + panel (right) ---------- */
.page {
  display: grid;
  grid-template-columns: 1fr var(--panel-w);
  padding-right: var(--panel-right);
  height: 100vh;
}
.map-zone { position: relative; }
.switch { position: absolute; left: var(--map-left); top: var(--panel-top); width: calc(var(--ext, 600) * 1px);  /* as wide as the map's real extent (set by the page script) */ display: flex; flex-wrap: wrap; column-gap: var(--s3); }
/* the Highlights only filter: not a fourth view, so it sits apart, at the right end of the map; plain text like the views.
   Off: muted and underlined like a view you can switch to; on: ink, underlined in the accent */
.switch .only { margin-left: auto; padding: 0; border: 0; background: none; font: inherit; letter-spacing: inherit; cursor: pointer;
  color: var(--muted); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; }
.switch .only[aria-pressed="true"] { color: var(--ink); text-decoration-color: var(--accent); text-decoration-thickness: 2px; }
.switch .help { flex-basis: 100%; font-size: 14px; margin-top: var(--s1); }
.switch { align-items: baseline; }
.switch .mr { white-space: nowrap; font-size: 14px; color: var(--muted); }  /* "My Research": the name over the five views, a muted lead like "Previously" in the panel */
@media (max-width: 480px) { .switch .mr { flex-basis: 100%; } }  /* phones: on its own line, so the views wrap no worse */
.switch .only:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.who { display: none; }  /* phones: the name above the map; on wide screens it is in the panel */
.switch a { color: var(--muted); }
.switch a.cur { color: var(--ink); text-decoration: none; }
/* every length in the map is in a 600 x 520 space, times --k (1 on wide screens, smaller on phones) */
.map { --k: 1; position: absolute; left: var(--map-left); top: var(--map-top); width: calc(600px * var(--k)); height: calc(520px * var(--k)); }

/* one point = one paper, in the page once; a view only sets its --x and --y */
.pt { position: absolute; left: 0; top: 0; width: 24px; height: 24px; z-index: 1;
  transform: translate(calc(var(--x) * var(--k) * 1px - 12px), calc(var(--y) * var(--k) * 1px - 12px)); }
.pt svg { display: block; overflow: visible; }
.pt { clip-path: circle(calc(var(--hit, 12) * 1px)); cursor: pointer; }  /* the hit area: a 24 px disc; on phones at most halfway to the nearest point (--hit, set by the page script) */
.pt .mk { fill: var(--ink); }
.pt .ring { fill: none; stroke: var(--ink); stroke-width: 1; display: none; }
@media (hover: hover) { html:not(.touch) .pt:hover .ring { display: inline; } }  /* not on touch (html.touch, js/people.js): iOS Safari sends no click for a tap that reveals content */
.pt:focus-visible .ring { display: inline; }
.pt:focus { outline: none; }
.map[data-v="topics"] .pt.o .mk { fill: var(--muted); }
.map[data-v] .pt.sel .mk, .map[data-v] .pt.gm .mk { fill: var(--accent); }
.pt.sel { z-index: 3; }
/* Highlights only on: every paper that is not highlighted fades; nothing moves. The open paper stays full strength */
.pt { transition: opacity 150ms; }
.map.only .pt:not(.st):not(.sel) { opacity: 0.12; }
.pt:hover svg, .pt:focus-visible svg { scale: 1.2; }  /* hover or focus: the mark grows a little and gains a thin ring */
.pt.sel svg { scale: 1.4; }  /* the current paper: accent and larger, drawn above the rest */

/* a view's labels and lines; only the current one is visible */
.layer { position: absolute; inset: 0; opacity: 0; visibility: hidden; pointer-events: none; }
.layer.cur { opacity: 1; visibility: visible; }
@media (max-width: 480px) { .layer:not([data-n]):not([data-v="list"]) { display: none; } }  /* phones use their own layout of every view; the list is one layout for all widths */
@media (min-width: 481px) { .layer[data-n] { display: none; } }
.layer svg { position: absolute; left: 0; top: 0; width: 100%; height: auto; overflow: visible; }
.layer line { fill: none; stroke: var(--muted); stroke-width: 1; vector-effect: non-scaling-stroke; }
.layer line.base { stroke: #dcddd8; }
.layer line.pair { stroke: #c4c5c0; }  /* alignment: the matching ends of the two copies */
.layer line.spoke { stroke: #b5b5b1; }  /* topics: each topic joined to the shared subject */
/* topics: the drawing behind the papers, faint marks that are not papers */
.layer .fp { fill: #b9bab4; }
.layer .fh, .layer .fa { fill: none; stroke: #b9bab4; stroke-width: 1; vector-effect: non-scaling-stroke; }
.layer line.fl, .layer .fb { fill: none; stroke: #c4c5bf; stroke-width: 1; vector-effect: non-scaling-stroke; }
.layer line.dash { stroke-dasharray: 3 3; }
.layer .fhd { fill: #c4c5bf; }
.layer .on { stroke: var(--accent); }
.layer.cur a { pointer-events: auto; }
a.lb, .lb a { color: var(--ink); text-decoration-color: #b5b5b1; }
a.lb.muted, .lb a.muted { color: var(--muted); }
a.lb.on, .lb a.on { text-decoration-color: var(--accent); text-decoration-thickness: 2px; }
.lb { position: absolute; left: calc((var(--x) + var(--dx, 0)) * var(--k) * 1px); top: calc((var(--y) + var(--dy, 0)) * var(--k) * 1px); white-space: nowrap; text-align: center; transform: translateX(-50%); }
.lb.bottom { transform: translate(-50%, -100%); }
.lb.centre { transform: translate(-50%, -50%); }
.lb.left { transform: translateY(-50%); text-align: left; }
.lb.aboveleft { transform: translateY(-100%); text-align: left; }
/* path: place names and role lines, aligned to one edge of their column */
.lb.tl { transform: none; text-align: left; }
.lb .yr { color: var(--muted); font-size: 14px; margin-left: 6px; }
.lb .nr { color: var(--muted); font-size: 14px; margin-right: 8px; }  /* path: a role's step number, before its name */
.layer line.sep { stroke: #c4c5bf; stroke-dasharray: 3 3; }
/* path map: a city with papers has no mark of its own, one without papers a thin plus; its name is quieter than the places'; the coastline is fainter than any line that
   means something, and every map label sits on a halo of the background so the coastline stops short of the text */
.layer .city { fill: none; stroke: var(--muted); stroke-width: 1; vector-effect: non-scaling-stroke; }
.lb.city { font-size: 14px; }
.layer svg.geo { pointer-events: none; left: calc(var(--gl) * var(--k) * -1px); width: calc((600 + var(--gl)) * var(--k) * 1px); height: calc(var(--gh) * var(--k) * 1px);
  /* the part west of the map runs under the page's left margin and fades out there */
  -webkit-mask-image: linear-gradient(to right, transparent, #000 calc(var(--gl) * var(--k) * 1px)); mask-image: linear-gradient(to right, transparent, #000 calc(var(--gl) * var(--k) * 1px)); }
.layer line.lead { stroke: #c4c5bf; }  /* path: a hairline from a role line to its cluster */
.layer .geo .coast { fill: none; stroke: #dcddd7; stroke-width: 1; vector-effect: non-scaling-stroke; }
/* one column: the panel is under the map, so the coastline is cut to the map's own box (no fade under the margin, nothing below) */
html.one .layer svg.geo { -webkit-mask-image: none; mask-image: none;
  clip-path: inset(0 0 max(0px, calc((var(--gh) - var(--h)) * var(--k) * 1px)) calc(var(--gl) * var(--k) * 1px)); }
.layer[data-v="path"]:not([data-n]) .lb { text-shadow: 0 0 2px var(--bg), 0 0 2px var(--bg), 0 0 3px var(--bg), 0 0 3px var(--bg), 0 0 4px var(--bg); }
.lb { transition: opacity 100ms; }
/* people: a small dot where a co-author is on a paper; a ring for a co-author of one paper only (hover: the name) */
a.dt { position: absolute; left: calc(var(--x) * var(--k) * 1px); top: calc(var(--y) * var(--k) * 1px); width: calc(var(--w) * var(--k) * 1px); height: 20px; transform: translate(-50%, -50%); transition: opacity 150ms; }
a.dt::after { content: ""; position: absolute; left: 50%; top: 50%; width: 5px; height: 5px; margin: -2.5px 0 0 -2.5px; border-radius: 50%; background: var(--ink); transition: scale 100ms; }
a.dt:hover::after { scale: 1.6; }
a.dt.on::after { background: var(--accent); }
.map[data-v=people]:not(.moving) .pt { clip-path: inset(0 max(0px, calc(12px - var(--pp) * var(--k) * 0.5px))); }  /* the open paper's column */
@media (max-width: 480px) { .map a.dt { pointer-events: none; } }  /* phones: the names are the tap targets */
.layer line.base { transition: opacity 150ms; }
.lb.yr { font-size: 14px; }
a.r1 { position: absolute; left: calc(var(--x) * var(--k) * 1px); top: calc(var(--y) * var(--k) * 1px); width: 14px; height: 7px; transform: translate(-50%, -50%); transition: opacity 150ms; }
a.r1::after { content: ""; position: absolute; left: 4.5px; top: 1px; width: 5px; height: 5px; border: 1px solid var(--muted); border-radius: 50%; box-sizing: border-box; }
a.r1:hover::after, a.r1.on::after { border-color: var(--ink); background: var(--ink); }
a.r1.on::after { border-color: var(--accent); background: var(--accent); }
/* people: hover or select a person or a paper; the rest fades as with Highlights only, names stay readable */
.layer line.base.on { stroke: var(--accent); }
.map.focus .pt.fd, .map.focus .layer .fd:not(.lb) { opacity: 0.12; }
.map.focus .lb.fd { opacity: 0.35; }
.map.only a.dt:not(.st), .map.only a.r1:not(.st) { opacity: 0.12; }
/* a paper's authors: a co-author is a quiet link to their row in People, underlined only on hover or focus */
.layer a.lb.nm { text-decoration-line: none; }  /* people: names are plain until hover or focus (19 underlines are heavy); the selected one keeps the accent underline */
.layer a.lb.nm:hover, .layer a.lb.nm:focus-visible, .layer a.lb.nm.on { text-decoration-line: underline; }
.titles a.au { color: inherit; text-decoration: none; }
.titles a.au:hover, .titles a.au:focus-visible { text-decoration: underline; text-decoration-thickness: 1px; }
/* list: every paper as one line, newest first, the year once per group as a margin label. It is laid out in px, not map
   units, as wide as the other views (--ext); the page script then moves each point onto its line's mark slot */
.plist { position: absolute; left: 0; top: var(--s2); width: calc(var(--ext, 600) * 1px); margin: 0; padding: 0; font-size: 14px; line-height: 20px; }
.plist li { display: grid; grid-template-columns: 44px 1fr; }
.plist li.ny { margin-top: var(--s1); }  /* a new year */
.plist .yr { padding: 2px 0; }
.plist a { display: grid; grid-template-columns: 24px 1fr; column-gap: var(--s1); padding: 2px 0; color: var(--ink); text-decoration: none; transition: opacity 150ms; }
.plist .slot { height: 20px; }
.plist .ti { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; text-decoration-color: #b5b5b1; }
.plist .ti { margin-right: var(--s1); }  /* on the title, so a venue that wraps starts flush on the next line */
.plist a:hover .ti, .plist a.hv .ti { text-decoration-color: var(--ink); }
.plist a.on .ti { text-decoration-color: var(--accent); text-decoration-thickness: 2px; }
.plist a:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.map.only .plist a:not(.st):not(.on) { opacity: 0.12; }  /* Highlights only: the other lines fade like their points */
/* out of view and done moving: clip the hidden list, so a long list does not make the other views scroll */
.map:not(.fromlist) .layer[data-v="list"]:not(.cur) { overflow: hidden; }
.pt.hv .ring { display: inline; }
.pt.hv:not(.sel) svg { scale: 1.2; }
/* a list taller than the window: the page scrolls, the panel stays in place */
html:not(.one) .page:has(.map[data-v="list"]) { height: auto; min-height: 100vh; }
html:not(.one) .page:has(.map[data-v="list"]) .map-zone { min-height: calc(var(--map-top) + var(--listh, 0px) + var(--s3)); }
html:not(.one) .page:has(.map[data-v="list"]) .column { position: sticky; top: 0; align-self: start; }
.lb.under { opacity: 0.2; }  /* a map label under the hover label */

/* movement: only on a view switch, in three steps that never overlap the two views' labels:
   0-150 ms the old labels and lines fade out; 150-670 ms the points move, one topic after another 40 ms apart (--d),
   so they leave in groups and do not pile up; 570-720 ms the new labels, lines and point colours come in */
.map.moving .pt { transition: transform 400ms cubic-bezier(0.4, 0, 0.2, 1) calc(150ms + var(--d)); }
.map.flat .pt { --d: 0ms !important; }  /* leaving People or List: the points leave their row or column together, so all arrive before the new labels come in */
.map.moving .pt .mk { transition: fill 150ms 570ms; }
.map.moving .layer { transition: opacity 150ms linear 0ms, visibility 0s 150ms; }
.map.moving .layer.cur { transition: opacity 150ms linear 570ms, visibility 0s 570ms; }
@media (prefers-reduced-motion: reduce) { .pt, .map.moving .pt, .map.moving .pt .mk, .map.moving .layer, .map.moving .layer.cur { transition: none; } }
/* the hover label: bare text with a halo in the background colour, so lines under it are cut */
#tip { position: absolute; font-size: 14px; line-height: 18px; white-space: nowrap; pointer-events: none; z-index: 4;
  text-shadow: 0 0 2px var(--bg), 0 0 2px var(--bg), 0 0 3px var(--bg), 0 0 3px var(--bg), 0 0 4px var(--bg); }

.column { padding-top: var(--panel-top); }

/* ---------- panel: the introduction, or what the map selected ---------- */
.panel {
  background: var(--panel);
  padding: var(--s3) 25px;
  max-height: calc(100vh - var(--panel-top) - var(--s3));
  overflow-y: auto;
}
.panel[hidden] { display: none; }
/* every panel state is the same stack of blocks, 24 px apart: a head or title block, body text, one dashed line, links */
.lead p + p { margin-top: var(--s2); }
.lead { text-wrap: pretty; }
.row { border-top: 1px dashed var(--ink); padding-top: var(--s2); }
.titles .name, .who .name { font-weight: 500; }
.titles .role, .who .role { white-space: nowrap; }  /* the current role: ink, like the name */
/* past roles: one quieter group, 14 px muted, 12 px under the current role, introduced once by "Previously" */
.past { margin-top: var(--s2); font-size: 14px; }
.past p { white-space: nowrap; }
.past.inline { display: grid; grid-template-columns: auto auto; justify-content: start; column-gap: var(--s1); }
.past.inline .in { grid-row: 1 / span 3; }
/* contact: two kinds of links, each named by a small muted word on the left; the links share one left edge */
.contact { display: grid; grid-template-columns: auto 1fr; column-gap: var(--s2); row-gap: var(--s1); align-items: baseline; }
.contact .k { font-size: 14px; color: var(--muted); }
/* the address (a.em) is no text: an inline SVG drawn at build time with its own underline and baseline offset
   (sitegen/render.py drawn_address), so it needs no rule here; js/email.js opens the mail link on a click */
.contact .profiles { text-wrap: balance; }  /* when the profiles wrap, the lines come out even (3 + 3), never one link alone */
.contact .profiles a { margin-right: var(--s2); white-space: nowrap; }  /* 12 px apart, as in a paper's link row; a name never breaks */
.contact .profiles a:last-child { margin-right: 0; }

.titles, .head { margin-bottom: var(--s3); }
.head { display: flex; flex-wrap: wrap; justify-content: space-between; column-gap: var(--s2); }
.head > * { white-space: nowrap; }
.lead + .row, .papers + .row { margin-top: var(--s3); }
.links { display: flex; flex-wrap: wrap; column-gap: var(--s2); }
.papers { border-top: 1px dashed var(--ink); margin-top: var(--s3); padding: var(--s2) 0 0; }
.lead.none { margin-top: var(--s3); }
.papers li + li { margin-top: var(--s1); }
.me { color: var(--ink); }
.list li a { margin-right: var(--s1); }
.papers.list li { padding-left: 14px; text-indent: -14px; }  /* a long venue wraps; a wrapped line hangs under its title */
.papers.list li + li { margin-top: 3px; }  /* 6 px would make the 20-paper Sapienza list scroll inside the panel */
.head + .papers.list { margin-top: 0; }
.papers.more { line-height: 1.6; }
.papers.more a { white-space: nowrap; }
.head > div + a { align-self: flex-start; }
.titles .ti { margin-bottom: var(--s1); font-weight: 500; }  /* the paper title, one step stronger than body text */
.panel { overflow-wrap: break-word; }  /* long venue names wrap inside the panel */
/* in its own colours, on white as on the site; an animated teaser plays. The full text width, left-aligned; a teaser that
   would be taller than 180 px is scaled down whole to 180 px tall, still left-aligned (no crop, no bars) */
.teaser { display: block; width: auto; max-width: 100%; height: auto; max-height: 180px; margin: 0 0 var(--s2); }

/* ---------- one column: switch and map above the panel ----------
   The page script sets html.one when the window is too narrow for the map, a 48 px gap and the panel side by side (--bp,
   measured from the map's real extent, labels included); then the map scales to the window instead */
html.one .page { display: block; height: auto; padding: var(--s3) 16px var(--s4); }
.switch a, .switch .only { white-space: nowrap; }  /* a switch item never splits across lines */
@media (max-width: 480px) { html.one .switch { column-gap: var(--s2); } }  /* five views and the toggle: 12 px apart on phones */
html.one .switch { position: static; margin-bottom: var(--s4); width: auto; max-width: calc(var(--ext, 600) * 1px); }  /* --ext: the scaled map's width */
/* the map scales to the screen width; its height follows the current view (--h) */
html.one .map { position: relative; left: 0; top: 0; margin-bottom: var(--s4);  /* with the column's 24 px top: 72 px to the panel, room for a hover label */
  height: calc(var(--h) * var(--k) * 1px); }
html.one .lb { font-size: max(13px, calc(16px * var(--k))); }
html.one .lb .yr, html.one .lb.yr, html.one .lb .nr { font-size: max(12px, calc(14px * var(--k))); }
html.one .lb.nm, html.one .lb.more { padding: 3px 0; }  /* tap targets at least 24 px tall */
html.one .pt svg { transform: scale(max(0.75, var(--k))); }  /* marks shrink with the map, so neighbours stay apart */
html.one .column { padding-top: var(--s3); max-width: 640px; }
html.one .who { display: block; margin-bottom: var(--s3); }
html.one #home .titles { display: none; }
html.one .panel { max-height: none; padding: var(--s3) var(--s3); }


/* ---------- without JavaScript: the home panel and one plain list of every paper; the map, its switch and the address
   need the script. The list and the email phrase show by default and go under (scripting: enabled), which the browser
   applies before the first paint (no flash); js/main.js also hides them first thing, for browsers that run scripts
   without knowing that media feature. A browser that knows neither shows the empty map frame above the list ---------- */
@media (scripting: enabled) {
  .plain, .em-off { display: none; }
}
@media (scripting: none) {
  .map-zone, .em { display: none; }
  .plain { grid-row: 1; grid-column: 1; max-width: calc(600px + var(--map-left)); padding: var(--panel-top) var(--s4) var(--s4) var(--map-left); }
  .page { height: auto; min-height: 100vh; }
  .column { position: sticky; top: 0; align-self: start; }
}
.plain .k { font-size: 14px; color: var(--muted); margin-bottom: var(--s2); }
.plain ol { margin: 0; padding: 0; border-top: 1px dashed var(--ink); padding-top: var(--s2); }
.plain li + li { margin-top: var(--s3); }
.plain .t { font-weight: 500; }
.plain .links { margin-top: var(--s1); }
/* narrow windows: one column, the home panel first, then the list */
@media (scripting: none) and (max-width: 1000px) {
  .page { display: flex; flex-direction: column; padding: var(--s3) 16px var(--s4); }
  .column { order: -1; position: static; padding-top: 0; max-width: 640px; }
  .panel { max-height: none; padding: var(--s3); }
  .plain { max-width: 640px; padding: var(--s4) 0 0; }
}

/* ---------- 404.html: the owner's name as a link home, and one line ---------- */
.lost { max-width: calc(var(--panel-w) + 32px); margin: 0 auto; padding: var(--panel-top) 16px var(--s4); }
