/* ==========================================================================
   Custom overrides for the Academic Pages / Minimal Mistakes theme.

   Design direction: clean, restrained, Apple-like — near-white ground, white
   surfaces, hairline rules, generous whitespace, one accent color, and a light
   graph (node-edge) motif that reflects graph-centric AI research.

   Loaded after main.css (see _includes/head/custom.html), so plain class
   selectors here win over the theme's defaults.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Design tokens
   -------------------------------------------------------------------------- */

:root {
  /* Theme variables, retuned. */
  --global-base-color                : #6e6e73;
  --global-bg-color                  : #ffffff;
  --global-border-color              : #e6e6ea;
  --global-code-background-color     : #f5f5f7;
  --global-code-text-color           : #1d1d1f;
  --global-fig-caption-color         : #86868b;
  --global-link-color                : #146b74;
  --global-link-color-hover          : #0d4c53;
  --global-link-color-visited        : #146b74;
  --global-masthead-link-color       : #424245;
  --global-masthead-link-color-hover : #146b74;
  --global-text-color                : #1d1d1f;
  --global-text-color-light          : #6e6e73;
  --global-thead-color               : #f5f5f7;

  /* Local additions */
  --accent          : #146b74;  /* deep teal — the single accent */
  --accent-hover    : #0d4c53;
  --accent-soft     : #e7f1f2;
  --page-bg         : #fbfbfd;  /* near-white page ground */
  --surface         : #ffffff;
  --surface-muted   : #f5f5f7;
  --hairline        : #e6e6ea;
  --text-secondary  : #6e6e73;
  --heading-color   : #1d1d1f;
  --radius-lg       : 14px;
  --radius-md       : 10px;
  --measure         : 820px;
  --font-sans       : "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* --------------------------------------------------------------------------
   [hidden] guard - read this before adding `display` to anything JS toggles
   --------------------------------------------------------------------------
   The `hidden` attribute only works through a UA rule of `display: none`, which
   ANY author `display` declaration outranks. So the moment a component that JS
   shows and hides gets `display: flex` (or grid, or block), `el.hidden = true`
   silently stops hiding it - no error, no warning, the element just stays on
   screen. That has already shipped twice from this file: publication citation
   panels that all rendered open, and a filter summary that would not clear.

   This makes the attribute mean what it says, everywhere, once. Components that
   deliberately invert it still can: `<noscript>` in research-map.html keeps its
   panels readable with `.rmap__panel[hidden] { display: block !important }`,
   which wins on specificity (0,2,0 over 0,1,0).
   -------------------------------------------------------------------------- */
[hidden] {
  display: none !important;
}


/* --------------------------------------------------------------------------
   2. Base typography
   -------------------------------------------------------------------------- */

html {
  font-size: 17px;
}

body {
  background-color: var(--page-bg);
  font-family: var(--font-sans);
  color: var(--global-text-color);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: -0.004em;
}

h1, h2, h3, h4, h5, h6,
.page__title, .archive__item-title, .masthead, .page__footer,
.author__name, .author__bio, .btn, button, input, select, textarea {
  font-family: var(--font-sans);
}

h1, h2, h3, h4, h5, h6 {
  color: var(--heading-color);
  font-weight: 650;
  letter-spacing: -0.021em;
  line-height: 1.25;
}

.page__content p,
.page__content li,
.archive p,
.archive li {
  line-height: 1.7;
}

.page__content a,
.archive a {
  text-underline-offset: 0.18em;
  text-decoration-thickness: 1px;
  transition: color 0.15s ease;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* --------------------------------------------------------------------------
   3. Masthead — thin, translucent, hairline bottom
   -------------------------------------------------------------------------- */

/* The theme already fixes the masthead and pads the body by its height; keep
   that positioning and only restyle the surface. */
.masthead {
  background-color: rgba(251, 251, 253, 0.82);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  backdrop-filter: saturate(180%) blur(18px);
  border-bottom: 1px solid var(--hairline);
}

.masthead__inner-wrap {
  padding-top: 0.5em;
  padding-bottom: 0.5em;
}

/* The theme paints each nav item with the page background; clear it so the
   translucent bar reads as one surface. */
.masthead__menu-item,
.greedy-nav {
  background: transparent;
}

.greedy-nav a {
  font-weight: 500;
  letter-spacing: 0.005em;
  color: var(--global-masthead-link-color);
}

.greedy-nav a:hover {
  color: var(--accent);
}

.greedy-nav .site-title {
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--heading-color);
}

.greedy-nav .visible-links a:before {
  height: 2px;
  background: var(--accent);
}

.greedy-nav button {
  background-color: transparent;
}

/* The hamburger is a .navicon div (plus its :before/:after bars) that the theme
   hard-codes to #fff for a dark masthead. This masthead is light, so the bars
   were invisible. `.close .navicon` must stay transparent - that is the middle
   bar hidden to form the X - so it is excluded. */
.greedy-nav button:not(.close) .navicon,
.greedy-nav .navicon:before,
.greedy-nav .navicon:after {
  background: var(--global-masthead-link-color);
}

.greedy-nav button:hover:not(.close) .navicon,
.greedy-nav button:hover .navicon:before,
.greedy-nav button:hover .navicon:after {
  background: var(--accent);
}

.greedy-nav .hidden-links {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-md);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.10);
}

