/* UCSF NeuroAI Lab — site styles (design from _mockups/r5)
   Modelled on text-led research institutes (Arc, Flatiron CCN, ISTA): modest
   serif headlines, dense sans text, the publication record as the main texture.
   One grid: a rail (labels, titles, contents, years, portraits) and a main column.
   All text is navy-tinted; solid navy only for the UCSF banner and the footer. */

:root {
  --navy: #052049;      /* UCSF Navy */
  --ink: #142347;
  --ink-2: #3c4a66;
  --slate: #5d6a82;
  --rule: #dce1e9;
  --mist: #f4f6f9;
  --blue: #0071ad;      /* UCSF link blue */
  --sky: #8ec5f0;

  /* type, as on Pedro's blog: Newsreader for titles, Instrument Sans for interface and body,
     Source Serif 4 for reading text, Martian Mono for small labels and dates */
  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans: "Instrument Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --reading: "Source Serif 4", Georgia, "Times New Roman", serif;
  --mono: "Martian Mono", ui-monospace, Menlo, monospace;

  --fs-hero: clamp(1.875rem, 1.3rem + 1.7vw, 2.875rem);
  --fs-title: clamp(2.125rem, 1.7rem + 1.2vw, 2.75rem);
  --fs-h2: clamp(1.5rem, 1.3rem + .55vw, 1.875rem);
  --fs-item: 1.1875rem;
  --fs-read: 1.1875rem;
  --fs-small: .9375rem;
  --fs-meta: .8125rem;

  --gap: clamp(24px, 3vw, 48px);
  --pad: clamp(20px, 4vw, 56px);
  --sec: clamp(48px, 5.5vw, 80px);
  --header: 84px;
}

*, *::before, *::after { box-sizing: border-box; }
/* navy behind the page, so overscrolling past the banner or footer shows navy, not white */
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header) + 24px); background: var(--navy); }
body {
  margin: 0;
  font: 400 1rem/1.62 var(--sans);
  color: var(--ink);
  background: #fff;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3, p, ul, ol { margin: 0; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 8px; z-index: 100; background: #fff; padding: 8px 12px; }

.wrap { max-width: 1280px; margin: 0 auto; padding: 0 var(--pad); }
.grid { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 9fr); column-gap: var(--gap); }
.grid > .rail { grid-column: 1; }
.grid > .main { grid-column: 2; min-width: 0; }

/* links inside running text */
.main p a:not(.button), .prose li a, .dek a, .hero__dek a, .person__more a {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: .2em;
  text-decoration-color: rgba(0, 113, 173, .35);
  transition: color .15s, text-decoration-color .15s;
}
.main p a:not(.button):hover, .prose li a:hover, .dek a:hover, .hero__dek a:hover, .person__more a:hover {
  color: var(--blue);
  text-decoration-color: currentColor;
}

