/* Chunlin Tian's homepage: shared styles for every page.
   Saira Semi Condensed for headings and numbers, Source Serif 4 for everything else;
   hairline rules, colour only for links and paper types;
   type, measure and gutters scale with the viewport. */
:root{
  --ink: #1c1d22;
  --text: #34363e;
  --muted: #6f7380;
  --rule: #e6e3dc;
  --link: #245a8c;
  --link-hover: #143d63;
  --accent: #245a8c;
  /* publication types: algorithms warm, systems cool */
  --alg: #c2622d;
  --sys: #23806d;
  --gold: #8a5d0a;
  --gold-soft: #fbf1dc;
  --bg: #ffffff;
  --tint: #f5f6f8;
  --rule-strong: #d9d5cc;
  --shadow: 0 1px 2px rgba(20, 28, 40, 0.04), 0 10px 30px rgba(20, 28, 40, 0.07);

  --font: 'Source Serif 4', 'Source Serif Pro', Georgia, 'Times New Roman', serif;
  --font-head: 'Saira Semi Condensed', 'Arial Narrow', Arial, sans-serif;
  --maxw: 66rem;
  --label-w: 5.4rem;
  --label-gap: 22px;
  --gutter: clamp(18px, 4vw, 32px);
  --pad-l: max(var(--gutter), env(safe-area-inset-left, 0px));
  --pad-r: max(var(--gutter), env(safe-area-inset-right, 0px));
}

*{ box-sizing: border-box; }
html{
  /* Source Serif 4 sets a little small: ~15.5px on phones, ~16.5px on a laptop, up to 17.5px on wide monitors */
  font-size: clamp(15.5px, 14.3px + 0.18vw, 17.5px);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}
button{ font-family: inherit; }
img{ max-width: 100%; }