.greedy-nav .hidden-links a {
  color: var(--global-text-color);
}

.greedy-nav .hidden-links a:hover {
  color: var(--accent);
  background: var(--surface-muted);
}


/* --------------------------------------------------------------------------
   4. Author sidebar
   -------------------------------------------------------------------------- */

.author__avatar img {
  border-radius: 50%;
  border: 1px solid var(--hairline);
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.10);
  max-width: 155px;
  height: auto;          /* the img carries width/height attributes */
  aspect-ratio: 1 / 1;   /* stays a circle even if a non-square file lands */
  object-fit: cover;
  object-position: 50% 35%;
}

/* On the homepage the hero already leads with the name and title, so the
   sidebar copy would only compete with the research message. Every other page
   keeps it (author-profile.html adds the modifier). */
.author__content--home .author__name,
.author__content--home .author__pronouns,
.author__content--home .author__bio {
  display: none;
}

.author__name {
  margin: 0.55em 0 0;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--heading-color);
}

.author__bio {
  margin: 0.1em 0 0;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.author__pronouns {
  display: none;
}

.author__urls-wrapper button {
  border-radius: 8px;
  border: 1px solid var(--hairline);
}

/* Plain list rather than a floating bordered card: on a near-white page the
   card outline read as clutter next to the avatar. */
/* Desktop (>= the theme's $large): the links are a plain list in the sidebar,
   so drop the card chrome. */
@media screen and (min-width: 925px) {
  .author__urls {
    border: none;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    padding: 0;
    margin-top: 1.1em;
  }
}

/* Below that the theme turns the same list into a dropdown under the
   "Contact & Links" button. It needs to stay a solid, legible card that sits
   above the page content - the theme ships it at z-index: -1, which puts it
   behind the article. */
@media screen and (max-width: 924px) {
  .author__urls {
    z-index: 20;
    min-width: 200px;
    padding: 0.65em 0.95em;
    border: 1px solid var(--hairline);
    border-radius: var(--radius-md);
    background: var(--surface);
    box-shadow: 0 14px 34px rgba(16, 24, 40, 0.22);
  }

  .author__urls-wrapper {
    z-index: 30;
  }

  /* The theme puts transform: translate3d(0,0,0) on .sidebar, which creates a
     stacking context - so the dropdown's own z-index cannot lift it above the
     article. Raise the whole sidebar context instead. */
  .sidebar {
    position: relative;
    z-index: 25;
  }
}

.author__urls li {
  padding: 0;
  margin-bottom: 0.42em;
  font-size: 0.85rem;
  line-height: 1.5;
  white-space: normal;
}

.author__urls li:last-child {
  margin-bottom: 0;
}

/* Location and employer are context, not links — keep them lighter and set
   them apart from the profile links below. */
.author__urls li.author__desktop {
  color: var(--text-secondary);
  font-size: 0.8rem;
}

.author__urls li.author__desktop:last-of-type {
  margin-bottom: 0.75em;
  padding-bottom: 0.75em;
  border-bottom: 1px solid var(--hairline);
}

.author__urls a {
  color: var(--global-text-color);
  font-weight: 500;
  text-decoration: none;
}

.author__urls a:hover {
  color: var(--accent);
  text-decoration: none;
}

/* Fixed-width icon column so the labels line up regardless of glyph width
   (Font Awesome and Academicons render at different widths). */
.author__urls i,
.author__urls .fa,
.author__urls .fas,
.author__urls .fab,
.author__urls .ai {
  display: inline-block;
  width: 1.3em;
  margin-right: 0.35em;
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.95em;
}

.author__urls a:hover i {
  color: var(--accent);
}

/* Side-project links sit in the same list as the contact links, so mark the
   boundary with the hairline the rest of the sidebar uses. */
.author__urls .author__tool--first {
  margin-top: 0.55em;
  padding-top: 0.55em;
  border-top: 1px solid var(--hairline);
}

/* Self-citation filtering on the publications page, wired by
   _includes/citation-links.html. Clicking an entry narrows the list to that paper
   and the work it is connected to by citation; clicking anywhere else restores it.

   Not scoped under .page__content: publications.md uses `layout: archive`, whose
   container is .archive, so a .page__content prefix silently matches nothing on
   this page. */
/* Both states must occupy the same height, or clearing the filter shifts the
   whole list under a reader whose scroll position was just restored. */
.pub-filter {
  display: flex;
  align-items: center;
  gap: 0.75em;
  height: 2.4em;
  margin: 0 0 0.4em;
  font-size: 0.82em;
  color: var(--text-secondary);
  white-space: nowrap;
}

.pub-filter__on {
  display: flex;
  align-items: center;
  gap: 0.7em;
}

.pub-filter__on b {
  color: var(--heading-color);
  font-weight: 600;
}

.pub-filter__on b i {
  font-style: normal;
  font-weight: 700;
  color: var(--accent);
}

.pub-filter__on b em {
  font-style: normal;
  font-weight: 400;
  color: var(--text-secondary);
  padding: 0 0.5em;
}

.pub-filter__on button {
  appearance: none;
  border: 1px solid var(--hairline);
  background: var(--surface);
  color: var(--text-secondary);
  border-radius: 20px;
  padding: 0.1em 0.75em;
  font: inherit;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}

.pub-filter__on button:hover,
.pub-filter__on button:focus-visible {
  color: var(--heading-color);
  border-color: var(--accent);
}

/* The rows have to read as pressable without turning the list into a grid of
   cards - a tint on hover and a rule down the left edge is enough. */
.publications-list li.is-linked {
  cursor: pointer;
  border-radius: var(--radius-md);
  box-shadow: inset 0 0 0 0 transparent;
  transition: background 0.15s, box-shadow 0.15s;
}

.publications-list li.is-linked:hover {
  background: var(--surface-muted);
}

.publications-list li.is-linked:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.publications-list li.is-selected {
  background: var(--accent-soft);
  box-shadow: inset 3px 0 0 var(--accent);
}

/* Direction marker, added to each surviving row while a paper is selected.
   Absolutely placed so it cannot reflow the entry's own text - the rows are
   hand-written markdown paragraphs, not a grid with a spare column. The row then
   has to reserve the width, or a title that wraps to a second line runs its
   badges underneath the marker (the Oral badge on Reasoning by Exploration did). */
.publications-list li.is-linked,
.publications-list li.is-selected {
  position: relative;
}

.publications-list.is-filtered li {
  padding-right: 7em;
}

.pub-rel {
  position: absolute;
  top: 0.55em;
  right: 0.1em;
  display: inline-flex;
  align-items: center;
  gap: 0.3em;
  padding: 0.1em 0.6em;
  border: 1px solid var(--hairline);
  border-radius: 20px;
  background: var(--surface);
  font-size: 0.72em;
  line-height: 1.7;
  white-space: nowrap;
  color: var(--text-secondary);
  pointer-events: none;
}

.pub-rel i {
  font-style: normal;
  font-weight: 700;
}

/* Cites the selection: newer work, sitting above it in the list. */
.pub-rel--in {
  color: var(--accent);
  border-color: var(--accent);
}

/* Cited by the selection: earlier work it builds on. */
.pub-rel--out i {
  color: var(--text-secondary);
}

/* The marker overlaps the badges on a narrow column, so give it the row to
   itself there rather than letting the two collide. */
@media screen and (max-width: 700px) {
  .pub-rel {
    position: static;
    display: inline-flex;
    margin-top: 0.4em;
  }

  .publications-list.is-filtered li {
    padding-right: 0;
  }
}

/* While filtered, the survivors are the point; drop the year rules back so the
   remaining entries read as one set rather than as scattered leftovers. */
.publications-list.is-filtered h3 {
  opacity: 0.55;
}

/* Topic badges double as filters. They keep their tint at rest (a row full of
   outlined buttons would shout), and show it on hover and while active. */
.publications-list .pub-badge[data-topic] {
  cursor: pointer;
  transition: box-shadow 0.15s, filter 0.15s;
}

.publications-list .pub-badge[data-topic]:hover {
  filter: brightness(0.95);
}

.publications-list .pub-badge[data-topic]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.publications-list .pub-badge.is-active {
  box-shadow: inset 0 0 0 1.5px currentColor;
}

@media (max-width: 600px) {
  /* The idle prompt is two clauses now; let it wrap rather than clip. */
  .pub-filter {
    height: auto;
    min-height: 2.4em;
    white-space: normal;
    line-height: 1.35;
  }
}

@media (prefers-reduced-motion: reduce) {
  .publications-list li.is-linked { transition: none; }
}

/* Visitor map (MapMyVisitors widget, injected by _includes/author-profile.html).
   The widget writes its own inline <style>, so this only positions it, sets the
   typography, and reorders the count under the map. --vm-ocean is set inline on
   the element from `visitor_map.ocean_color`. */
/* Left-aligned, not centred in the column: the avatar, the icons and the link
   text all start at the sidebar's left edge, and a centred map broke that line.
   The 200px cap is what w=a measures, so it also sets the rendered map width. */
.visitor-map {
  margin: 1.4em 0 0;
  padding-top: 1.2em;
  border-top: 1px solid var(--hairline);
  max-width: 200px;
}

.visitor-map #mapmyvisitors-widget {
  margin: 0;
  min-height: 0;
}