/* ---------------------------------------------------------------- banner + header */
/* as on neurology.ucsf.edu: 40px bar, 14px type, "Give to UCSF" in a blue block */
.banner { background: var(--navy); color: #fff; font-size: .875rem; }
.banner .wrap { display: flex; justify-content: space-between; align-items: center; min-height: 40px; gap: 16px; }
.banner a { color: #fff; text-decoration: none; }
.banner a:hover { text-decoration: underline; }
.banner__links { display: flex; align-self: stretch; }
.banner__links a { display: flex; align-items: center; padding: 0 20px; }
.banner__give { background: #006be9; padding: 0 32px !important; }
.banner__give:hover { background: #0058c2; text-decoration: none !important; }

.site-header { position: sticky; top: 0; z-index: 50; background: #fff; border-bottom: 1px solid var(--rule); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 32px; min-height: var(--header); }
.brand { display: flex; flex-direction: column; text-decoration: none; }
.brand__name { font: 500 1.875rem/1 var(--serif); letter-spacing: -.012em; color: var(--navy); }
.brand__name i { font-weight: 400; }
.brand__unit { margin-top: 6px; font-size: .84375rem; line-height: 1; color: var(--slate); }
.nav { display: flex; gap: clamp(18px, 2vw, 30px); }
.nav a { padding: 6px 0; font-size: var(--fs-small); color: var(--ink); text-decoration: none; border-bottom: 1px solid transparent; }
.nav a:hover { color: var(--navy); border-bottom-color: var(--rule); }
.nav a[aria-current] { color: var(--navy); border-bottom-color: var(--navy); }
/* phones: a three-bar menu button, as on neurology.ucsf.edu; it becomes a cross while open */
.menu-toggle { display: none; margin-right: -6px; padding: 10px 6px; background: none; border: 0; cursor: pointer; }
.menu-toggle__bars { display: block; width: 28px; }
.menu-toggle__bars span { display: block; height: 3px; margin: 5px 0; border-radius: 2px; background: var(--navy); transition: transform .2s, opacity .2s; }
.menu-toggle[aria-expanded="true"] .menu-toggle__bars span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] .menu-toggle__bars span:nth-child(2) { opacity: 0; }
.menu-toggle[aria-expanded="true"] .menu-toggle__bars span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* ---------------------------------------------------------------- shared pieces */
.sec { padding: var(--sec) 0 0; }
.sec:last-child { padding-bottom: calc(var(--sec) * 1.25); }
.sec--tight { padding-top: calc(var(--sec) * .6); }
.sec__grid { border-top: 1px solid var(--navy); padding-top: 16px; }
.rail__label, .label { font: 500 var(--fs-small)/1.4 var(--sans); color: var(--navy); }
.rail__label::before, .label::before {
  content: ""; display: inline-block;
  width: 7px; height: 7px; margin-right: 10px; vertical-align: .08em;
  background: var(--blue); border-radius: 50%;
}
.rail__label a { text-decoration: none; }
.rail__label a:hover { color: var(--blue); }
.meta { font: 500 var(--fs-meta)/1.4 var(--sans); color: var(--slate); font-variant-numeric: tabular-nums; }
.year { font: 400 1.875rem/1 var(--serif); color: var(--navy); font-variant-numeric: oldstyle-nums; }
.year::before { display: none; }

.more {
  display: inline-flex; align-items: baseline; gap: .45em;
  padding-bottom: 2px;
  font: 500 var(--fs-small)/1.2 var(--sans);
  color: var(--navy);
  text-decoration: none;
}
.more::after { content: "→"; transition: transform .15s; }
.more:hover { color: var(--blue); }
.more:hover::after { transform: translateX(3px); }
.more--light { color: #fff; }
.more--light:hover { color: var(--sky); }

.button {
  display: inline-flex; align-items: center; gap: .55em;
  padding: 13px 20px;
  font: 500 var(--fs-small)/1 var(--sans);
  color: #fff;
  background: var(--navy);
  border-radius: 2px;
  text-decoration: none;
  transition: background .15s;
}
.button::after { content: "→"; }
.button:hover { background: var(--blue); }

.after { margin-top: 24px; }
.note { font-size: var(--fs-small); color: var(--slate); }
.statement { max-width: 22em; margin-bottom: 32px; font: 400 var(--fs-h2)/1.25 var(--serif); color: var(--navy); }
.statement--small { margin: 36px 0 0; max-width: 34em; font-size: 1.25rem; line-height: 1.45; color: var(--ink-2); }

/* list of linked items with a rule between them (news, programs, recent papers) */
.rows, .recs, .sublinks { list-style: none; padding: 0; }
.rows li { display: grid; grid-template-columns: 7rem minmax(0, 1fr); gap: 20px; align-items: baseline; padding: 11px 0; border-bottom: 1px solid var(--rule); }
.rows li:first-child { padding-top: 0; }
.rows time { font: 500 var(--fs-meta)/1.4 var(--sans); color: var(--slate); font-variant-numeric: tabular-nums; }
.rows a, .rec__title, .sublinks a {
  font: 400 var(--fs-item)/1.3 var(--serif);
  color: var(--navy);
  text-decoration: none;
}
.rows a:hover, .rec__title:hover, .sublinks a:hover { color: var(--blue); }

/* ---------------------------------------------------------------- home */
.hero { padding: clamp(36px, 4.5vw, 60px) 0 0; }
.hero__grid, .split { display: grid; grid-template-columns: minmax(0, 8fr) minmax(0, 4fr); gap: 40px calc(var(--gap) * 1.3); }
.hero__statement { max-width: 19em; font: 400 var(--fs-hero)/1.12 var(--serif); color: var(--navy); text-wrap: balance; }
.hero__statement em { color: var(--blue); }
.hero__dek { max-width: 40em; margin-top: 28px; font-size: 1.0625rem; line-height: 1.65; color: var(--ink-2); }
.split__side { padding-left: calc(var(--gap) * 1.3); border-left: 1px solid var(--rule); }
.split .label { margin-bottom: 18px; }
.label a { text-decoration: none; }
.label a:hover { color: var(--blue); }
.split__side .recs { margin-top: 0; }
.split__side .recs li:first-child { padding-top: 0; }
.hero__record { padding-left: calc(var(--gap) * 1.3); border-left: 1px solid var(--rule); }
.recs { margin: 14px 0 22px; }
.recs li { padding: 13px 0; border-bottom: 1px solid var(--rule); }
.recs .meta { margin-bottom: 4px; }
.rec__title { display: inline; font-size: 1.125rem; }

.pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); }
.prog__title { margin-bottom: 12px; font: 400 var(--fs-h2)/1.12 var(--serif); color: var(--navy); }
.prog__title a { text-decoration: none; transition: color .15s; }
.prog__title a:hover { color: var(--blue); }
.prog p { margin-bottom: 20px; max-width: 36em; color: var(--ink-2); }
.sublinks { border-top: 1px solid var(--rule); }
.sublinks li { border-bottom: 1px solid var(--rule); }
.sublinks a { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; }
.sublinks a::after { content: "→"; font: 400 .9375rem/1.6 var(--sans); }

.careers { margin-top: clamp(44px, 5vw, 64px); }   /* under Research, beside News and the upcoming talks */
.careers__title { margin-bottom: 18px; font: 400 var(--fs-h2)/1.15 var(--serif); color: var(--navy); }
.careers__roles { list-style: none; padding: 0; margin-bottom: 24px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--gap); border-top: 1px solid var(--rule); }
.careers__roles li { border-bottom: 1px solid var(--rule); }
.careers__roles a { display: flex; justify-content: space-between; gap: 16px; padding: 11px 0; font: 400 1.125rem/1.3 var(--serif); color: var(--navy); text-decoration: none; }
.careers__roles a::after { content: "→"; font: 400 .9375rem/1.5 var(--sans); color: var(--blue); }
.careers__roles a:hover { color: var(--blue); }

/* ---------------------------------------------------------------- interior pages */
.page-head { padding: clamp(36px, 4.5vw, 56px) 0 clamp(28px, 3.5vw, 40px); }
.page-head .grid, .page-head.grid { align-items: start; }
.page-title { font: 400 var(--fs-title)/1.05 var(--serif); color: var(--navy); }
.dek { max-width: 38em; padding-top: 6px; font: 400 1.25rem/1.5 var(--serif); color: var(--ink-2); }
.page-head + .sec, .page-head + .doc { padding-top: 0; }
.page-head__links { align-self: end; padding-bottom: 6px; }

/* research */
.doc { padding-bottom: calc(var(--sec) * 1.25); }
.toc { position: sticky; top: calc(var(--header) + 24px); align-self: start; }
.toc summary { list-style: none; pointer-events: none; }
.toc summary::-webkit-details-marker { display: none; }
.toc ol { list-style: none; padding: 0; margin-top: 16px; border-left: 1px solid var(--rule); }
.toc a {
  display: block;
  margin-left: -1px;
  padding: 6px 0 6px 16px;
  font-size: var(--fs-small); line-height: 1.35;
  color: var(--slate);
  text-decoration: none;
  border-left: 2px solid transparent;
  transition: color .15s, border-color .15s;
}
.toc a:hover { color: var(--navy); }
.toc a.is-current { color: var(--navy); border-left-color: var(--navy); }
.toc ol ol { margin: 0 0 6px; border-left: 0; }
.toc ol ol a { padding-left: 28px; }
.toc .toc__group { font-weight: 500; color: var(--navy); }

.overview { list-style: none; padding: 0; max-width: 36em; }
.overview li { padding: 12px 0; border-bottom: 1px solid var(--rule); font: 400 1.25rem/1.4 var(--serif); color: var(--ink-2); }
.overview li:first-child { padding-top: 0; }
.overview a { font-weight: 500; color: var(--navy); text-decoration: none; }
.overview a:hover { color: var(--blue); }
.chapter { margin-top: clamp(44px, 5vw, 64px); }
.chapter__title { margin-bottom: 16px; font: 400 var(--fs-h2)/1.12 var(--serif); color: var(--navy); }
.chapter__title a { text-decoration: none; }
.chapter__title a::after { content: "→"; margin-left: .4em; font: 400 .6em/1 var(--sans); vertical-align: .12em; }
.chapter__title a:hover { color: var(--blue); }
.reading p { max-width: 36em; margin-bottom: 1em; font: 400 var(--fs-read)/1.6 var(--serif); }

/* team */
.people { list-style: none; padding: 0; margin-top: 24px; }
.person { padding: 28px 0; border-top: 1px solid var(--rule); }
.person:first-child { padding-top: 0; border-top: 0; }
.person__photo { width: 176px; aspect-ratio: 4 / 5; object-fit: cover; background: var(--mist); }
.person__name { font: 400 1.625rem/1.1 var(--serif); color: var(--navy); }
.person__name a { text-decoration: none; }
.person__name a:hover { color: var(--blue); }
.person__role { margin: 6px 0 12px; font-size: var(--fs-small); color: var(--slate); }
.person__bio, .person__more p { max-width: 42em; color: var(--ink-2); }
.person__more p { margin-top: 10px; }
.person__more summary { display: inline-block; margin-top: 8px; font-size: var(--fs-small); font-weight: 500; color: var(--navy); cursor: pointer; list-style: none; }
.person__more summary::-webkit-details-marker { display: none; }
.person__more summary:hover { color: var(--blue); }
.person__more .opened, .person__more[open] .closed { display: none; }
.person__more[open] .opened { display: inline; }
.person__links { margin-top: 10px; font-size: var(--fs-small); }

.alumni { list-style: none; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 32px; }
.alum { display: grid; grid-template-columns: 120px minmax(0, 1fr); column-gap: 28px; align-content: start; }
.alum__photo { width: 120px; aspect-ratio: 4 / 5; object-fit: cover; background: var(--mist); }
.alum__name { font: 400 1.3125rem/1.15 var(--serif); color: var(--navy); }
.alum .person__role { margin-bottom: 0; }
.alum > :not(.alum__photo) { grid-column: 2; }
.alum__photo { grid-row: 1 / span 4; }
.alum__bio { max-width: 42em; margin-top: 10px; font-size: var(--fs-small); color: var(--ink-2); }
.alum .person__more p { font-size: var(--fs-small); }

/* collaborators */
.collabs { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px var(--gap); }
.collabs p { font-size: var(--fs-small); color: var(--ink-2); }
.collabs p > strong:first-child { font: 400 1.1875rem/1.3 var(--serif); color: var(--navy); }
.collabs p > strong:first-child a { text-decoration-color: transparent; }

/* publications */
.tools-row__main { display: flex; flex-wrap: wrap; align-items: baseline; gap: 12px 28px; padding-top: 10px; }
.page-head .search { margin-top: 20px; max-width: 30rem; }
.page-head .search input { flex: 1; }
.tools-row__title { font: 400 1.5rem/1.1 var(--serif); color: var(--navy); }
.search { display: flex; align-items: baseline; gap: 12px; }
.search__label { font-size: var(--fs-meta); color: var(--slate); }
.search input { width: 14rem; padding: 5px 0; font: inherit; color: var(--ink); background: transparent; border: 0; border-bottom: 1px solid var(--navy); border-radius: 0; }
.search input:focus { outline: none; border-bottom-color: var(--blue); box-shadow: 0 1px 0 var(--blue); }
.search__count { min-width: 4.5em; font-size: var(--fs-meta); color: var(--slate); font-variant-numeric: tabular-nums; }
.pub-year { padding-top: 36px; }
#pub-index { padding-bottom: calc(var(--sec) * 1.25); }
.pub-year .year { position: sticky; top: calc(var(--header) + 20px); }
.pub-list { list-style: none; padding: 0; }
.pub { padding-bottom: 18px; margin-bottom: 18px; border-bottom: 1px solid var(--rule); }
.pub:last-child { margin-bottom: 0; border-bottom: 0; }
.pub .meta { margin-bottom: 3px; color: var(--blue); }
.pub__title { display: block; max-width: 38em; font: 400 1.3125rem/1.25 var(--serif); color: var(--navy); text-decoration: none; }
.pub__title:hover { color: var(--blue); }
.pub__authors { margin-top: 6px; max-width: 58em; font-size: .875rem; line-height: 1.5; color: var(--slate); }
.pub__authors strong { font-weight: 500; color: var(--ink); }
.pub__venue { margin-top: 2px; font-size: .875rem; line-height: 1.5; color: var(--slate); overflow-wrap: anywhere; }
.main .pub__venue a { color: var(--slate); text-decoration-color: var(--rule); }
.empty { padding: 40px 0; color: var(--slate); }

/* careers */
.roles { list-style: none; padding: 0; margin-top: 20px; border-bottom: 1px solid var(--rule); }
.roles li { border-top: 1px solid var(--rule); }
.roles a { display: flex; justify-content: space-between; align-items: baseline; gap: 24px; padding: 16px 0; font: 400 1.5rem/1.2 var(--serif); color: var(--navy); text-decoration: none; transition: color .15s; }
.roles a::after { content: "→"; font: 400 1.0625rem/1 var(--sans); transition: transform .15s; }
.roles a:hover { color: var(--blue); }
.roles a:hover::after { transform: translateX(4px); }

/* tools */
.entry + .entry { margin-top: 48px; }
.entry__title { max-width: 24em; margin-bottom: 14px; font: 400 var(--fs-h2)/1.15 var(--serif); color: var(--navy); }
.entry__body p { max-width: 38em; color: var(--ink-2); }
.entry__body p + p { margin-top: 20px; }

/* research page body (Markdown) */
.research-body .overview { list-style: none; padding: 0; max-width: 36em; }
.research-body .overview li { padding: 12px 0; border-bottom: 1px solid var(--rule); font: 400 1.25rem/1.4 var(--serif); color: var(--ink-2); }
.research-body .overview li:first-child { padding-top: 0; }
.research-body .overview a { font-weight: 500; color: var(--navy); text-decoration: none; }
.research-body .overview a:hover { color: var(--blue); }
.research-body h2 { margin-top: clamp(64px, 7vw, 96px); padding-top: 16px; border-top: 1px solid var(--navy); font: 500 var(--fs-small)/1.4 var(--sans); color: var(--navy); }
.research-body h2::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 10px; vertical-align: .08em; background: var(--blue); border-radius: 50%; }
.research-body > h2:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.research-body h2 + .overview { margin-top: 22px; }
.research-body h2 a { text-decoration: none; }
.research-body h2 a::after { content: " →"; }
.research-body h2 a:hover { color: var(--blue); }
/* project drawings: live canvases on the page ground (js/drawings/) */
/* a project heading set over its drawing: the drawing spans the text width, the title sits on it */
.project-head { position: relative; max-width: calc(36 * var(--fs-read)); margin: clamp(28px, 3vw, 44px) 0 14px; }   /* as wide as the paragraphs */
.research-body .project-head h3 { position: absolute; left: 0; top: 50%; z-index: 1; max-width: 58%; margin: 0; transform: translateY(-50%); }   /* long titles wrap before the drawing's centre */
.project-fig { margin: 0; }
.project-fig canvas { display: block; width: 100%; }
.research-body h3 { margin: clamp(44px, 5vw, 64px) 0 16px; font: 400 var(--fs-h2)/1.12 var(--serif); color: var(--navy); }
.research-body h2 + h3 { margin-top: 24px; }
.rep-pubs { max-width: 36em; margin-top: 24px; }
.rep-pubs .recs { margin-top: 10px; border-top: 1px solid var(--rule); }
.rep-pubs .recs li { padding: 11px 0; }
.research-body .rep-pubs .label { max-width: none; margin: 0; font: 500 var(--fs-small)/1.4 var(--sans); }
.research-body .rep-pubs .meta { max-width: none; margin: 0 0 4px; font: 500 var(--fs-meta)/1.4 var(--sans); color: var(--slate); }
.rep-pubs .rec__title { font-size: 1.125rem; }
.research-body p { max-width: 36em; margin-bottom: 1em; font: 400 var(--fs-read)/1.6 var(--serif); }

/* prose: Markdown pages, news posts, job postings */
.prose > * + * { margin-top: 1em; }
.prose > :first-child { margin-top: 0; }
.prose h1 { margin-bottom: .6em; max-width: 22em; font: 400 var(--fs-title)/1.08 var(--serif); color: var(--navy); text-wrap: balance; }
.prose h2 { margin-top: 2.2em; padding-top: 18px; border-top: 1px solid var(--rule); font: 400 1.75rem/1.2 var(--serif); color: var(--navy); }
.prose h1 + h2 { margin-top: 0; }
.prose > h2:first-child { padding-top: 0; border-top: 0; }
.prose--post > hr:last-child { display: none; }
.prose h3 { margin-top: 1.8em; font: 400 1.5rem/1.25 var(--serif); color: var(--navy); }
.prose h2 + *, .prose h3 + * { margin-top: .6em; }
.prose p, .prose li { max-width: 40em; }
.prose ul, .prose ol { padding-left: 1.25em; }
.prose li + li { margin-top: .35em; }
.prose strong { font-weight: 600; }
.prose blockquote { margin: 1.5em 0; padding-left: 20px; border-left: 2px solid var(--navy); color: var(--ink-2); }
.prose hr { margin: 2.5em 0; border: 0; border-top: 1px solid var(--rule); }
.prose img { max-width: 100% !important; height: auto; }  /* beats inline max-width in older posts */
.prose code { padding: .1em .35em; font: .875em/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--mist); border-radius: 2px; }
.prose pre { padding: 16px 18px; overflow-x: auto; background: var(--mist); }
.prose pre code { padding: 0; background: none; }
.prose table { border-collapse: collapse; font-size: var(--fs-small); }
.prose th, .prose td { padding: 8px 16px 8px 0; text-align: left; border-bottom: 1px solid var(--rule); }
.prose .statement { margin-bottom: 0; }
.prose .roles { margin-top: 24px; }
.prose .button { margin-top: 8px; }
/* Resources: Talks and Teaching side by side; Teaching's decks stacked */
.res-cols { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 0 var(--gap); align-items: start; }
.prose .res-col > h2:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.prose .res-col--teaching > .meta { margin-top: 18px; }
.prose .res-col--teaching > .decks + .meta { margin-top: 36px; }   /* a second series */
.prose .decks { list-style: none; padding: 0; margin-top: 12px; border-top: 1px solid var(--rule); }
.prose .decks li { max-width: none; margin: 0; padding: 16px 0 20px; border-bottom: 1px solid var(--rule); }
.prose .decks h3 { margin-top: 0; font-size: 1.1875rem; line-height: 1.25; text-wrap: balance; }
.prose .decks p { margin: 6px 0 14px; font-size: var(--fs-small); color: var(--ink-2); }
.prose .decks .more { text-decoration: none; }                  /* a plain arrow link, as elsewhere */
/* on phones Talks comes first, so it starts with three talks and a button for the rest */
.talks-more { margin-top: 14px; padding: 0 0 2px; font: 500 var(--fs-small)/1.2 var(--sans); color: var(--navy); background: linear-gradient(currentColor, currentColor) 0 100% / 100% 1px no-repeat; border: 0; cursor: pointer; }
.talks-more::after { content: " ↓"; }
.talks-more:hover { color: var(--blue); }
.prose .talk[hidden], .prose .talks[hidden], .prose .talks__group[hidden], .talks-more[hidden] { display: none; }
@media (max-width: 800px) { .res-cols { grid-template-columns: minmax(0, 1fr); } .res-col--teaching { margin-top: 56px; } }