body{
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

.container{
  max-width: calc(var(--maxw) + var(--pad-l) + var(--pad-r));
  margin: 0 auto;
  padding: clamp(24px, 4.5vw, 48px) var(--pad-r) clamp(40px, 7vw, 72px) var(--pad-l);
}

a{ color: var(--link); text-decoration: none; transition: color 0.15s; }
a:hover{ color: var(--link-hover); text-decoration: underline; text-underline-offset: 2px; }

h1, h2, h3{ color: var(--ink); margin: 0; font-family: var(--font-head); font-weight: 600; letter-spacing: 0.005em; text-wrap: balance; }
h1{ font-weight: 700; }
p{ margin: 0 0 0.75em; }
::selection{ background: #d8e6f4; }

h2{
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: clamp(36px, 5vw, 56px) 0 1.1rem;
  padding-bottom: 0.5rem;
  position: relative;
  font-size: 1.4rem;
  line-height: 1.25;
  border-bottom: 1px solid var(--rule);
}
h2::after{
  content: "";
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 2.25rem;
  height: 2px;
  background: var(--ink);
}
.h2-link{ font-size: 0.91rem; font-weight: 400; white-space: nowrap; }

/* ===== Header ===== */
/* the photo floats top-right at a fixed size; the bio wraps around it and runs full width below */
.hero{ display: flow-root; }
.hero h1{
  grid-area: name;
  font-size: clamp(1.85rem, 1.3rem + 1.5vw, 2.35rem);
  line-height: 1.15;
  letter-spacing: -0.01em;
}
.links{
  grid-area: links;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  list-style: none;
  margin: 0.75rem 0 1.3rem;
  padding: 0;
  font-size: 0.9rem;
}
.links a{
  display: inline-block;
  padding: 2px 12px;
  border: 1px solid var(--rule-strong);
  border-radius: 999px;
  color: var(--ink);
  line-height: 1.6;
  transition: border-color 0.15s, color 0.15s, background-color 0.15s;
}
.links a:hover{ border-color: var(--link); background: #f3f7fb; color: var(--link); text-decoration: none; }
.bio{ grid-area: bio; margin: 0; }
.bio p{ margin: 0; }
.bio p + p{ margin-top: 0.75em; }
.avatar{
  grid-area: photo;
  float: right;
  width: clamp(170px, 17vw, 220px);
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
  margin: 6px 0 14px clamp(24px, 3.5vw, 40px);
  padding: 5px;
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: 14px;
  box-shadow: var(--shadow);
}

@media (max-width: 900px){
  .hero{
    display: grid;
    grid-template-columns: clamp(88px, 15vw, 120px) minmax(0, 1fr);
    grid-template-areas: "photo name" "photo links" "bio bio";
    grid-template-rows: auto 1fr auto;
    column-gap: 16px;
  }
  .avatar{ float: none; width: 100%; margin: 2px 0 0; padding: 3px; border-radius: 10px; }
  .links{ margin-bottom: 0; }
  .bio{ margin-top: 18px; }
}

/* ===== Openings: a tinted note between the bio and News ===== */
.callout{
  position: relative;
  margin: clamp(22px, 3.5vw, 32px) 0 0;
  padding: 13px 18px 13px 20px;
  border: 1px solid #d9e5f1;
  border-left: 4px solid var(--link);
  border-radius: 10px;
  background: linear-gradient(90deg, #eef4fa, #f7fafd 70%);
}
.callout p{ margin: 0; line-height: 1.6; }
.callout strong{ color: var(--ink); }
.callout a{ font-weight: 700; }

/* ===== Research and Edgeville ===== */
.town{
  --dir-1: #b0573c;
  --dir-2: #46689a;
  --dir-3: #77539a;
  margin-top: 1.1rem;
  padding: 1.1rem 1.2rem 1.2rem;
  border: 1px solid #ebe8e1;
  border-radius: 14px;
  box-shadow: var(--shadow);
}
.town-head{
  display: flex;
  align-items: baseline;
  gap: 4px 10px;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}
.town-title{ font-size: 1.2rem; }
.town-sub{ color: var(--muted); font-style: italic; font-size: 0.91rem; }
.town-motion{
  margin-left: auto;
  appearance: none;
  background: none;
  border: 1px solid var(--rule-strong);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.79rem;
  padding: 1px 12px;
  cursor: pointer;
}

.town-body{
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: 20px;
  align-items: stretch;
}
.town-map{ width: 100%; margin-inline: auto; }
.town-stage{
  position: relative;
  container-type: inline-size;
  aspect-ratio: 8 / 5;
  max-width: 100%;
  border-radius: 10px;
  overflow: hidden;
  background: #a6cc80;
}
.town-stage canvas{
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}
.town-spots, .town-bubbles{ position: absolute; inset: 0; }
.town-bubbles{ pointer-events: none; }

.town-spot{
  position: absolute;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 4px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s, box-shadow 0.15s;
}
.town-spot.dir-1{ --dir: var(--dir-1); }
.town-spot.dir-2{ --dir: var(--dir-2); }
.town-spot.dir-3{ --dir: var(--dir-3); }
.town-spot[aria-pressed="true"]{
  background: rgba(255, 244, 170, 0.16);
  box-shadow: inset 0 0 0 2px #fbe68a, 0 0 0 1px rgba(120, 90, 20, 0.35);
}
.town-spot:focus-visible{ outline: 2px solid #fff; outline-offset: 1px; }
.town-label{
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translate(calc(-50% + var(--nudge, 0px)), 55%);
  display: inline-flex;
  align-items: baseline;
  gap: 0.35em;
  padding: 0 5px;
  white-space: nowrap;
  background: rgba(255, 251, 240, 0.94);
  border: 1px solid rgba(90, 70, 40, 0.45);
  border-radius: 2px;
  color: #3a332a;
  font-size: clamp(10px, 1.2vw, 12.5px);
  font-size: clamp(10px, 2.05cqi, 12.5px);
  line-height: 1.45;
  pointer-events: none;
}
.town-label-num{ font-weight: 700; color: var(--dir); }

.town-bubble{
  position: absolute;
  max-width: 48%;
  padding: 2px 6px;
  background: #fffdf6;
  border: 1px solid #3a332a;
  border-radius: 5px;
  color: #2b261f;
  font-size: clamp(10px, 1.3vw, 13px);
  font-size: clamp(10px, 2.5cqi, 13px);
  line-height: 1.3;
  transform: translate(var(--shift, -50%), -100%);
  opacity: 0;
  transition: opacity 0.25s;
  box-shadow: 1px 1px 0 rgba(0,0,0,0.18);
}
.town-bubble.show{ opacity: 1; }
.town-bubble b{ color: #6b3a2a; }

.town-panel{
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--rule);
  padding-left: 18px;
}
/* the overview spreads its three directions over the map's height, whatever the screen width */
.town-card[data-card="overview"]:not([hidden]){ flex: 1; display: flex; flex-direction: column; }
.town-card[data-card="overview"] .town-dirs{ flex: 1; align-content: space-evenly; }
.town-card h3{ font-size: 1.15rem; margin: 2px 0 10px; line-height: 1.25; }
.town-card h3:focus, .town-kicker:focus{ outline: none; }
.town-kicker{
  margin: 0 0 4px;
  font-size: 0.79rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.town-card.dir-1 .town-kicker{ color: var(--dir-1); }
.town-card.dir-2 .town-kicker{ color: var(--dir-2); }
.town-card.dir-3 .town-kicker{ color: var(--dir-3); }

.town-dirs{ display: grid; gap: 2px; list-style: none; padding: 0; margin: 4px -8px 0; }
.town-dirs > li{
  display: grid;
  grid-template-columns: 30px 1fr;
  gap: 0 8px;
  padding: 6px 8px;
  border-radius: 10px;
  line-height: 1.4;
  transition: background-color 0.15s;
}
.town-num{
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  margin-top: -1px;
  border-radius: 50%;
  background: var(--dir);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.town-dirs .dir-1{ --dir: var(--dir-1); }
.town-dirs .dir-2{ --dir: var(--dir-2); }
.town-dirs .dir-3{ --dir: var(--dir-3); }
.town-desc{ grid-column: 2; margin: 2px 0 0; font-size: 0.88rem; line-height: 1.45; }

.town-link{
  appearance: none;
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  color: var(--link);
  cursor: pointer;
}
.town-link:hover{ color: var(--link-hover); text-decoration: underline; }
.town-link.town-dir{ text-align: left; font-weight: 700; font-size: 0.97rem; line-height: 1.4; color: var(--ink); }
.town-link.town-dir:hover{ color: var(--link-hover); }
.town-back{ font-size: 0.85rem; margin-bottom: 8px; }

.town-papers{ list-style: none; padding: 0; margin: 0; }
.town-papers li{ margin: 0 0 9px; line-height: 1.4; font-size: 0.91rem; }
.town-papers a{ font-weight: 700; }
.town-venue{ color: var(--muted); font-size: 0.85rem; font-style: italic; }
.town-note{ display: block; color: var(--text); font-size: 0.88rem; }

/* Tablets and landscape phones: map on top, directions underneath */
@media (max-width: 860px){
  .town-body{ grid-template-columns: minmax(0, 1fr); gap: 14px; }
  /* keep the whole map in view when the screen is short and wide */
  .town-map{ max-width: max(300px, calc((100vh - 110px) * 1.6)); }
  .town-panel{
    border-left: 0;
    padding-left: 0;
    border-top: 1px solid var(--rule);
    padding-top: 12px;
    min-height: 0;
    scroll-margin-top: 12px;
  }
}
@media (min-width: 561px) and (max-width: 860px){
  .town-dirs{ grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .town-dirs > li{ grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .town-desc{ grid-column: 1; }
  .town-papers{ display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 24px; }
}
/* Phones: the map runs edge to edge, buildings are tagged I / II / III */
@media (max-width: 560px){
  .town{ padding: 0; border: 0; border-radius: 0; box-shadow: none; }
  .town-head{ margin-bottom: 0.6rem; }
  .town-map{ width: auto; max-width: none; margin-inline: calc(-1 * var(--pad-l)) calc(-1 * var(--pad-r)); }
  .town-stage{ border-radius: 0; }
  .town-label-name{ display: none; }
  .town-panel{ border-top: 0; padding-top: 4px; }
}
@container (max-width: 440px){
  .town-label-name{ display: none; }
}

/* ===== Lower sections share one grid: a right-aligned grey label, then the content ===== */
.rows{ list-style: none; margin: 0; padding: 0; }
.row{
  display: grid;
  grid-template-columns: var(--label-w) minmax(0, 1fr);
  gap: var(--label-gap);
}
.row[hidden]{ display: none; }
.label{
  padding-top: 0.08em;
  color: var(--muted);
  font-size: 0.91rem;
  font-variant-numeric: tabular-nums;
}
.h2-note{ color: var(--muted); font-size: 0.91rem; font-weight: 400; font-style: italic; white-space: nowrap; }
.more{
  appearance: none;
  background: none;
  border: 0;
  padding: 0;
  margin: 2px 0 0 calc(var(--label-w) + var(--label-gap));
  color: var(--link);
  font-size: 0.91rem;
  cursor: pointer;
}
.more:hover{ color: var(--link-hover); text-decoration: underline; }

/* News: dots on a thin line */
.timeline .tl-body{ position: relative; padding-bottom: 12px; }
.timeline .tl-body::before{
  content: "";
  position: absolute;
  left: calc(var(--label-gap) / -2 - 4px);
  top: 0.5em;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid #a3a7b0;
}
.timeline .tl-body::after{
  content: "";
  position: absolute;
  left: calc(var(--label-gap) / -2);
  top: calc(0.5em + 11px);
  bottom: 0;
  width: 1px;
  background: var(--rule);
}
.timeline .row:last-child .tl-body::after,
.timeline .row:has(+ .row[hidden]) .tl-body::after{ display: none; }

/* Publications: a quiet text switch in the heading row, venue set as type */
.section-head{
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: clamp(36px, 5vw, 56px) 0 1.1rem;
  border-bottom: 1px solid var(--rule);
}
.section-head h2{ margin: 0; border: 0; }
.pub-tabs{ display: flex; gap: 26px; }
.pub-tabs [role="tab"]{
  appearance: none;
  background: none;
  border: 0;
  border-bottom: 3px solid transparent;
  margin-bottom: -1px;
  padding: 0 2px 7px;
  color: var(--muted);
  font-family: var(--font-head);
  font-size: 1.18rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.pub-tabs [role="tab"]:hover{ color: var(--ink); border-bottom-color: var(--rule-strong); }
.pub-tabs [role="tab"][aria-selected="true"]{ color: var(--ink); border-bottom-color: var(--ink); }
.pub-tabs [role="tab"]:focus-visible{ outline: 2px solid var(--link); outline-offset: 2px; }

.pub-legend{ display: flex; gap: 18px; margin: -4px 0 14px; color: var(--muted); font-size: 0.88rem; }
.key::before{
  content: "";
  display: inline-block;
  width: 3px;
  height: 0.95em;
  margin-right: 0.45em;
  vertical-align: -0.12em;
  background: var(--cat);
}
.alg{ --cat: var(--alg); }
.sys{ --cat: var(--sys); }

.pubs{ display: grid; gap: 10px; list-style: none; margin: 0; padding: 0; }
/* Selected: venue badge in a left column, paper details on the right */
.pub{
  display: grid;
  grid-template-columns: 5.6rem minmax(0, 1fr);
  gap: 6px 18px;
  padding: 12px 14px;
  border-radius: 10px;
  transition: background-color 0.15s;
}
.pub-body{ min-width: 0; }
.pub-venue{ padding-top: 2px; }
.pub-venue b{
  display: block;
  padding: 1px 6px;
  border-radius: 5px;
  background: var(--cat);
  background: color-mix(in srgb, var(--cat) 88%, #000);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.4;
  text-align: center;
}
.pub-head{ margin-top: 2px; line-height: 1.35; }
.pub-head .pub-title{ display: inline; margin: 0; }
.pub-head .ar{
  margin-left: 2px;
  color: var(--muted);
  font-family: var(--font-head);
  font-size: 0.86rem;
  font-weight: 500;
  white-space: nowrap;
  letter-spacing: 0.01em;
}
.pub-tags{ display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
@media (max-width: 560px){
  .pub{ grid-template-columns: minmax(0, 1fr); padding: 12px 10px; }
  .pub-venue b{ display: inline-block; min-width: 4.6rem; }
}
.pub-award{ padding: 0 8px; border-radius: 999px; background: var(--gold-soft); color: var(--gold); font-size: 0.85rem; }
.pub-title{ display: block; margin-top: 2px; color: var(--ink); font-size: 1.03rem; font-weight: 700; line-height: 1.35; }
a.pub-title:hover{ color: var(--link-hover); }
.pub-authors{ margin-top: 2px; font-size: 0.91rem; line-height: 1.5; }
.pub-authors strong{ color: var(--ink); }
.pub-year{
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 24px 0 8px;
  padding: 0;
  border: 0;
  color: var(--ink);
  font-size: 1.25rem;
  font-variant-numeric: tabular-nums;
}
.pub-year::after{ position: static; flex: 1; width: auto; height: 1px; background: var(--rule); }
.pub-year:first-child{ margin-top: 0; }
.pubs-note{ color: var(--muted); }

/* Publications, All: numbered citations, journals then conferences, CCF rank up front */
.cite-head{ margin-top: 30px; font-size: 1.25rem; }
#pubs-all .cite-head:first-child{ margin-top: 8px; }
.cite-list{ display: grid; gap: 10px; margin: 0; padding-left: 1.9em; font-size: 0.97rem; line-height: 1.55; }
.cite-list li{ padding-left: 0.2em; }
.cite-list li::marker{ color: var(--cat); font-weight: 700; font-variant-numeric: tabular-nums; }
.cite-tag{ color: var(--ink); }
.cite-list strong{ color: var(--ink); }
.cite-list a{ color: var(--ink); }
.cite-list a:hover{ color: var(--link-hover); }
.cite-list .pub-award{ margin-left: 0.2em; font-size: 0.82rem; white-space: nowrap; }

/* Services and teaching */
.rows-plain .row{ padding: 4px 0; }
.rows-plain dd{ margin: 0; }
.svc .row{ grid-template-columns: 8.6rem minmax(0, 1fr); }
@media (max-width: 560px){ .svc .row{ grid-template-columns: minmax(0, 1fr); } }
.dots{
  display: flex;
  flex-wrap: wrap;
  list-style: none;
  margin: 0 0 0 -1.1em;
  padding: 0;
  clip-path: inset(-4px -4px -4px calc(1.1em - 3px));
}
/* a long entry wraps beside its own dot instead of under the clipped margin */
.dots li{ display: flex; min-width: 0; }
.dots li::before{
  content: "\00b7";
  flex: none;
  display: inline-block;
  width: 1.1em;
  text-align: center;
  color: var(--muted);
}
.chips{ display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 0; padding: 0; }
.chips li{
  padding: 0 10px;
  border: 1px solid #e8e5de;
  border-radius: 999px;
  background: var(--tint);
  color: var(--ink);
  font-size: 0.9rem;
  line-height: 1.75;
}
.rows-plain .row{ margin: 0 -8px; padding-inline: 8px; border-radius: 8px; transition: background-color 0.15s; }
.course{ color: var(--ink); }
.course-meta{ color: var(--muted); font-size: 0.91rem; white-space: nowrap; }
.course-meta::before{ content: "\00b7"; margin: 0 0.35em 0 0.2em; }

@media (max-width: 560px){
  .row{ grid-template-columns: minmax(0, 1fr); gap: 0; }
  .label{ text-align: left; font-size: 0.85rem; }
  .more{ margin-left: 0; }
  .timeline .tl-body{ padding-left: 16px; }
  .timeline .tl-body::before{ left: 0; }
  .timeline .tl-body::after{ left: 4px; }
  .timeline + .more{ margin-left: 16px; }
  .course-meta{ display: block; }
  .course-meta::before{ content: none; }
}

/* ===== Footer ===== */
.foot{
  margin-top: clamp(40px, 6vw, 60px);
  padding-top: 24px;
  border-top: 1px solid var(--rule);
  text-align: center;
}
.foot img{ max-width: 260px; width: 100%; border-radius: 10px; box-shadow: var(--shadow); opacity: 0.9; }
.foot img:hover{ opacity: 1; }

/* ===== Back to top ===== */
.to-top{
  position: fixed;
  right: calc(16px + env(safe-area-inset-right, 0px));
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  z-index: 98;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid var(--rule);
  box-shadow: var(--shadow);
  color: var(--muted);
  font-size: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.to-top.show{ opacity: 1; pointer-events: auto; }

/* ===== Top bar: name on the left, pages on the right, pinned while scrolling ===== */
.topbar{
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(255, 255, 255, 0.86);
  -webkit-backdrop-filter: saturate(1.5) blur(10px);
  backdrop-filter: saturate(1.5) blur(10px);
  border-bottom: 1px solid var(--rule);
}
.site-nav{
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px 20px;
  max-width: calc(var(--maxw) + var(--pad-l) + var(--pad-r));
  margin: 0 auto;
  padding: 13px var(--pad-r) 11px var(--pad-l);
}
.site-name{ color: var(--ink); font-size: 1.05rem; font-weight: 700; }
.site-name:hover{ color: var(--link-hover); text-decoration: none; }
.site-nav ul{
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
  list-style: none;
  margin: 0 0 0 auto;
  padding: 0;
  font-size: 0.97rem;
}
.site-nav ul a{ padding-bottom: 3px; border-bottom: 1.5px solid transparent; color: var(--muted); }
.site-nav ul a:hover{ color: var(--ink); text-decoration: none; }
.site-nav ul a[aria-current="page"]{ color: var(--ink); border-bottom-color: var(--ink); }
@media (max-width: 560px){
  .topbar{ position: static; }
  .site-nav{ flex-direction: column; align-items: flex-start; gap: 4px; }
  .site-nav ul{ margin-left: 0; }
}

/* ===== Sub-pages: a title row, then the content ===== */
.page-head{
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--rule);
}
.page-title{ font-size: clamp(1.7rem, 1.3rem + 1.2vw, 2.1rem); line-height: 1.2; }
.page-title + h2{ margin-top: 28px; }
.first-head{ margin-top: 4px; }
.visually-hidden{ position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.page-head h1{ font-size: clamp(1.7rem, 1.3rem + 1.2vw, 2.1rem); line-height: 1.2; }
/* anchors land below the pinned top bar */
[id]{ scroll-margin-top: 64px; }
.page-head .pub-tabs [role="tab"]{ padding-bottom: 9px; }
.page-note{ color: var(--muted); font-size: 0.94rem; font-style: italic; }
.page-intro{
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px 18px;
  margin: 12px 0 22px;
  color: var(--muted);
  font-size: 0.91rem;
}
.page-intro .pub-legend{ margin: 0; }
.page-intro a{ white-space: nowrap; }
.page-body{ margin-top: 18px; }
.pub-meta{ margin-top: 1px; color: var(--muted); font-size: 0.85rem; font-style: italic; line-height: 1.45; }
.pub-group + .pub-group .pub-year{ margin-top: 28px; }

/* ===== Type roles: Saira Semi Condensed for headings, numbers and labels ===== */
.site-name, .label, .pub-year, .town-num, .town-label, .town-kicker, .town-link.town-dir,
.pub-venue b, .cite-tag, .cite-list li::marker, .course-meta{
  font-family: var(--font-head);
}
.site-name{ font-weight: 700; letter-spacing: 0.01em; }
.label, .course-meta{ font-weight: 500; letter-spacing: 0.01em; }
.town-kicker{ font-weight: 600; letter-spacing: 0.08em; }
.pub-venue b, .cite-tag{ font-weight: 600; letter-spacing: 0.01em; }
.town-num, .town-label-num{ font-weight: 700; }
.town-label{ font-weight: 500; letter-spacing: 0.01em; }
.town-link.town-dir{ font-size: 0.98rem; font-weight: 600; letter-spacing: 0.01em; }
.pub-year{ font-weight: 600; }

/* Hover effects only where there is a mouse, so taps on a phone don't leave them stuck on */
@media (hover: hover){
  .town-motion:hover{ color: var(--link); border-color: var(--link); }
  .town-spot:hover{
    background: rgba(255, 250, 215, 0.14);
    box-shadow: inset 0 0 0 2px rgba(255, 250, 215, 0.75);
  }
  .to-top:hover{ color: var(--link); border-color: var(--link); text-decoration: none; }
  .town-dirs > li:hover{ background: var(--tint); }
  .pub:hover{ background: var(--tint); }
  .rows-plain .row:hover{ background: var(--tint); }
  /* body links: a hairline grows under the text instead of a hard underline */
  .bio a, .tl-body a, .town-papers a, .page-intro a{
    background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat;
    transition: background-size 0.25s, color 0.15s;
  }
  .bio a:hover, .tl-body a:hover, .town-papers a:hover, .page-intro a:hover{ background-size: 100% 1px; text-decoration: none; }
}

/* Bigger touch targets for fingers */
@media (pointer: coarse){
  .town-motion{ padding: 4px 12px; }
  .town-back, .more{ padding: 6px 0; }
  .town-dirs > li{ padding-block: 12px; }
}

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