/* The widget stacks count, date, then map. A caption reads better under the
   graphic than floating above it, so flip the order. */
.visitor-map .mapmyvisitors-map-container {
  display: flex;
  flex-direction: column;
}

.visitor-map .mapmyvisitors-map {
  order: 1;
  border-radius: 8px;
  overflow: hidden;
}

.visitor-map .mapmyvisitors-visitors {
  order: 2;
}

/* The count is hidden for now: a small total under the map reads as "new page"
   to every visitor, in the one year that matters. Delete this rule to show it
   again; the styling below is kept for that day. */
.visitor-map .mapmyvisitors-visitors {
  display: none;
}

/* The count is white-on-teal in the vendor's default palette; on a pale map it
   has to be dark. Match the rest of the sidebar rather than the widget. */
.visitor-map .mapmyvisitors-visitors {
  font-family: var(--font-sans) !important;
  font-size: 11px !important;
  color: var(--text-secondary) !important;
  letter-spacing: 0.01em;
  padding-top: 0.55em;
  text-transform: none !important;
  text-align: left !important;
}

/* Date line is suppressed by t=tt, but the element is still in the flow. */
.visitor-map .mapmyvisitors-date {
  display: none !important;
}

/* The widget ships a red gradient "click to see details" button that clashes
   with the palette; the map itself is the link, so drop it. */