/* homepage: upcoming talks under News */
.talks-next__label { margin-top: 40px; }
.talks-next__event { margin-top: 3px; font-size: var(--fs-meta); line-height: 1.45; color: var(--slate); }
/* talks (Resources): grouped by Upcoming and year, a date column and the talk */
.prose .talks__group { margin-top: 1.6em; font: 500 var(--fs-small)/1.4 var(--sans); color: var(--navy); }
.prose .talks__group::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 10px; vertical-align: .08em; background: var(--blue); border-radius: 50%; }
.prose .talks { list-style: none; padding: 0; margin-top: 10px; border-top: 1px solid var(--rule); }
.prose .talk { display: grid; grid-template-columns: 7rem minmax(0, 1fr); gap: 20px; align-items: baseline; max-width: none; margin: 0; padding: 13px 0; border-bottom: 1px solid var(--rule); }
.prose .talk__title { margin: 0; font: 400 1.1875rem/1.3 var(--serif); color: var(--navy); }
.prose .talk__event { margin: 4px 0 0; font-size: var(--fs-small); color: var(--ink-2); }
.prose .talk__links { margin: 6px 0 0; font-size: var(--fs-small); }
@media (max-width: 800px) { .prose .talk { grid-template-columns: minmax(0, 1fr); gap: 4px; } }
.prose--post p, .prose--post li { color: var(--ink-2); }