.visitor-map .mapmyvisitors-bottom-text {
  display: none !important;
}

/* jVectorMap draws the visitor dots at fill-opacity 0.7, which washes any
   configured colour out towards the land tone - at 200px the dots then read as
   smudges rather than points. Nearly opaque, with a little left for overlap. */
.visitor-map .jvectormap-marker {
  fill-opacity: 0.92;
}

/* The map face is a server-generated PNG
   (mapmyvisitors.com/generated_content/backs/bg-w_<w>-co_<co>-cl_<cl>.png) with
   +/- zoom controls painted into the image itself - there are no zoom elements
   in the DOM to hide, and only w/co/cl feed that filename. They are decorative
   here: the whole widget is one <a>, so clicking "+" navigates to the stats page
   rather than zooming. Cover them with a patch in the water colour. Measured
   against the 200x98 render the controls sit at x 4-20, y 61-93; percentages
   keep the patch aligned when w=a resolves to another width. */
.visitor-map .mapmyvisitors-map::after {
  content: "";
  position: absolute;
  left: 0;
  width: 12%;
  top: 58%;
  bottom: 0;
  background: var(--vm-ocean, #ffffff);
  z-index: 2;
  pointer-events: none;
}

/* Under the theme's $large breakpoint the sidebar becomes a header strip and
   the links collapse into the "Contact & Links" dropdown - a 200px map there
   just pushes the article down. */
@media screen and (max-width: 924px) {
  .visitor-map {
    display: none;
  }
}

/* --------------------------------------------------------------------------
   5. Page surface & headings
   -------------------------------------------------------------------------- */

#main {
  margin-top: 0.25em;
}

.page,
.archive {
  background: transparent;
}

/* The theme reserves a 2/12 right gutter for a TOC sidebar this site doesn't
   use, which leaves the text column unnecessarily narrow. */
@media screen and (min-width: 925px) {
  .page,
  .archive {
    padding-right: 0;
  }
}

.page__title,
.archive h1.page__title {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 0.45em;
  padding-bottom: 0;
  border-bottom: none;
}

/* Section headings sit above a short accent rule with a small "node" at its
   end — a quiet nod to the graph theme. */
.page__content h1:not(.hero__name),
.page__content h2 {
  position: relative;
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  margin-top: 1.45em;
  margin-bottom: 0.75em;
  padding-bottom: 0.42em;
}

.page__content h1:not(.hero__name):after,
.page__content h2:after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 46px;
  height: 3px;
  border-radius: 2px;
  background: var(--accent);
}

.page__content h1:not(.hero__name):before,
.page__content h2:before {
  content: "";
  position: absolute;
  left: 52px;
  bottom: -1px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.55;
}

.page__content h3 {
  font-size: 1.08rem;
  margin-top: 1.7em;
}

/* --------------------------------------------------------------------------
   6. Homepage hero
   -------------------------------------------------------------------------- */

.hero {
  position: relative;
  padding: 0 0 0.1em;
  overflow: hidden;
}

.hero__name {
  display: flex;
  align-items: center;
  gap: 1.1em;
  margin: 0 0 0.14em;
  font-size: 2.35rem;
  font-weight: 700;
  letter-spacing: -0.033em;
  line-height: 1.12;
}

/* The research pitch is the hero message; the credential line supports it.
   Both scoped under .page__content, whose `p` rule is more specific than a
   bare class and would otherwise re-add margins. */
.page__content .hero__pitch {
  margin: 0.28em 0 0.3em;
  font-size: 1.32rem;
  font-weight: 650;
  line-height: 1.35;
  letter-spacing: -0.021em;
  color: var(--heading-color);
}

.page__content .hero__tagline {
  margin: 0;
  font-size: 0.93rem;
  color: var(--text-secondary);
}

/* The heading right after the hero needs far less air than a mid-page one. */
.hero + h1,
.hero + h2 {
  margin-top: 0.55em;
}


/* graph -> agent -> social good, set beside the name so it reads at size */
.hero__name:after {
  content: "";
  flex: 0 0 auto;
  margin-left: auto;
  position: relative;
  top: 18px;
  width: 232px;
  height: 96px;
  opacity: 0.7;
  background-repeat: no-repeat;
  background-size: contain;
  background-position: left center;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='320' height='132' viewBox='0 0 320 132'><g stroke='%23146b74' stroke-width='1' opacity='0.32' fill='none'><path d='M16 92 L52 54 L92 80'/><path d='M52 54 L58 24'/><path d='M16 92 L58 24'/><path d='M92 80 L58 24'/></g><g fill='%23146b74' opacity='0.42'><circle cx='16' cy='92' r='3.8'/><circle cx='52' cy='54' r='4.8'/><circle cx='92' cy='80' r='3.8'/><circle cx='58' cy='24' r='3.4'/></g><g stroke='%23146b74' stroke-width='1' opacity='0.26' fill='none' stroke-linecap='round'><path d='M102 62 L126 62'/><path d='M120 57 L126 62 L120 67'/></g><g stroke='%23146b74' stroke-width='1.2' opacity='0.34' fill='none' stroke-linecap='round'><path d='M166 28 L166 40'/><rect x='140' y='40' width='52' height='42' rx='12'/><path d='M134 54 L134 68'/><path d='M198 54 L198 68'/><path d='M156 72 L176 72'/></g><g fill='%23146b74' opacity='0.42'><circle cx='166' cy='25' r='2.8'/><circle cx='155' cy='57' r='3.2'/><circle cx='177' cy='57' r='3.2'/></g><g stroke='%23146b74' stroke-width='1' opacity='0.26' fill='none' stroke-linecap='round'><path d='M206 62 L230 62'/><path d='M224 57 L230 62 L224 67'/></g><g fill='%23146b74' opacity='0.34' transform='translate(254,8) scale(1.2)'><path d='M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z'/></g><g stroke='%23146b74' stroke-width='1.2' opacity='0.34' fill='none' stroke-linecap='round'><circle cx='244' cy='62' r='7'/><path d='M232 88 c0 -10 24 -10 24 0'/><circle cx='268' cy='57' r='8'/><path d='M254 86 c0 -11 28 -11 28 0'/><circle cx='292' cy='63' r='6.5'/><path d='M281 88 c0 -9 22 -9 22 0'/></g></svg>");
}

@media (max-width: 900px) {
  .hero__name:after { display: none; }
}

/* Job-market note: kept in its own warm red on purpose - it is the one thing
   on the page that must not be missed, and on the teal it read as decoration. */
.page__content .job-market-note {
  margin: 1.25em 0 0;
  padding: 0.7em 1.05em;
  border-left: 3px solid #c0392b;
  border-radius: 8px;
  background-color: #fbf1ef;
  color: #8a382f;
  font-size: 1rem;
  font-weight: 550;
  line-height: 1.55;
}

.page__content .job-market-note strong {
  color: #7d332c;
  font-weight: 650;
}

.page__content .job-market-note a {
  color: #7d332c;
  font-weight: 600;
  white-space: nowrap;
}

.job-market-sep {
  margin: 0 0.15em;
  opacity: 0.5;
}

.job-market-note + h1,
.job-market-note + h2 {
  margin-top: 1.15em;
}

/* --------------------------------------------------------------------------
   7. Research map — root / branch / leaf hierarchy with a details panel
   -------------------------------------------------------------------------- */

.rmap { margin-top: 0.4em; margin-bottom: 1.6em; }

.rmap__graph { text-align: center; }

/* Root */
.rmap__root {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  gap: 0.15em;
  padding: 0.6em 1.4em;
  border: 1px solid var(--hairline);
  border-top: 3px solid var(--accent);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
}

.rmap__root-label {
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: -0.018em;
  color: var(--heading-color);
}

.rmap__root-sub {
  font-size: 0.76rem;
  color: var(--text-secondary);
  letter-spacing: 0.02em;
}

/* Connector: root down to the branch rail */
.rmap__root:after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  width: 1px;
  height: 20px;
  background: var(--hairline);
}

/* Branch row */
.rmap__branches {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.9em;
  margin: 40px 0 0;
  padding: 0;
  list-style: none;
  text-align: left;
}

/* Horizontal rail spanning the three branch centres */
.rmap__branches:before {
  content: "";
  position: absolute;
  top: -20px;
  left: 16.667%;
  right: 16.667%;
  height: 1px;
  background: var(--hairline);
}

.rmap__branch {
  position: relative;
  margin: 0;
}

/* Connector: rail down to each branch node */
.rmap__branch:before {
  content: "";
  position: absolute;
  top: -20px;
  left: 50%;
  width: 1px;
  height: 20px;
  background: var(--hairline);
}

.rmap__branch-node {
  padding: 0.5em 0.85em;
  border: 1px solid var(--hairline);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-md);
  background: var(--surface);
  font-size: 0.92rem;
  font-weight: 650;
  letter-spacing: -0.012em;
  color: var(--heading-color);
  text-align: center;
  transition: box-shadow 0.18s ease, border-color 0.18s ease;
}

.rmap__branch.is-active .rmap__branch-node {
  border-color: var(--accent);
  box-shadow: 0 3px 12px rgba(20, 107, 116, 0.10);
}

/* Leaf column: a vertical spine with short stubs into each leaf */
.rmap__leaves {
  position: relative;
  margin: 0;
  padding: 18px 0 0 26px;
  list-style: none;
}

.rmap__leaves:before {
  content: "";
  position: absolute;
  top: 0;
  left: 12px;
  bottom: 18px;
  width: 1px;
  background: var(--hairline);
}