.doc-page { padding: clamp(40px, 5vw, 64px) 0 calc(var(--sec) * 1.25); }
.doc-page .rail__label { padding-top: 18px; }

.post__title { max-width: 22em; margin-top: 8px; font: 400 var(--fs-title)/1.08 var(--serif); color: var(--navy); text-wrap: balance; }
.post .page-head .rail__label { padding-top: 2px; }
.prose--post { padding-bottom: 56px; }
.post-nav { padding-bottom: calc(var(--sec) * 1.25); }
.post-nav__links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); padding-top: 20px; border-top: 1px solid var(--rule); }
.post-nav__link { display: block; font: 400 1.1875rem/1.3 var(--serif); color: var(--navy); text-decoration: none; }
.post-nav__link .meta { display: block; margin-bottom: 4px; }
.post-nav__link--next { grid-column: 2; text-align: right; }
.post-nav__link:hover { color: var(--blue); }

.dek p + p, .hero__dek p + p { margin-top: .8em; }
@media (max-width: 800px) {
  .post-nav__links { grid-template-columns: minmax(0, 1fr); }
  .post-nav__link--next { grid-column: 1; text-align: left; }
  .doc-page { padding-top: 32px; }
}

/* ---------------------------------------------------------------- footer */
.site-footer { padding: clamp(48px, 5vw, 72px) 0 26px; background: var(--navy); color: #fff; }
.footer__name { font: 400 1.5rem/1.1 var(--serif); }
.footer__cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px var(--gap); }
.footer__label { margin-bottom: 12px; font-size: var(--fs-meta); font-weight: 500; color: var(--sky); }
.site-footer ul { list-style: none; padding: 0; }
.site-footer li { margin-bottom: 8px; font-size: .875rem; line-height: 1.4; overflow-wrap: anywhere; }
.site-footer a { color: #fff; text-decoration: none; }
.site-footer a:hover { text-decoration: underline; text-underline-offset: .2em; }
.footer__policies { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 28px; }
.footer__base { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 12px 32px; margin-top: clamp(40px, 5vw, 64px); padding-top: 18px; border-top: 1px solid rgba(255, 255, 255, .2); font-size: .8125rem; color: rgba(255, 255, 255, .72); }

/* ---------------------------------------------------------------- smaller screens */
@media (max-width: 1080px) {
  .collabs, .alumni { grid-template-columns: minmax(0, 1fr); }
  .footer__cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 960px) {
  .menu-toggle { display: block; }
  .nav { display: none; position: absolute; left: 0; right: 0; top: 100%; flex-direction: column; gap: 0; padding: 8px var(--pad) 20px; background: #fff; border-bottom: 1px solid var(--rule); }
  .nav.is-open { display: flex; }
  .nav a { padding: 13px 0; font-size: 1.0625rem; border-bottom: 1px solid var(--rule); }
  .nav a[aria-current] { border-bottom-color: var(--rule); font-weight: 500; }
  .banner__links { display: none; }                  /* as on Neurology: only the university's name */
  .hero__grid, .split { grid-template-columns: minmax(0, 1fr); }
  .hero__record, .split__side { padding: 24px 0 0; border-left: 0; border-top: 1px solid var(--navy); }
}

@media (max-width: 800px) {
  :root { --header: 70px; }
  .grid { grid-template-columns: minmax(0, 1fr); }
  .grid > .rail, .grid > .main { grid-column: 1; }
  .sec__grid > .rail { margin-bottom: 18px; }
  .page-title { margin-bottom: 14px; }
  .brand__name { font-size: 1.5625rem; }
  .brand__unit { font-size: .75rem; }

  .pair { grid-template-columns: minmax(0, 1fr); gap: 40px; }
  .split { row-gap: 48px; }
  .careers__roles { grid-template-columns: minmax(0, 1fr); }
  .rows li { grid-template-columns: minmax(0, 1fr); gap: 2px; }

  .doc .sec__grid { border-top: 0; padding-top: 0; }
  .research-body [id] { scroll-margin-top: 36px; }   /* clear the sticky Contents bar as well as the header */
  .toc { position: sticky; top: var(--header); z-index: 10; margin: 0 calc(var(--pad) * -1) 32px; padding: 0 var(--pad); background: #fff; border-top: 1px solid var(--navy); border-bottom: 1px solid var(--rule); }
  .toc summary { pointer-events: auto; cursor: pointer; display: flex; justify-content: space-between; align-items: center; padding: 13px 0; }
  .toc summary::after { content: "+"; font-size: 1.125rem; line-height: 1; }
  .toc details[open] summary::after { content: "−"; }
  .toc ol { margin: 0 0 14px; }

  .person { display: grid; grid-template-columns: 88px minmax(0, 1fr); column-gap: 18px; }
  .person > .rail { grid-column: 1; }
  .person > .main { grid-column: 2; }
  .person__photo { width: 88px; max-width: none; }
  .person__name { font-size: 1.375rem; }

  .pub-year .year { position: static; margin-bottom: 14px; }
  .search, .search input { width: 100%; }
}

@media (max-width: 520px) {
  .person { grid-template-columns: minmax(0, 1fr); }
  .person > .main { grid-column: 1; }
  .person__photo { width: 96px; margin-bottom: 16px; }
  .footer__cols { grid-template-columns: minmax(0, 1fr); }
  .footer__name { margin-bottom: 28px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}

/* ASCII brain under the statement (from the original Research page); desktop only */
.ascii {
  margin: clamp(36px, 4vw, 56px) 0 0;
  font: 400 5.5px/1 ui-monospace, Menlo, Monaco, Consolas, "DejaVu Sans Mono", monospace;
  color: var(--navy);
  white-space: pre;
  overflow: hidden;
  user-select: none;
}
.hero__art { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-top: clamp(36px, 4vw, 56px); }
.hero__art .ascii { margin: 0; font-size: min(5.2px, calc((100vw - 2 * var(--pad)) * .004)); }
.ascii--digits { color: var(--blue); font-weight: 500; }
@media (max-width: 960px) { .hero__art { display: none; } }
/* recent publications: beside the statement on wide screens, after Research on small ones */
.split__side--pubs { display: none; }
@media (max-width: 960px) {
  .hero__record { display: none; }
  .split__side--pubs { display: block; }
}

.person__bio a, .person__more a, .person__links a { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .2em; text-decoration-color: rgba(0, 113, 173, .35); transition: color .15s, text-decoration-color .15s; }
.person__bio a:hover, .person__more a:hover, .person__links a:hover { color: var(--blue); text-decoration-color: currentColor; }

/* older posts: keep wide tables, long URLs and embeds inside the screen */
.prose { overflow-wrap: break-word; }
.prose a { overflow-wrap: anywhere; }
.prose table { display: block; max-width: 100%; overflow-x: auto; }
.prose iframe, .prose video, .prose embed, .prose .gist { max-width: 100%; }
.prose .gist .blob-wrapper { overflow-x: auto; }

/* ---------------------------------------------------------------- texture and motion
   js/texture.js draws a moving texture in each region marked data-tex, on a canvas of its own
   that scrolls with the region, and still contour lines behind the footer (data-topo).
   js/morph.js turns the homepage brain into the network and back. All of it is skipped or
   held still with reduced motion. */
[data-tex] { position: relative; isolation: isolate; }        /* each textured region holds its own canvas, behind its content */
.texture { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.site-footer { position: relative; z-index: 1; overflow: hidden; }
.site-footer > .wrap { position: relative; z-index: 1; }
.topo { position: absolute; inset: 0; z-index: 0; pointer-events: none; }

/* homepage art: the canvas replaces the two static figures */
.hero__art.is-live .ascii { display: none; }
.hero__art canvas { display: block; }

/* titles fill in word by word (js/site.js) */
.w { opacity: .14; transition: opacity .6s; }
.w.is-on { opacity: 1; }

/* homepage: section rules draw across as they come into view */
.js .home .sec__grid { position: relative; border-top-color: transparent; }
.js .home .sec__grid::before {
  content: ""; position: absolute; top: -1px; left: 0; right: 0; height: 1px; background: var(--navy);
  transform: scaleX(0); transform-origin: left; transition: transform 1.4s cubic-bezier(.625, .05, 0, 1);
}
.js .home .sec__grid.is-in::before { transform: none; }

/* underlines wipe in from the left */
.more, .rec__title, .careers__roles a {
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat;
  transition: background-size .35s cubic-bezier(.625, .05, 0, 1), color .15s;
}
.more:hover, .rec__title:hover, .careers__roles a:hover { background-size: 100% 1px; }

@media (prefers-reduced-motion: reduce) {
  .w { opacity: 1; }
  .js .home .sec__grid::before { transform: none; }
}

/* ---------------------------------------------------------------- type roles */
.hero__statement, .page-title, .post__title { letter-spacing: -.012em; }
.dek, .reading p, .research-body p, .research-body .overview li, .overview li { font-family: var(--reading); }
.label, .rail__label, .meta, .rows time, .footer__label, .search__label, .toc summary {
  font-family: var(--mono); font-size: .6875rem; font-weight: 400; letter-spacing: .06em; text-transform: uppercase;
}
.label, .rail__label, .toc summary { font-size: .8125rem; }   /* section labels a little larger than dates and meta */