.rmap__leaf-item {
  position: relative;
  margin: 0 0 0.4em;
}

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

.rmap__leaf-item:before {
  content: "";
  position: absolute;
  left: -14px;
  top: 50%;
  width: 14px;
  height: 1px;
  background: var(--hairline);
}

.rmap__leaf {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4em;
  width: 100%;
  padding: 0.4em 0.6em 0.4em 0.7em;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: var(--surface);
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 550;
  line-height: 1.35;
  color: var(--global-text-color);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.rmap__leaf:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

/* Persistent affordance: every leaf carries a chevron so it reads as openable
   without needing hover. */
.rmap__leaf:after {
  content: "›";
  flex: 0 0 auto;
  font-size: 1.05em;
  line-height: 1;
  color: var(--text-secondary);
  opacity: 0.65;
  transition: transform 0.15s ease, color 0.15s ease;
}

.rmap__leaf:hover:after { color: var(--accent); opacity: 1; }

.rmap__leaf.is-active:after {
  content: "⌄";
  color: var(--accent);
  opacity: 1;
}

.rmap__leaf:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.rmap__leaf.is-active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 650;
}

/* Details panel */
.rmap__panel {
  margin-top: 1.1em;
  padding: 0.95em 1.1em 1em;
  border: 1px solid var(--hairline);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.rmap__panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.6em;
}

/* An h3 (the panel sits under the "Research" h2), so this must outrank the
   generic .page__content h3 rule that would otherwise re-add margin-top. */
.rmap .rmap__panel-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--heading-color);
}

.rmap__panel-title:focus { outline: none; }

.rmap__panel-crumb {
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.85rem;
}

.rmap__close {
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 1.15rem;
  line-height: 1;
  padding: 0 0.15em;
  cursor: pointer;
}

.rmap__close:hover { color: var(--accent); }

.rmap .rmap__panel-desc {
  margin: 0.35em 0 0.75em;
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--text-secondary);
}

.rmap__works {
  list-style: none;
  margin: 0;
  padding: 0;
}

.rmap .rmap__work {
  padding: 0.4em 0;
  border-top: 1px solid var(--hairline);
  font-size: 0.86rem;
  line-height: 1.55;
}

.rmap__work-title,
.rmap__work-full {
  font-weight: 650;
  color: var(--heading-color);
  margin-right: 0.35em;
}

.rmap__work-full { font-weight: 600; }

.rmap__work-link {
  margin-left: 0.5em;
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
}

.rmap__work-link:hover { text-decoration: underline; }

.rmap__work-link--muted {
  color: var(--text-secondary);
}

.rmap__tag {
  margin-left: 0.3em;
  padding: 0 5px;
  border: 1px solid var(--hairline);
  border-radius: 4px;
  font-size: 0.66rem;
  font-weight: 600;
  color: var(--text-secondary);
  vertical-align: 0.08em;
}

.rmap__also {
  display: block;
  margin-top: 0.1em;
  font-size: 0.74rem;
  color: var(--text-secondary);
}

/* Panel foot: the expand toggle and the link out to the publications page,
   after the list they refer to. */
.rmap__panel-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6em 1.1em;
  margin-top: 0.8em;
}

/* .page__content prefix: the theme underlines every content link at (0,1,1),
   which a bare class cannot override. */
.page__content .rmap__all-link {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
}

.rmap__all-link:after {
  content: "\2197";           /* north-east arrow: leaves the page */
  margin-left: 0.3em;
  font-size: 0.85em;
  opacity: 0.7;
}

.page__content .rmap__all-link:hover {
  text-decoration: underline;
}

.rmap__more-btn {
  padding: 0.3em 0.85em;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  background: var(--surface);
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent);
  cursor: pointer;
}

.rmap__more-btn:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.rmap__works--all { margin-top: 0.5em; }

/* Screen-reader-only text for link context */
.rmap__sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (prefers-reduced-motion: reduce) {
  .rmap__leaf,
  .rmap__leaf:after,
  .rmap__branch-node { transition: none; }
}

/* Tablet: tighten the three columns */
@media (max-width: 900px) {
  .rmap__branches { gap: 0.6em; }
  .rmap__branch-node { font-size: 0.85rem; padding: 0.45em 0.5em; }
  .rmap__leaf { font-size: 0.78rem; }
  .rmap__leaves { padding-left: 20px; }
}

/* Mobile: stack into a nested tree instead of squeezing three columns */
@media (max-width: 680px) {
  /* Panel is moved under its own leaf on this layout (see research-map.html) */
  .rmap__leaf-item .rmap__panel {
    margin: 0.55em 0 0.7em -14px;
  }

  /* The panel is far narrower here than on desktop, so step the type down. */
  .rmap__panel {
    padding: 0.8em 0.85em 0.85em;
  }

  .rmap__panel-title { font-size: 0.9rem; }
  .rmap__panel-crumb { font-size: 0.76rem; }
  .rmap .rmap__panel-desc {
    font-size: 0.79rem;
    line-height: 1.5;
    margin-bottom: 0.6em;
  }

  .rmap .rmap__work {
    font-size: 0.78rem;
    line-height: 1.5;
    padding: 0.35em 0;
  }

  .rmap__work-title,
  .rmap__work-full { font-size: 0.82rem; }

  .rmap__work-link { font-size: 0.72rem; margin-left: 0.4em; }
  .rmap__also { font-size: 0.68rem; }
  .rmap__panel .pub-badge { font-size: 0.63rem; padding: 0 6px; }
  .rmap__more-btn { font-size: 0.72rem; padding: 0.25em 0.7em; }
  .rmap__all-link { font-size: 0.72rem; }

  .rmap__graph { text-align: left; }

  .rmap__root { display: flex; width: 100%; text-align: left; }
  .rmap__root:after { left: 20px; }

  .rmap__branches {
    grid-template-columns: 1fr;
    gap: 1.4em;
    margin-top: 34px;
  }

  .rmap__branches:before { display: none; }

  .rmap__branch:before { left: 20px; }

  .rmap__branch-node { text-align: left; }
}

/* --------------------------------------------------------------------------
   8. Badges — soft tinted chips
   -------------------------------------------------------------------------- */

.pub-badge {
  display: inline-block;
  padding: 1px 8px;
  margin: 0 3px 3px 0;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 1.7;
  white-space: nowrap;
  vertical-align: 0.06em;
  text-decoration: none !important;
  transition: background-color 0.15s ease;
}

a.pub-badge:hover {
  text-decoration: none !important;
}

.badge-graphlearning { /* Graph Learning: Effectiveness / Efficiency / Labeling / Robustness */
  background-color: #e8eef8;
  color: #2c4570;
}

.badge-llmgraph { /* LLM-Graph: Graph4LLM (Reasoning, GraphRAG) / LLM4Graph */
  background-color: #e2f0f1;
  color: #12626b;
}

.badge-interdisciplinary { /* Interdisciplinary: E-Commerce / Education / Science */
  background-color: #f1eaf8;
  color: #5b3f80;
}

.badge-oral {
  background-color: #fbf0d6;
  color: #8a6100;
}

/* Venue chips linking from the homepage into the publications list. */
.badge-link {
  background-color: var(--surface-muted);
  color: #3f4b52;
}

a.badge-link:hover {
  background-color: var(--accent-soft);
  color: var(--accent);
}

/* --------------------------------------------------------------------------
   9. Publications list
   -------------------------------------------------------------------------- */

.pub-note {
  margin: 0 0 1.2em;
  color: var(--text-secondary);
  font-size: 0.8rem;
}

.pub-note sup {
  font-weight: 700;
  color: var(--heading-color);
}

.publications-list h3 {
  margin-top: 2.3em;
  margin-bottom: 0.4em;
  padding-bottom: 0.25em;
  border-bottom: 1px solid var(--hairline);
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text-secondary);
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.publications-list h2 {
  margin-top: 2.5em;
  font-size: 1.3rem;
}

.publications-list ul {
  list-style: none;
  margin-left: 0;
  padding-left: 0;
}

.publications-list li {
  position: relative;
  margin: 0;
  padding: 0.95em 0.9em 0.95em 0.95em;
  border-bottom: 1px solid var(--hairline);
  border-radius: var(--radius-md);
  line-height: 1.6;
  font-size: 0.94rem;
  color: var(--text-secondary);
  transition: background-color 0.15s ease;
}

.publications-list li:before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.8em;
  bottom: 0.8em;
  width: 3px;
  border-radius: 3px;
  background: var(--accent);
  opacity: 0;
  transition: opacity 0.15s ease;
}

.publications-list li:hover {
  background-color: var(--surface);
}

.publications-list li:hover:before {
  opacity: 1;
}

.publications-list li:last-child {
  border-bottom: none;
}

/* kramdown renders these as a loose list, wrapping each entry in <p>. */
.publications-list li p {
  margin: 0;
}

/* Titles read as headings whether or not they link out; the link only reveals
   itself on hover. */
/* Note: each entry opens with an empty <a id="slug"> anchor, so the title link
   is matched by a[href] — not a:first-of-type. */
.publications-list li p > strong:first-of-type,
.publications-list li a[href],
.publications-list li a[href] strong {
  font-size: 1rem;
  font-weight: 650;
  color: var(--heading-color);
}

.publications-list li a[href] {
  text-decoration: none;
}

.publications-list li a[href]:hover,
.publications-list li a[href]:hover strong {
  color: var(--accent);
  text-decoration: underline;
}

/* Code / Resources / Dataset links appended after the taxonomy badges. Boxed
   outlines so they read as actions, distinct from both the title link and the
   filled taxonomy badges. */
.publications-list li .pub-links a,
.pub-links a {
  display: inline-block;
  padding: 0 7px;
  margin: 0 2px 3px 0;
  border: 1px solid var(--hairline);
  border-radius: 5px;
  background: var(--surface);
  font-size: 0.68rem;
  font-weight: 600;
  line-height: 1.75;
  letter-spacing: 0.01em;
  color: var(--accent);
  text-decoration: none;
  vertical-align: 0.06em;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.publications-list li .pub-links a:hover,
.pub-links a:hover {
  border-color: var(--accent);
  background-color: var(--accent-soft);
  text-decoration: none;
}

/* Deep-link anchors clear the sticky masthead. */
.publications-list li a[id] {
  scroll-margin-top: 90px;
}

/* --------------------------------------------------------------------------
   10. News rows
   -------------------------------------------------------------------------- */

/* Year labels on the full news page, matching the publications list. */
.news-list h3 {
  margin-top: 2.1em;
  margin-bottom: 0.3em;
  padding-bottom: 0.25em;
  border-bottom: 1px solid var(--hairline);
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text-secondary);
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.news-list h3:first-child {
  margin-top: 0.4em;
}

/* Rows whose label is a term or venue ("Spring 2026", "WSDM 2026") rather
   than a month need a wider column. */
.news-list--wide li p {
  padding-left: 7.6em;
  text-indent: -7.6em;
}

.news-list--wide .news-date {
  width: 6.6em;
}

.news-list ul {
  list-style: none;
  margin-left: 0;
  padding-left: 0;
}

.news-list li {
  padding: 0.62em 0;
  border-bottom: 1px solid var(--hairline);
}

.news-list li:last-child { border-bottom: none; }

/* Hanging indent keeps wrapped lines aligned under the text rather than sliding
   back under the date. (Grid can't be used here: kramdown emits the item as one
   <p> of mixed inline content, and each inline element would become its own
   grid item.) */
.news-list li p {
  margin: 0;
  padding-left: 6.2em;
  text-indent: -6.2em;
  font-size: 0.9rem;
  line-height: 1.62;
  color: var(--global-text-color);
}

.news-date {
  display: inline-block;
  width: 5.2em;
  margin-right: 1em;
  text-indent: 0;
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  vertical-align: 0.05em;
}

/* Paper titles read as text first, links second. */
.news-list li a {
  color: var(--heading-color);
  text-decoration: none;
}

.news-list li a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.news-list li strong {
  font-weight: 600;
}

@media (max-width: 600px) {
  .news-list li p {
    padding-left: 0;
    text-indent: 0;
  }
  .news-date {
    display: block;
    width: auto;
    margin: 0 0 0.15em;
  }
}

/* --------------------------------------------------------------------------
   11. Buttons & footer
   -------------------------------------------------------------------------- */

.section-action {
  margin: 1.5em 0 0.4em;
}

/* Space below the map. Set on .rmap itself: the include emits <noscript>/<script>
   after the graph, so an adjacent-sibling selector never matches the button. */
.rmap {
  margin-bottom: 1.6em;
}

.btn-pill {
  display: inline-block;
  padding: 0.45em 1.15em;
  border-radius: 999px;
  border: 1px solid var(--hairline);
  background-color: var(--surface);
  color: var(--accent) !important;
  font-size: 0.83rem;
  font-weight: 600;
  text-decoration: none !important;
  transition: all 0.15s ease;
}

.btn-pill:hover {
  border-color: var(--accent);
  background-color: var(--accent-soft);
}

.page__footer {
  background-color: transparent;
  border-top: 1px solid var(--hairline);
  color: var(--text-secondary);
  font-size: 0.8rem;
}

.page__footer a {
  color: var(--text-secondary);
}

.page__footer a:hover {
  color: var(--accent);
}

/* --------------------------------------------------------------------------
   12. Small screens
   -------------------------------------------------------------------------- */

@media (max-width: 600px) {
  html { font-size: 16px; }

  .hero__name { font-size: 1.85rem; }
  .page__content .hero__pitch { font-size: 1.1rem; }

  .page__title,
  .archive h1.page__title { font-size: 1.65rem; }

  .page__content h1,
  .page__content h2 { font-size: 1.24rem; }

  .publications-list li {
    padding-left: 0.7em;
    padding-right: 0;
  }

  .pub-badge { font-size: 0.68rem; }

  /* Paper / Code / Dataset links are the only tappable chips in the list;
     WCAG 2.2 wants at least 24px, and 0.68rem text at line-height 1.75 gave
     them 19. Padding rather than font size, so the row's look is unchanged. */
  .publications-list li .pub-links a,
  .pub-links a {
    padding-top: 3px;
    padding-bottom: 3px;
  }

  .news-list--wide li p {
    padding-left: 0;
    text-indent: 0;
  }
}

/* ---- /research/ page -------------------------------------------------------
   Reuses the publications list rows; these rules only cover what that page
   adds: the topic index, per-topic descriptions and the links back to the
   publications page. */
.research-toc {
  margin: 1.2em 0 0.4em;
  font-size: 0.9rem;
  color: var(--text-secondary);
}
.research-toc p { margin: 0.25em 0; }

.research-list h2 { scroll-margin-top: 4.5rem; }
.research-list h3 { scroll-margin-top: 4.5rem; }

.research-list > p {
  font-size: 0.95rem;
  color: var(--text-secondary);
}
.research-list .research-list__desc { margin: 0 0 0.2em; }

.publications-list li a.research-list__details {
  margin-left: 0.4em;
  font-size: 0.74rem;
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
}

.research-list .research-list__more {
  margin: 0.2em 0 0;
  font-size: 0.82rem;
}
