/* ==========================================================
   Mingke Tian — personal site

   Everything is sized from two scales and one grid:
   - Type scale:   13 / 15 / 16 / 17 / 18 / 22 / 36 / 52 px
   - Space scale:  4 / 8 / 12 / 16 / 24 / 32 / 48 / 64 / 96 px
   - Grid:         a 208px left rail + 32px gutter, shared by
                   dates, figures, and the about-page photo,
                   so text starts at the same x on every page.

   Colors: navy, deep ocean, spring cyan, light blue, and plum red
   (see the color tokens below).
   ========================================================== */

:root {
  /* color: "dusk snow, early spring"
     暮山青 navy        dusk sky over snowy hills   -> navigation bar, headings
     寒潭碧 deep ocean  shadowed winter water       -> links, home text, labels
     春水青 cyan        clear spring water          -> lines, icons, hover
     晴雪 light blue    snow and morning mist       -> page, panels, footer
     梅红 plum red      plum blossoms in the snow   -> markers, accepted venues */
  --paper: #ffffff;          /* pure white page */
  --surface: #ffffff;        /* cards sit slightly brighter than the page */
  --ink: #111111;            /* black: text and headings */
  --muted: #555555;          /* gray: secondary lines (organization, location, captions) */
  --faint: #777777;
  --rule: #dde8ef;
  --navy: #13304d;           /* 暮山青 */
  --cyan: #1ba5c4;           /* 春水青 */
  --cyan-text: #0f6f8c;      /* 寒潭碧, readable on white */
  --cyan-deep: #0d5470;      /* deeper 寒潭碧 for home text and headings */
  --sky: #eaf5fa;            /* 晴雪 */
  --sky-strong: #d6ecf5;
  --red: #b3313b;            /* 梅红 */
  --red-soft: #fbeaeb;
  --bar: var(--navy);        /* navigation bar */

  /* type */
  --font: "Plus Jakarta Sans", "Segoe UI", system-ui, -apple-system, Helvetica, Arial, sans-serif;
  --serif: "Charis SIL", Charter, "Bitstream Charter", Georgia, "Times New Roman", serif;   /* headings, matches the home page */
  --fs-label: 0.8125rem;   /* 13px: pills, footer */
  --fs-meta: 0.9375rem;    /* 15px: authors, venue, organization, nav */
  --fs-body: 1rem;         /* 16px: paragraphs and bullets */
  --fs-lead: 1.0625rem;    /* 17px: page introductions */
  --fs-item: 1.125rem;     /* 18px: entry and job titles */
  --fs-section: 1.375rem;  /* 22px: section titles */
  --fs-page: 2.25rem;      /* 36px: page titles */
  --fs-name: 3.25rem;      /* 52px: name on the home page */

  /* space */
  --s1: 0.25rem;  /* 4  */
  --s2: 0.5rem;   /* 8  */
  --s3: 0.75rem;  /* 12 */
  --s4: 1rem;     /* 16 */
  --s5: 1.5rem;   /* 24 */
  --s6: 2rem;     /* 32 */
  --s7: 3rem;     /* 48 */
  --s8: 4rem;     /* 64 */
  --s9: 6rem;     /* 96 */

  /* layout */
  --page: 68rem;
  --pad: 1.5rem;
  --rail: 13rem;
  --gutter: var(--s6);
  --measure: 42rem;
  --radius: 8px;
}

/* The site always uses its light design, even when the visitor's system is in dark mode. */
:root { color-scheme: light; }

/* ---------- Base ---------- */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 5rem; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--fs-body);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p, ul, figure { margin: 0; }
img { max-width: 100%; display: block; }

a { color: var(--cyan-text); text-decoration: none; font-weight: 500; }
a:hover { color: var(--cyan-deep); text-decoration: underline; text-underline-offset: 0.2em; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; border-radius: 3px; }

.skip-link {
  position: absolute; left: var(--s4); top: -3rem; z-index: 20;
  padding: var(--s2) var(--s3); border-radius: var(--radius);
  background: var(--cyan); color: #fff;
}
.skip-link:focus { top: var(--s3); }

/* ---------- Header: solid cyan bar, page links centered ---------- */

.site-header {
  position: sticky; top: 0; z-index: 10;
  background: var(--bar);
  border-bottom: 3px solid var(--cyan);
  transition: box-shadow 0.2s ease;
}
.site-header.scrolled { box-shadow: 0 2px 14px rgba(6, 60, 75, 0.22); }
.site-header .inner {
  max-width: var(--page); height: 3.75rem; margin: 0 auto; padding: 0 var(--pad);
  display: flex; align-items: center; justify-content: center;
}

.site-nav ul { list-style: none; padding: 0; display: flex; justify-content: center; gap: var(--s7); }
.site-nav a {
  display: block; padding: var(--s1) 0;
  border-bottom: 2px solid transparent;
  color: rgba(255, 255, 255, 0.86); font-size: var(--fs-body); font-weight: 600; white-space: nowrap;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.site-nav a:hover { color: #fff; border-bottom-color: rgba(255, 255, 255, 0.55); text-decoration: none; }
.site-nav a[aria-current="page"] { color: #fff; border-bottom-color: var(--cyan); }

/* ---------- Page frame ---------- */

/* Footer stays at the bottom of the window on short pages */
body { display: flex; flex-direction: column; min-height: 100vh; }
main { flex: 1 0 auto; width: 100%; max-width: var(--page); margin: 0 auto; padding: var(--s8) var(--pad) var(--s9); }

.page-title { color: var(--ink); font-size: 2.25rem; font-weight: 800; line-height: 1.2; letter-spacing: -0.02em; }
.page-lede { max-width: var(--measure); margin-top: var(--s3); color: var(--muted); font-size: var(--fs-lead); }

/* Section title: thin rule, short red marker on the left */
.section-title {
  position: relative;
  margin-top: var(--s8); padding-bottom: var(--s3);
  border-bottom: 2px solid #ececec;
  color: var(--ink); font-size: 1.6rem; font-weight: 800; line-height: 1.3; letter-spacing: -0.015em;
}
.page-lede + .section-title { margin-top: var(--s7); }
.page-title + .section-title { margin-top: var(--s7); }

/* Placeholder text to replace. Delete the <span class="todo"> wrapper when done. */
.todo { background: var(--sky-strong); border-radius: 3px; padding: 0 0.25em; -webkit-box-decoration-break: clone; box-decoration-break: clone; }

/* Shared label style: dates, links under entries */
.when > span,
.entry-links a {
  display: inline-block;
  padding: 0.125rem var(--s3);
  border-radius: 6px;
  font-size: var(--fs-label); font-weight: 600; line-height: 1.6;
  white-space: nowrap;
}

/* ---------- Home ----------
   Centered name block on the left, tall photo on the right,
   a full-width introduction, then Recent News. Serif type
   (Charis SIL) on this page only. */

.home { font-family: "Charis SIL", Charter, "Bitstream Charter", Georgia, "Times New Roman", serif; }

/* Name block (left) and photo (right) sit together as one centred pair, middles aligned */
.home-hero {
  display: grid; grid-template-columns: auto 22rem; justify-content: center; align-items: center; column-gap: 7rem;
}
.home-id { text-align: center; }
.home-id h1 { font-size: 3.25rem; font-weight: 400; line-height: 1.1; color: var(--ink); white-space: nowrap; }
.home-title { margin-top: var(--s4); font-size: 1.05rem; line-height: 1.45; color: var(--ink); }
.home-title span { display: block; }
.home-title a { color: var(--cyan-text); font-weight: 400; }

.home-icons { list-style: none; padding: 0; margin-top: var(--s5); display: flex; justify-content: center; gap: var(--s3); }
.home-icons a {
  display: grid; place-items: center;
  width: 2.3rem; height: 2.3rem; border-radius: 50%;
  background: var(--cyan-text); color: #fff;
  transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.home-icons a:hover { background: var(--cyan); color: #fff; text-decoration: none; transform: translateY(-2px); box-shadow: 0 8px 16px -8px rgba(13, 84, 112, 0.6); }
.home-icons svg { width: 1.05rem; height: 1.05rem; }

/* Round photo, no mat */
.home-photo { width: 100%; margin: 0; padding: 0; }
.photo-arch {
  padding: 0; background: none;
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(19, 48, 77, 0.05), 0 18px 36px -22px rgba(19, 48, 77, 0.32);
}
.home-photo img {
  display: block; width: 100%; aspect-ratio: 1 / 1; object-fit: cover;
  background: var(--sky); border-radius: 50%;
}
.home-intro {
  margin-top: var(--s8);
  color: var(--cyan-deep); font-size: 1.125rem; line-height: 1.65;
  text-align: justify;   /* both edges flush with the content edges and the photo's right edge */
}
.home-intro strong { font-weight: 700; }

.home-news { margin-top: var(--s8); }
.home-news h2 { color: var(--navy); font-size: 2rem; font-weight: 700; line-height: 1.2; }
.home-news ul { list-style: none; padding: 0; margin-top: var(--s5); }
.home-news li { color: var(--cyan-deep); font-size: 1.125rem; line-height: 1.55; }
.home-news li + li { margin-top: var(--s4); }
.home-news b { font-weight: 700; }
/* Highlights in news: bold italic; dark-red underline on hover */
.home-news .key {
  color: var(--cyan-deep);
  font-weight: 700; font-style: italic;
  text-decoration: underline; text-decoration-color: transparent;
  text-decoration-thickness: 2px; text-underline-offset: 0.2em;
  transition: color 0.15s ease, text-decoration-color 0.15s ease;
}
.home-news .key:hover { color: var(--red); text-decoration-color: var(--red); }

/* What I'm Doing: section spacing (the cards are styled under "four cards" below) */
.home-doing { margin-top: var(--s8); }
.home-doing h2 { color: var(--navy); font-size: 2rem; font-weight: 700; line-height: 1.2; }
/* Jump targets from the home cards land below the sticky navigation bar */
.section-title[id], .card[id] { scroll-margin-top: 5rem; }

@media (max-width: 760px) {
  .home-hero { grid-template-columns: 1fr; justify-content: stretch; gap: var(--s6); }
  .home-photo { order: -1; width: min(15.5rem, 70%); margin: 0 auto; }
  .home-id { width: auto; }
  .home-id h1 { font-size: 2.75rem; white-space: normal; }
  .home-title { font-size: 1.125rem; }
  .home-intro { margin-top: var(--s7); font-size: 1.0625rem; text-align: left; }
  .home-news { margin-top: var(--s7); }
  .home-news h2 { font-size: 1.625rem; }
  .home-news li { font-size: 1rem; }
  .home-doing { margin-top: var(--s7); }
  .home-doing h2 { font-size: 1.625rem; }
}

/* ---------- Rows: a left rail (figure or date) and a text column ---------- */

.entries, .timeline { list-style: none; padding: 0; }

.entry,
.timeline .item {
  display: grid; grid-template-columns: var(--rail) minmax(0, 1fr); gap: var(--gutter);
  padding: var(--s6) 0;
  border-top: 1px solid var(--rule);
}
.entry:first-child,
.timeline .item:first-child { border-top: 0; padding-top: var(--s5); }
.entry:last-child,
.timeline .item:last-child { padding-bottom: 0; }

/* Leadership & Services: wider left column and gutter so the pictures under the dates read well */
.activities-page { --rail: 22rem; --gutter: var(--s7); }

/* EUMMA photo gallery: one large photo with arrows, thumbnails underneath. Photos are shown whole, never cropped. */
.has-figure .when > span { display: inline-block; }
.gallery-viewer { margin-top: var(--s3); }
.gv-main { position: relative; overflow: hidden; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--sky); }
.gv-link { display: block; }
.gv-img { width: 100%; aspect-ratio: 4 / 3; object-fit: contain; transition: opacity 0.25s ease; }
.gv-img.fading { opacity: 0; }
.gv-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  display: grid; place-items: center; width: 2.25rem; height: 2.25rem; padding: 0 0 2px;
  border: 0; border-radius: 50%; background: rgba(255, 255, 255, 0.92); color: var(--ink);
  font: inherit; font-size: 1.5rem; line-height: 1; cursor: pointer;
  box-shadow: 0 4px 14px -6px rgba(15, 28, 46, 0.5);
  opacity: 0; transition: opacity 0.2s ease, background-color 0.2s ease;
}
.gv-nav.prev { left: var(--s2); }
.gv-nav.next { right: var(--s2); }
.gv-main:hover .gv-nav, .gv-nav:focus-visible { opacity: 1; }
.gv-nav:hover { background: #fff; color: var(--cyan-text); }
@media (hover: none) { .gv-nav { opacity: 1; } }
.gv-count {
  position: absolute; right: var(--s2); bottom: var(--s2);
  padding: 0.1rem 0.5rem; border-radius: 999px; background: rgba(17, 17, 17, 0.6); color: #fff;
  font-size: var(--fs-label); font-weight: 600; font-variant-numeric: tabular-nums;
}
.gv-thumbs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin-top: 6px; }
.gv-thumb { padding: 0; border: 2px solid transparent; border-radius: 6px; overflow: hidden; background: var(--sky); cursor: pointer; opacity: 0.65; transition: opacity 0.2s ease, border-color 0.2s ease; }
.gv-thumb img { width: 100%; aspect-ratio: 4 / 3; object-fit: contain; }
.gv-thumb:hover { opacity: 1; }
.gv-thumb[aria-current="true"] { opacity: 1; border-color: var(--cyan); }

/* Organization names in Leadership: larger, bold, deep-ocean color */
.org-name { color: var(--cyan-deep); font-size: var(--fs-lead); font-weight: 700; }

/* SGA: short text sits centered beside its picture */
/* SGA: picture runs from the date label down to the last line of text; the logo stays whole on its own navy */
.item.center-text > .when { display: flex; flex-direction: column; align-self: stretch; }
.item.center-text > .when > span { align-self: flex-start; }
.item.center-text .rail-figure { position: relative; flex: 1 1 0; min-height: 8rem; }
.item.center-text .rail-figure img { position: absolute; inset: 0; width: 100%; height: 100%; aspect-ratio: auto; object-fit: contain; background: rgb(18, 34, 60); }
.rail-figure { display: block; margin-top: var(--s3); overflow: hidden; border-radius: var(--radius); border: 1px solid var(--rule); background: var(--sky); }
.rail-figure img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; transition: transform 0.3s ease; }
.rail-figure:hover img { transform: scale(1.03); }

/* Compact rows for short entries (a title and one line), e.g. service */
.timeline.compact .item { padding: var(--s4) 0; }
.timeline.compact .item:first-child { padding-top: var(--s5); }
.timeline.compact .item:last-child { padding-bottom: 0; }

/* Figures in the rail */
.entry .thumb { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius); border: 1px solid var(--rule); background: var(--sky); }
.entry .thumb.fit { object-fit: contain; padding: var(--s2); background: #fff; }

/* Dates in the rail, vertically aligned with the first line of the title */
.when { padding-top: 0.125rem; }
.when > span { background: var(--sky-strong); color: var(--cyan-deep); font-variant-numeric: tabular-nums; }

/* Text column: one shared right edge for titles, meta, and paragraphs */
.entry > div,
.timeline .item > div:last-child { max-width: var(--measure); }
.entry h3,
.item h3 { font-size: var(--fs-item); font-weight: 700; line-height: 1.4; letter-spacing: -0.01em; }
.entry h3 a { color: var(--ink); font-weight: 700; }
.entry h3 a:hover { color: var(--cyan-text); }

.authors { margin-top: var(--s1); color: var(--muted); font-size: var(--fs-meta); }
.authors .me { color: var(--ink); font-weight: 700; }
.venue { margin-top: var(--s1); color: var(--cyan-text); font-size: var(--fs-meta); font-weight: 600; }
.org { margin-top: var(--s1); color: var(--muted); font-size: var(--fs-meta); }

.summary { margin-top: var(--s3); }
.item ul { margin-top: var(--s3); padding-left: 1.125rem; list-style: disc; }
.item li + li { margin-top: var(--s2); }
.item li::marker { color: var(--cyan); }
.item p { margin-top: var(--s3); }
.item p.org { margin-top: var(--s1); }

.entry-links { display: flex; flex-wrap: wrap; gap: var(--s2); margin-top: var(--s4); }
.entry-links a { border: 1px solid var(--cyan); color: var(--cyan-text); }
.entry-links a:hover { background: var(--cyan); color: #fff; text-decoration: none; }

/* ---------- Paper entries (Research page) ---------- */

.paper h3 { color: var(--ink); }
.paper .authors { margin-top: var(--s1); color: var(--ink); font-size: var(--fs-meta); }
.paper .authors .me { font-weight: 700; text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
.paper .venue { margin-top: var(--s1); color: var(--ink); font-size: var(--fs-meta); font-style: italic; font-weight: 700; }
.paper .venue .v-name { color: var(--red); }            /* accepted venue, e.g. NeurIPS 2026 */
.paper .venue .v-note { color: var(--cyan-text); }      /* track or award, e.g. Main Track, Oral */
.paper .venue .v-review { color: var(--ink); font-weight: 800; }   /* under review */
.paper .venue .v-extra { color: var(--muted); font-style: normal; font-weight: 500; }
/* Research page: wider figure column; real figures keep their own shape and open full size on click */
.research-page { --rail: 30rem; }
/* Every figure sits in the same 16:9 frame, shown whole (no cropping). */
.figure-box { position: relative; display: block; aspect-ratio: 16 / 9; }
.figure-box .thumb {
  position: absolute; inset: 0;
  width: 100%; height: 100%; aspect-ratio: auto;
  object-fit: contain;
}
.figure-box .thumb.figure { padding: var(--s1); background: #fff; }
.figure-link { border-radius: var(--radius); }
.figure-link:hover .thumb { border-color: var(--cyan); }
.figure-link .thumb { transition: border-color 0.15s ease; }

/* Venue bar above each paper figure */
.venue-bar {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: center; gap: 0 0.4rem;
  margin-bottom: var(--s2); padding: 0.25rem var(--s3);
  border-radius: 8px;
  background: var(--red-soft); color: var(--red);
  font-size: 0.875rem; font-weight: 700; line-height: 1.4; text-align: center;
}
.venue-bar small { font-size: 0.75rem; font-weight: 600; }
.venue-bar.review { background: var(--sky-strong); color: var(--cyan-deep); }

.paper-links { margin-top: var(--s1); font-size: var(--fs-meta); }
.paper-links a { color: var(--cyan-text); font-weight: 500; }
.paper-links a + a { margin-left: var(--s2); }
.paper .summary { margin-top: var(--s3); color: var(--ink); }

/* ---------- Cards (Education on the Experience page) ---------- */

.card {
  padding: var(--s6);
  border: 1px solid var(--rule); border-radius: 12px; background: var(--surface);
  box-shadow: 0 1px 2px rgba(15, 28, 46, 0.04), 0 12px 32px -20px rgba(15, 28, 46, 0.28);
}
.section-title + .card { margin-top: var(--s5); }
.card + .card { margin-top: var(--s5); }
.card h3 {
  padding-bottom: var(--s3); border-bottom: 2px solid #ececec;
  color: var(--ink); font-size: var(--fs-section); font-weight: 800; line-height: 1.3; letter-spacing: -0.01em;
}
.facts { margin-top: var(--s4); }
.facts p + p { margin-top: var(--s2); }
.facts b { font-weight: 700; }
/* Awards: one per line, year label first so the names line up */
.facts .award-block { margin-top: var(--s2); }
.award-list { list-style: none; padding: 0; margin-top: var(--s2); display: grid; gap: var(--s2); }
.award-list li { display: flex; align-items: baseline; gap: var(--s3); }
.award-year {
  flex: none; min-width: 3.4rem; padding: 0.1rem 0.6rem; border-radius: 999px; text-align: center;
  background: var(--sky-strong); color: var(--cyan-deep); font-size: var(--fs-label); font-weight: 700; font-variant-numeric: tabular-nums;
}
.award-name { color: var(--ink); }

.course-list { margin-top: var(--s4); padding-left: 1.125rem; list-style: disc; columns: 3; column-gap: var(--s6); }
.course-list li { break-inside: avoid; padding-bottom: var(--s1); }
.course-list li::marker { color: var(--cyan); }

/* Interests */
.page-title + .card { margin-top: var(--s7); }
.interest-body { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--s6); align-items: center; margin-top: var(--s4); }
.interest-body p { max-width: var(--measure); }
.stat { display: flex; flex-direction: column; align-items: center; padding: var(--s4) var(--s5); border-radius: 10px; background: var(--sky); text-align: center; }
.stat-num { color: var(--cyan-deep); font-size: 2.5rem; font-weight: 800; line-height: 1.1; letter-spacing: -0.02em; }
.stat-label { margin-top: var(--s1); color: var(--muted); font-size: var(--fs-label); font-weight: 600; }
.stat.award .stat-num { font-size: 1.5rem; white-space: nowrap; }
.card .project-links { margin-top: var(--s4); }

.card-intro { max-width: var(--measure); margin-top: var(--s4); }

/* Portfolio visualizations (Interests page) */
.viz-grid { list-style: none; padding: 0; margin-top: var(--s5); display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s5) var(--s4); }
.viz-grid a { display: block; overflow: hidden; border: 1px solid var(--rule); border-radius: 10px; background: #fff; transition: border-color 0.15s ease; }
.viz-grid a:hover { border-color: var(--cyan); }
.viz-grid img { width: 100%; aspect-ratio: 16 / 10; object-fit: contain; background: #fff; }
.viz-grid figcaption { margin-top: var(--s2); color: var(--muted); font-size: var(--fs-meta); }

/* Arts gallery */
.gallery { list-style: none; padding: 0; margin-top: var(--s4); display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s3); }
.gallery a { display: block; overflow: hidden; border-radius: 10px; border: 1px solid var(--rule); }
.gallery img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; background: var(--sky); transition: transform 0.3s ease; }
.gallery a:hover img { transform: scale(1.04); }

/* Board games */
.bg-points { list-style: none; padding: 0; margin-top: var(--s4); display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s3); }
.bg-points li { padding: var(--s4); border-radius: 10px; background: var(--sky); }
.bg-points b { display: block; color: var(--cyan-deep); font-weight: 700; }
.bg-points span { display: block; margin-top: var(--s1); color: var(--ink); font-size: var(--fs-meta); }
.favorites { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); margin-top: var(--s4); }
.favorites .label { margin-right: var(--s1); font-weight: 700; }
.favorites .chip { padding: 0.125rem var(--s3); border: 1px solid var(--cyan); border-radius: 999px; color: var(--cyan-text); font-size: var(--fs-meta); font-weight: 600; }

@media (max-width: 900px) { .course-list { columns: 2; } }
@media (max-width: 680px) { .card { padding: var(--s5); } .course-list { columns: 1; } .interest-body { grid-template-columns: 1fr; gap: var(--s4); } .stat { align-items: flex-start; text-align: left; } .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); } .bg-points { grid-template-columns: 1fr; } .viz-grid { grid-template-columns: 1fr; } }

/* ---------- CV ---------- */

.actions { display: flex; flex-wrap: wrap; gap: var(--s2); margin-top: var(--s5); }
.button {
  display: inline-flex; align-items: center; gap: var(--s2);
  height: 2.375rem; padding: 0 var(--s4); border-radius: var(--radius);
  border: 1px solid var(--cyan); background: var(--cyan); color: #fff;
  font-size: var(--fs-meta); font-weight: 600;
}
.button:hover { background: var(--cyan-deep); border-color: var(--cyan-deep); color: #fff; text-decoration: none; }
.button.secondary { background: var(--paper); border-color: var(--rule); color: var(--ink); }
.button.secondary:hover { background: var(--paper); border-color: var(--cyan); color: var(--cyan-text); }
.button svg { width: 1rem; height: 1rem; }

.cv-frame {
  display: block; width: 100%; height: min(85vh, 1150px); margin-top: var(--s6);
  border: 1px solid var(--rule); border-radius: var(--radius); background: var(--sky);
}

/* ---------- About ---------- */

.about { display: grid; grid-template-columns: minmax(0, 1fr) var(--rail); gap: var(--s8); align-items: start; margin-top: var(--s7); }
.prose .section-title:first-child { margin-top: 0; }
.prose .section-title + p { margin-top: var(--s5); }
.prose p { max-width: var(--measure); }
.prose p + p { margin-top: var(--s4); }
.about aside img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: var(--radius); background: var(--sky); }
.about aside figcaption { margin-top: var(--s3); color: var(--faint); font-size: var(--fs-label); }

/* ---------- Footer ---------- */

.site-footer { border-top: 1px solid var(--rule); background: var(--sky); color: var(--faint); font-size: var(--fs-label); }
.site-footer .inner {
  max-width: var(--page); margin: 0 auto; padding: var(--s5) var(--pad);
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s2) var(--s6);
}

/* ---------- Tablet ---------- */

@media (max-width: 900px) {
  :root { --rail: 11rem; --gutter: var(--s5); --fs-name: 2.75rem; }
  .research-page { --rail: 20rem; }
  .activities-page { --rail: 15rem; --gutter: var(--s5); }
  .about { gap: var(--s6); }
}

/* ---------- Phone ---------- */

@media (max-width: 680px) {
  :root { --pad: 1.25rem; --fs-name: 2.375rem; --fs-page: 1.875rem; --fs-section: 1.25rem; }
  .page-title { font-size: 1.9rem; }
  .section-title { font-size: 1.35rem; }

  .site-header .inner { height: auto; padding-top: var(--s3); padding-bottom: var(--s3); }
  .site-nav ul { flex-wrap: wrap; gap: var(--s2) var(--s5); }
  .site-nav a { font-size: var(--fs-meta); }

  main { padding-top: var(--s7); padding-bottom: var(--s8); }
  .section-title { margin-top: var(--s7); }
  .page-lede + .section-title { margin-top: var(--s6); }

  .about { grid-template-columns: 1fr; }
  .about aside { width: 11rem; }

  .entry, .timeline .item { grid-template-columns: 1fr; gap: var(--s3); padding: var(--s5) 0; }
  .entry figure { max-width: 20rem; }
  .rail-figure { max-width: 20rem; }
  .research-page .paper .figure-box { flex: none; aspect-ratio: 16 / 9; min-height: 0; }
  .gallery-viewer { max-width: 24rem; }
  .item.center-text .rail-figure { flex: none; }
  .item.center-text .rail-figure img { position: static; aspect-ratio: 4 / 3; height: auto; }
  .figure-box { aspect-ratio: auto; }
  .figure-box .thumb { position: static; height: auto; }
  .figure-box .thumb:not(.figure) { aspect-ratio: 4 / 3; }

  .cv-frame { height: 72vh; }
}

/* ---------- Technical Skills: one scrolling row of icons ---------- */
.card.skills-card:hover { transform: none; }
.marquee {
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 8%, #000 92%, transparent);
          mask-image: linear-gradient(to right, transparent, #000 8%, #000 92%, transparent);
}
.marquee-track { display: flex; width: max-content; animation: marquee var(--speed, 60s) linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-group { display: flex; gap: var(--s7); padding-right: var(--s7); }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }

.tech-marquee { margin-top: var(--s5); padding: var(--s2) 0; }
.tech-item { display: flex; flex-direction: column; align-items: center; gap: var(--s2); flex: none; width: 5.5rem; }
.tech-icon {
  position: relative; display: grid; place-items: center;
  width: 3.5rem; height: 3.5rem; border-radius: 14px; background: var(--sky);
  transition: transform 0.2s ease, background-color 0.2s ease;
}
.tech-icon::before { content: attr(data-mono); color: var(--cyan-deep); font-size: 1.05rem; font-weight: 800; letter-spacing: -0.02em; }
.tech-icon img { position: absolute; inset: 0.65rem; width: calc(100% - 1.3rem); height: calc(100% - 1.3rem); object-fit: contain; }
.tech-icon:has(img) { background: var(--surface); box-shadow: inset 0 0 0 1px var(--rule); }
.tech-icon:has(img)::before { content: none; }
.tech-item:hover .tech-icon { transform: translateY(-3px); }
.tech-item:hover .tech-icon:not(:has(img)) { background: var(--cyan); }
.tech-item:hover .tech-icon:not(:has(img))::before { color: #fff; }
.tech-name { color: var(--muted); font-size: var(--fs-label); font-weight: 600; text-align: center; white-space: nowrap; }

.skills-all { margin-top: var(--s4); }
.skills-all summary {
  display: inline-flex; align-items: center; gap: 0.4rem; cursor: pointer; list-style: none;
  color: var(--cyan-text); font-size: var(--fs-label); font-weight: 700;
}
.skills-all summary::-webkit-details-marker { display: none; }
.skills-all summary::after { content: "+"; font-size: 1rem; line-height: 1; }
.skills-all[open] summary::after { content: "\2212"; }
.skills-all summary:hover { color: var(--cyan-deep); }
.skills-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s4) var(--s6); margin-top: var(--s3); }
.skills-cat h4 { color: var(--ink); font-size: var(--fs-label); font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.skills-cat p { margin-top: var(--s1); color: var(--ink); font-size: var(--fs-meta); }
@media (max-width: 680px) { .skills-grid { grid-template-columns: 1fr; } .marquee-group { gap: var(--s5); padding-right: var(--s5); } }

/* ---------- Experience cards: internships (with their projects) and projects, one framed card each ---------- */
.xp-list { list-style: none; padding: 0; margin-top: var(--s5); display: grid; gap: var(--s4); }
.xp-card {
  display: flex; flex-direction: column;
  padding: var(--s5) var(--s6); border: 1px solid var(--rule); border-radius: 12px; background: var(--surface);
  box-shadow: 0 1px 2px rgba(15, 28, 46, 0.04), 0 12px 32px -22px rgba(15, 28, 46, 0.3);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.xp-card:hover { transform: translateY(-3px); border-color: var(--cyan); box-shadow: 0 2px 4px rgba(15, 28, 46, 0.05), 0 18px 40px -20px rgba(6, 60, 75, 0.35); }
.xp-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: var(--s2) var(--s5); }
.xp-card h3 { color: var(--ink); font-size: var(--fs-item); font-weight: 800; line-height: 1.35; transition: color 0.2s ease; }
.xp-card:hover h3 { color: var(--cyan-text); }
.xp-org { margin-top: 2px; color: var(--muted); font-size: var(--fs-meta); }
.xp-date {
  flex: none; padding: 0.2rem 0.7rem; border-radius: 999px;
  background: var(--sky-strong); color: var(--cyan-deep); font-size: var(--fs-label); font-weight: 700; white-space: nowrap;
  transition: background-color 0.2s ease, color 0.2s ease;
}
.xp-card:hover .xp-date { background: var(--cyan); color: #fff; }
/* Project name under the role: a small title, no label */
.xp-subtitle { margin-top: var(--s3); color: var(--cyan-deep); font-size: var(--fs-body); font-weight: 700; line-height: 1.45; }
.xp-body { max-width: none; }   /* bullets use the full card width */
.xp-body ul { margin-top: var(--s3); padding-left: 1.125rem; list-style: disc; }
.xp-body li + li { margin-top: var(--s2); }
.xp-body li::marker { color: var(--cyan); }
.xp-body p { margin-top: var(--s3); }
.xp-card .project-links { margin-top: 0; padding-top: var(--s4); }
@media (max-width: 760px) { .xp-card { padding: var(--s5); } .xp-card.has-media { flex-direction: column; gap: var(--s4); } .xp-media { flex: none; width: 100%; max-width: 26rem; } }

/* ---------- Projects: card grid with technology tags ---------- */
.project-grid {
  list-style: none; padding: 0; margin-top: var(--s5);
  display: grid; grid-template-columns: repeat(auto-fill, minmax(18.5rem, 1fr)); gap: var(--s4);
}
.project-card {
  display: flex; flex-direction: column;
  padding: var(--s5); border: 1px solid var(--rule); border-radius: 12px; background: var(--surface);
  box-shadow: 0 1px 2px rgba(15, 28, 46, 0.04), 0 12px 32px -22px rgba(15, 28, 46, 0.3);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.project-card:hover { transform: translateY(-3px); border-color: var(--cyan); box-shadow: 0 2px 4px rgba(15, 28, 46, 0.05), 0 18px 40px -20px rgba(6, 60, 75, 0.35); }
.project-meta { color: var(--muted); font-size: var(--fs-label); font-weight: 600; letter-spacing: 0.02em; }
.project-card h3 { margin-top: var(--s2); color: var(--ink); font-size: var(--fs-item); font-weight: 800; line-height: 1.35; }
.project-desc { margin-top: var(--s3); color: var(--ink); font-size: var(--fs-meta); line-height: 1.6; }
.project-tags { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; margin-top: var(--s4); }
.project-tags li { padding: 0.15rem 0.6rem; border-radius: 999px; background: var(--sky); color: var(--cyan-deep); font-size: var(--fs-label); font-weight: 600; }
.project-links { display: flex; flex-wrap: wrap; gap: var(--s2); margin-top: auto; padding-top: var(--s4); }
.project-links a {
  padding: 0.35rem 0.85rem; border: 1px solid var(--rule); border-radius: 8px;
  color: var(--ink); font-size: var(--fs-label); font-weight: 700;
  transition: border-color 0.2s ease, color 0.2s ease, background-color 0.2s ease;
}
.project-links a:hover { border-color: var(--cyan); background: var(--sky); color: var(--cyan-deep); text-decoration: none; }

/* ---------- Research entries: badge, title, authors, summary, buttons; figures on a soft mat ---------- */
.paper-badges { display: flex; flex-wrap: wrap; align-items: center; gap: 6px var(--s2); margin-bottom: var(--s2); }
.badge { display: inline-flex; align-items: center; padding: 0.2rem 0.7rem; border-radius: 999px; font-size: var(--fs-label); font-weight: 700; letter-spacing: 0.01em; }
.badge.accepted { background: var(--red-soft); color: var(--red); }
.badge.review { background: #eef1f4; color: #3f454b; }
.badge-note { color: var(--muted); font-size: var(--fs-label); font-weight: 600; }
.paper .paper-body h3 { font-size: var(--fs-item); font-weight: 800; line-height: 1.35; }
.paper .authors { margin-top: var(--s1); }
.paper .summary { margin-top: var(--s3); font-size: var(--fs-meta); line-height: 1.65; }
.paper .paper-links { display: flex; flex-wrap: wrap; gap: var(--s2); margin-top: var(--s3); }
.paper .paper-links a {
  padding: 0.3rem 0.8rem; border: 1px solid var(--rule); border-radius: 8px; background: var(--surface);
  color: var(--ink); font-size: var(--fs-label); font-weight: 700;
  transition: border-color 0.2s ease, color 0.2s ease, background-color 0.2s ease;
}
.paper .paper-links a:hover { border-color: var(--cyan); background: var(--sky); color: var(--cyan-deep); text-decoration: none; }
.research-page .figure-box { border-radius: 12px; background: #f2f5f7; }
.research-page .figure-box .thumb { inset: 10px; width: calc(100% - 20px); height: calc(100% - 20px); padding: 0; border: 0; border-radius: 6px; background: transparent; }
.research-page .paper:hover .figure-box .thumb { border-color: transparent; }
/* The figure panel runs from the top of the badge to the bottom of the PDF button */
.research-page .paper figure { display: flex; flex-direction: column; }
.research-page .paper .figure-box { flex: 1 1 auto; aspect-ratio: auto; min-height: 14rem; }
/* Gait paper: its figure is very wide, so its panel is a bit shorter than the text and sits centered beside it */
.research-page #gait figure { justify-content: center; }
.research-page #gait .figure-box { flex: none; min-height: 0; padding: 3.25rem 10px; }
.research-page #gait .figure-box .thumb { position: static; inset: auto; width: 100%; height: auto; }

/* ---------- Research list: links to each paper's page ---------- */
/* Text-only entries (journal manuscripts): no figure column */
.research-page .entry.paper.no-figure { grid-template-columns: minmax(0, 1fr); }
.research-page .entry.paper.no-figure > .paper-body, .research-page .entry.paper.no-figure .summary { max-width: none; }   /* use the full width so titles and authors stay on one line */

.paper-title-link { color: inherit; }
.paper-title-link:hover { color: var(--cyan-text); text-decoration: none; }
.paper .paper-links a.primary { border-color: var(--navy); background: var(--navy); color: #fff; }
.paper .paper-links a.primary:hover { border-color: var(--cyan-text); background: var(--cyan-text); color: #fff; }

/* ---------- Projects: picture cards that open a page per project ---------- */
.proj-grid { list-style: none; padding: 0; margin-top: var(--s5); display: grid; grid-template-columns: repeat(auto-fill, minmax(19rem, 1fr)); gap: var(--s5); }
.proj-tile {
  display: flex; flex-direction: column; overflow: hidden;
  border: 1px solid var(--rule); border-radius: 14px; background: var(--surface);
  box-shadow: 0 1px 2px rgba(15, 28, 46, 0.04), 0 12px 32px -22px rgba(15, 28, 46, 0.3);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.proj-tile:hover { transform: translateY(-4px); border-color: var(--cyan); box-shadow: 0 2px 4px rgba(15, 28, 46, 0.05), 0 22px 44px -22px rgba(6, 60, 75, 0.4); }
.proj-media { display: block; aspect-ratio: 16 / 10; overflow: hidden; background: #f2f5f7; border-bottom: 1px solid var(--rule); }
.proj-media img { width: 100%; height: 100%; transition: transform 0.35s ease; }
.proj-media.fit-cover img { object-fit: cover; }
.proj-media.fit-contain img { object-fit: contain; padding: var(--s3); }
.proj-tile:hover .proj-media img { transform: scale(1.04); }
.proj-body { display: flex; flex-direction: column; flex: 1 1 auto; padding: var(--s5); }
.proj-body h3 { margin-top: var(--s2); font-size: var(--fs-item); font-weight: 800; line-height: 1.35; }
.proj-body h3 a { color: var(--ink); font-weight: inherit; }
.proj-body h3 a:hover { color: var(--cyan-text); text-decoration: none; }
.proj-body .project-desc { margin-top: var(--s3); }
.proj-body .project-links { margin-top: auto; padding-top: var(--s4); }
.project-links a.primary { border-color: var(--navy); background: var(--navy); color: #fff; }
.btn-icon { display: inline-flex; margin-right: 0.4rem; vertical-align: -2px; }
.btn-icon svg { width: 0.95rem; height: 0.95rem; }
.project-links a, .pp-btn { align-items: center; }
.project-links a.primary:hover { border-color: var(--cyan-text); background: var(--cyan-text); color: #fff; }

/* Research write-ups (research-*.html): paper-style sections */
/* Short paragraphs are line-balanced so no line is left with one or two words */
.paper-page p, .paper-page dd, .paper-page li, .paper-page figcaption { text-wrap: balance; }
.pp-lede { margin-top: var(--s6); max-width: 50rem; color: var(--ink); font-size: 1.125rem; line-height: 1.75; }
.pp-figure figcaption b { color: var(--ink); font-weight: 800; }
.pp-doc { margin-top: var(--s7); }
.pp-sec { margin-top: var(--s7); padding-top: var(--s6); border-top: 1px solid var(--rule); }
.pp-sec:first-child { margin-top: 0; }
.pp-sec h2 { display: flex; align-items: baseline; gap: var(--s3); color: var(--ink); font-size: 1.375rem; font-weight: 800; letter-spacing: -0.01em; line-height: 1.3; }
.pp-secnum { flex: none; display: inline-grid; place-items: center; min-width: 2rem; height: 2rem; padding: 0 0.4rem; border-radius: 9px;
  background: var(--navy); color: #fff; font-size: 0.9375rem; font-weight: 800; transform: translateY(-2px); }
.pp-sec > p { margin-top: var(--s4); max-width: 50rem; color: var(--ink); line-height: 1.75; }
.pp-sec .pp-eq { margin-top: var(--s4); padding: var(--s4) var(--s5); border: 1px solid #e3ecf1; border-radius: 12px; background: #f6f9fb; overflow-x: auto; }
.pp-sec .pp-eq .katex-display { margin: 0.2em 0; }
.pp-sec .pp-eq .katex { font-size: 1.14em; }
.pp-where-lead { margin-top: var(--s4); color: var(--muted); font-size: var(--fs-meta); font-style: italic; }
.pp-where { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: var(--s2) var(--s5); margin: var(--s2) 0 0; padding-left: var(--s4);
  border-left: 3px solid var(--sky-strong); }
.pp-where dt { color: var(--navy); font-weight: 700; white-space: nowrap; }
.pp-where dd { margin: 0; color: var(--ink); line-height: 1.6; }
.pp-sec .pp-stats { margin-top: var(--s4); }
.pp-refs { margin-top: var(--s4); padding-left: 1.4rem; color: var(--ink); font-size: var(--fs-meta); line-height: 1.6; }
.pp-refs li + li { margin-top: var(--s2); }
.pp-refs li::marker { color: var(--muted); font-weight: 700; }
.pp-sec .pp-bib { margin-top: var(--s4); }
@media (max-width: 680px) {
  .pp-lede { font-size: 1.0625rem; }
  .pp-sec h2 { font-size: 1.2rem; }
  .pp-sec .pp-eq { padding: var(--s3); }
  .pp-sec .pp-eq .katex { font-size: 0.95em; }   /* long equations scroll sideways inside their box */
  .pp-where { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .pp-where dd { margin-bottom: var(--s2); }
}

/* Formulation (math) on project and paper pages */
.pp-math { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s4); margin-top: var(--s5); }
.pp-math-block { padding: var(--s5) var(--s6); border: 1px solid var(--rule); border-radius: 14px; background: var(--surface); }
.pp-math-block h3 { color: var(--ink); font-size: var(--fs-item); font-weight: 800; }
.pp-eq { margin-top: var(--s3); padding: var(--s3) var(--s4); overflow-x: auto; border-radius: 10px; background: #f5f8fa; color: var(--navy); }
.pp-eq .katex-display { margin: 0.4em 0; }
.pp-eq .katex { font-size: 1.12em; }
.pp-math-block p { margin-top: var(--s3); color: var(--ink); font-size: var(--fs-meta); line-height: 1.7; }
.pp-wide { margin-top: var(--s5); }
.pp-note { margin-top: var(--s7); color: var(--muted); font-size: var(--fs-meta); }

/* Project pages: tags under the title and a one- or two-picture gallery */
.pp-tags { margin-top: var(--s4); }
.pp-gallery { display: grid; gap: var(--s4); margin-top: var(--s6); }
.pp-gallery.two, .pp-gallery.three { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pp-gallery.three figure:first-child { grid-column: 1 / -1; }
.pp-gallery.three figure:not(:first-child) img { aspect-ratio: 16 / 10; object-fit: contain; background: #fff; }
.pp-gallery figure a { display: block; padding: var(--s3); border-radius: 14px; background: #f2f5f7; }
.pp-gallery img { width: 100%; height: auto; border-radius: 8px; }
.pp-gallery.two img { aspect-ratio: 4 / 3; object-fit: cover; }
.pp-gallery figcaption { margin-top: var(--s2); color: var(--muted); font-size: var(--fs-meta); text-align: center; }
@media (max-width: 680px) { .pp-gallery.two, .pp-gallery.three { grid-template-columns: 1fr; } }

/* ---------- Paper pages (research-*.html): a small project page per paper ---------- */
.paper-page { max-width: 60rem; }
.pp-back { display: inline-block; color: var(--muted); font-size: var(--fs-meta); font-weight: 600; }
.pp-back:hover { color: var(--cyan-text); text-decoration: none; }
.pp-hero { margin-top: var(--s5); }
.pp-hero h1 { margin-top: var(--s2); color: var(--ink); font-size: 2.15rem; font-weight: 800; line-height: 1.2; letter-spacing: -0.02em; }
.pp-authors { margin-top: var(--s3); color: var(--ink); font-size: var(--fs-lead); }
.pp-buttons { display: flex; flex-wrap: wrap; gap: var(--s2); margin-top: var(--s5); }
.pp-btn {
  display: inline-flex; align-items: center; padding: 0.5rem 1rem; border: 1px solid var(--rule); border-radius: 10px;
  background: var(--surface); color: var(--ink); font-size: var(--fs-meta); font-weight: 700;
  transition: border-color 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}
.pp-btn:hover { border-color: var(--cyan); background: var(--sky); color: var(--cyan-deep); text-decoration: none; }
.pp-btn.primary { border-color: var(--navy); background: var(--navy); color: #fff; }
.pp-btn.primary:hover { border-color: var(--cyan-text); background: var(--cyan-text); color: #fff; }

.pp-tldr { margin-top: var(--s7); padding: var(--s5) var(--s6); border-radius: 14px; background: var(--sky); }
.pp-label { color: var(--cyan-deep); font-size: var(--fs-label); font-weight: 800; letter-spacing: 0.08em; }
.pp-tldr p { margin-top: var(--s2); color: var(--ink); font-size: var(--fs-lead); line-height: 1.65; }

.pp-figure { margin-top: var(--s6); }
.pp-figure a { display: block; padding: var(--s4); border-radius: 14px; background: #f2f5f7; }
.pp-figure img { width: 100%; height: auto; border-radius: 6px; }
.pp-figure figcaption { margin-top: var(--s3); color: var(--muted); font-size: var(--fs-meta); text-align: center; }
.pp-figure-empty { display: grid; place-items: center; min-height: 14rem; padding: var(--s5); border-radius: 14px; background: #f2f5f7; }

.pp-section { margin-top: var(--s8); }
.pp-section .section-title { margin-top: 0; }
.pp-abstract { margin-top: var(--s4); color: var(--ink); line-height: 1.75; }
.pp-steps { list-style: none; padding: 0; margin-top: var(--s5); display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: var(--s4); }
.pp-steps li { padding: var(--s5); border: 1px solid var(--rule); border-radius: 12px; background: var(--surface);
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease; }
.pp-steps li:hover { transform: translateY(-3px); border-color: var(--cyan); box-shadow: 0 16px 32px -22px rgba(6, 60, 75, 0.4); }
.pp-num { color: var(--cyan); font-size: var(--fs-label); font-weight: 800; letter-spacing: 0.06em; }
.pp-steps h3 { margin-top: var(--s1); color: var(--ink); font-size: 1.0625rem; font-weight: 800; line-height: 1.35; }
.pp-steps p { margin-top: var(--s2); color: var(--ink); font-size: var(--fs-meta); line-height: 1.6; }
.pp-stats { list-style: none; padding: 0; margin-top: var(--s5); display: grid; grid-template-columns: repeat(auto-fit, minmax(12.5rem, 1fr)); gap: var(--s4); }
.pp-stats li { padding: var(--s5); border-radius: 12px; background: var(--sky); }
.pp-stats strong { display: block; color: var(--cyan-deep); font-size: 2rem; font-weight: 800; line-height: 1.1; letter-spacing: -0.02em; }
.pp-stats li > span { display: block; margin-top: var(--s2); color: var(--ink); font-size: var(--fs-meta); line-height: 1.5; }
.pp-bib { position: relative; margin-top: var(--s4); }
.pp-bib pre { overflow-x: auto; padding: var(--s5); border: 1px solid var(--rule); border-radius: 12px; background: #f5f7f9;
  color: var(--ink); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.8125rem; line-height: 1.6; }
.pp-copy { position: absolute; top: var(--s3); right: var(--s3); padding: 0.3rem 0.75rem; border: 1px solid var(--rule); border-radius: 8px;
  background: var(--surface); color: var(--ink); font: inherit; font-size: var(--fs-label); font-weight: 700; cursor: pointer; }
.pp-copy:hover { border-color: var(--cyan); color: var(--cyan-deep); }
.pp-pager { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s4); margin-top: var(--s8); padding-top: var(--s5); border-top: 1px solid var(--rule); }
.pp-pager a { display: block; padding: var(--s4); border: 1px solid var(--rule); border-radius: 12px; color: var(--ink); font-weight: 700; }
.pp-pager a span { display: block; color: var(--muted); font-size: var(--fs-label); font-weight: 600; }
.pp-pager a.next { text-align: right; }
.pp-pager a:hover { border-color: var(--cyan); color: var(--cyan-deep); text-decoration: none; }
@media (max-width: 680px) {
  .pp-hero h1 { font-size: 1.65rem; }
  .pp-tldr { padding: var(--s4); }
  .pp-figure a { padding: var(--s2); }
  .pp-pager { grid-template-columns: 1fr; }
}

/* ---------- Hover: cards and entries lift slightly ---------- */

.card, .figure-box, .viz-grid a, .gallery a {
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 2px 4px rgba(15, 28, 46, 0.05), 0 18px 40px -20px rgba(6, 60, 75, 0.35);
}

/* Papers: the figure lifts and the title turns cyan */
.paper h3 { transition: color 0.2s ease; }
.paper:hover h3 { color: var(--cyan-text); }
.paper:hover .figure-box { transform: translateY(-3px); box-shadow: 0 16px 32px -20px rgba(6, 60, 75, 0.45); }
.paper:hover .figure-box .thumb { border-color: var(--cyan); }

/* Dated rows (experience, leadership, services): the date label fills in and the title turns cyan */
.timeline .item h3, .when > span { transition: color 0.2s ease, background-color 0.2s ease; }
.timeline .item:hover h3 { color: var(--cyan-text); }
.timeline .item:hover .when > span { background: var(--cyan); color: #fff; }

/* Chart and gallery tiles */
.viz-grid a:hover, .gallery a:hover { transform: translateY(-3px); box-shadow: 0 14px 28px -18px rgba(6, 60, 75, 0.45); }

/* ---------- Scroll reveal (classes added by assets/site.js) ---------- */
.reveal-on .reveal { opacity: 0; transform: translateY(14px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal-on .reveal.in { opacity: 1; transform: none; }

/* ---------- Respect "reduce motion" settings ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .card:hover, .paper:hover .figure-box, .viz-grid a:hover, .gallery a:hover, .gallery a:hover img,
  .home-icons a:hover { transform: none; }
  .marquee-track { animation: none; flex-wrap: wrap; width: auto; }
  .marquee-group { flex-wrap: wrap; row-gap: var(--s4); }
  .marquee-group[aria-hidden] { display: none; }
  .marquee { -webkit-mask-image: none; mask-image: none; }
  .project-card:hover, .xp-card:hover, .proj-tile:hover { transform: none; }
}

/* ==========================================================
   Refined navy (2026 refresh, direction C)
   Same structure, fonts, and dark navigation bar as before; one clear blue accent;
   quiet slate grays for text, rules, and surfaces.
   ========================================================== */
:root {
  --ink: #0f172a; --muted: #475569; --faint: #64748b; --rule: #e2e8f0;
  --navy: #0b1f3a; --bar: #0b1f3a;
  --cyan: #2563eb; --cyan-text: #1d4ed8; --cyan-deep: #1e3a8a;
  --sky: #f1f5f9; --sky-strong: #e2e8f0;
  --red: #be123c; --red-soft: #fff1f2;
}
body { color: var(--ink); }

/* navigation */
.site-header { background: var(--bar); border-bottom: 0; }
.site-header.scrolled { box-shadow: 0 4px 18px rgba(11, 31, 58, 0.25); }
.site-nav a { color: rgba(255, 255, 255, 0.72); }
.site-nav a:hover { color: #fff; border-bottom-color: rgba(255, 255, 255, 0.4); }
.site-nav a[aria-current="page"] { color: #fff; border-bottom-color: #60a5fa; }

/* type */
.section-title { border-bottom: 1px solid var(--rule); }
.home-id h1 { color: var(--ink); }
.home-title { color: var(--muted); }
.home-title span:first-child { color: var(--ink); }
.home-title a { color: var(--cyan-text); }
.home-intro { color: #1e293b; }
.home-intro strong { color: var(--cyan-deep); }
.home-news h2, .home-doing h2 { color: var(--ink); }
.home-news li { color: #1e293b; }
.home-news .key { color: var(--cyan-text); }
.home-news .key:hover { color: var(--cyan-deep); text-decoration-color: var(--cyan-deep); }
.home-icons a { background: var(--navy); }
.home-icons a:hover { background: var(--cyan); box-shadow: 0 8px 16px -8px rgba(37, 99, 235, 0.6); }

/* surfaces */
.card, .xp-card, .proj-tile { border-color: var(--rule); border-radius: 12px; box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06); }
.xp-card:hover, .proj-tile:hover { border-color: #bfdbfe; box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 14px 32px -18px rgba(30, 58, 138, 0.35); }
.research-page .figure-box, .pp-figure a, .pp-gallery figure a, .proj-media, .xp-media { background: #f8fafc; }

/* pills and badges */
.badge.accepted { background: #fff1f2; color: #be123c; }
.badge.review { background: #f1f5f9; color: #334155; }
.project-tags li { background: #eff6ff; color: #1e40af; }
.when > span, .xp-date, .award-year { background: #eff6ff; color: #1e40af; }
.xp-card:hover .xp-date { background: var(--cyan); color: #fff; }
.org-name { color: var(--cyan-deep); }
.xp-subtitle { color: var(--cyan-deep); }
.item li::marker, .xp-body li::marker, .course-list li::marker { color: var(--cyan); }

/* buttons */
.paper-links a.primary, .project-links a.primary, .pp-btn.primary { background: var(--navy); border-color: var(--navy); color: #fff; }
.paper-links a.primary:hover, .project-links a.primary:hover, .pp-btn.primary:hover { background: var(--cyan); border-color: var(--cyan); color: #fff; }
.paper-links a:not(.primary):hover, .project-links a:not(.primary):hover, .pp-btn:not(.primary):hover { border-color: #93c5fd; background: #eff6ff; color: var(--cyan-deep); }

/* research write-ups */
.pp-secnum { background: var(--navy); }
.pp-sec .pp-eq { border-color: var(--rule); background: #f8fafc; color: var(--navy); }
.pp-where { border-left-color: #dbeafe; }
.pp-where dt { color: var(--cyan-deep); }
.pp-tldr, .pp-stats li { background: #f1f5f9; }
.pp-stats strong { color: var(--cyan-deep); }

/* footer */
.site-footer { background: #f8fafc; border-top: 1px solid var(--rule); color: var(--faint); }

/* Services: one line on what each role involved */
.timeline .item p.svc-desc { margin-top: var(--s2); max-width: 46rem; color: var(--ink); font-size: var(--fs-meta); line-height: 1.6; }

/* Home: Research Interests, styled like Recent News */
.home-interests { margin-top: var(--s8); }
.home-interests h2 { color: var(--ink); font-size: 2rem; font-weight: 700; line-height: 1.2; }
.home-interests ul { margin-top: var(--s5); padding-left: 1.25rem; list-style: disc; }
.home-interests li { color: #1e293b; font-size: 1.125rem; line-height: 1.55; }
.home-interests li + li { margin-top: var(--s3); }
.home-interests li::marker { color: var(--cyan); }
.home-interests b { color: var(--ink); font-weight: 700; }

/* Home hero: generous space above the hero and between the hero and the introduction */
@media (min-width: 761px) {
  main.home { padding-top: 6.5rem; }
  .home .home-intro { margin-top: 6rem; }
}

/* Research list: equal-contribution note */
.pub-note { margin-top: var(--s4); color: var(--muted); font-size: var(--fs-label); }

/* Learn more pages: "On this page" links, equal-contribution note, coming-soon note */
.pp-eqnote { margin-top: var(--s1); color: var(--muted); font-size: var(--fs-label); }
.pp-toc { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); margin-top: var(--s6); padding: var(--s3) var(--s4);
  border: 1px solid var(--rule); border-radius: 12px; background: #f8fafc; }
.pp-toc span { margin-right: var(--s2); color: var(--muted); font-size: 0.75rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.pp-toc a { padding: 0.25rem 0.7rem; border: 1px solid var(--rule); border-radius: 999px; background: #fff; color: var(--ink);
  font-size: var(--fs-label); font-weight: 600; transition: border-color 0.15s ease, color 0.15s ease; }
.pp-toc a:hover { border-color: var(--cyan); color: var(--cyan-text); text-decoration: none; }
.pp-sec[id], #citation, #refs { scroll-margin-top: 5rem; }
.pp-soon { margin-top: var(--s5); padding: var(--s4) var(--s5); border: 1px dashed #cbd5e1; border-radius: 12px; color: var(--muted); }
/* Learn more pages: highlight your name in the author line, as on the Research list */
.pp-authors .me { color: var(--ink); font-weight: 700; text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 3px; }

/* ==========================================================
   Refresh (October 2026): Projects cards, CV page, round home
   photo, and the "What I'm Doing" cards on the home page.
   ========================================================== */
html, body { overflow-x: clip; }   /* full-width backdrops never cause sideways scrolling */


/* Projects: two-column cards with a date line, short title, and one-line subtitle */
.proj-band { margin-top: var(--s8); }
.proj-band .section-title { margin-top: 0; }
.proj-band .proj-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s6); margin-top: var(--s6); }
.proj-band .proj-tile { border: 1px solid var(--rule); border-radius: 18px; background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05), 0 18px 40px -28px rgba(30, 58, 138, 0.4); }
.proj-band .proj-tile:hover { border-color: #bfdbfe; box-shadow: 0 2px 4px rgba(15, 23, 42, 0.05), 0 30px 60px -30px rgba(30, 58, 138, 0.5); }
.proj-band .proj-media { aspect-ratio: 2 / 1; background: #fff; border-bottom: 1px solid rgba(148, 163, 184, 0.25); }
.proj-band .proj-body { padding: var(--s5) var(--s6) var(--s6); }
.proj-date { display: flex; align-items: center; gap: var(--s2); color: var(--faint); font-size: 0.875rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.proj-date span { padding: 0.05rem 0.55rem; border: 1px solid rgba(148, 163, 184, 0.45); border-radius: 999px; font-size: 0.75rem; font-weight: 600; }
.proj-band .proj-body h3 { margin-top: var(--s2); font-size: 1.5rem; font-weight: 800; letter-spacing: -0.015em; line-height: 1.25; }
.proj-role { margin-top: var(--s1); color: var(--cyan-text); font-size: var(--fs-meta); font-weight: 700; }
.proj-band .project-desc { margin-top: var(--s3); color: #334155; line-height: 1.7; }
.proj-band .project-tags li { background: rgba(255, 255, 255, 0.8); border: 1px solid rgba(148, 163, 184, 0.35); color: #475569; font-weight: 500; }
.proj-band .project-links { margin-top: auto; padding-top: var(--s5); border-top: 1px solid rgba(148, 163, 184, 0.25); }
.proj-band .project-tags { margin-bottom: var(--s5); }
.proj-band .project-links a { border-radius: 999px; padding: 0.4rem 1rem; }
.proj-band .project-links a:not(.primary) { background: rgba(255, 255, 255, 0.9); }
@media (max-width: 860px) { .proj-band .proj-grid { grid-template-columns: 1fr; } .proj-band .proj-body { padding: var(--s5); } }

/* Removed items stay hidden even if a browser still shows a cached copy of an older page */
.brand { display: none !important; }
.site-nav li:has(> a[href="cv.pdf"]) { display: none !important; }

/* ---------- CV page ---------- */
.cv-page .cv-lede { margin-top: var(--s3); color: var(--muted, #555); }
.cv-page .cv-frame { height: min(90vh, 1250px); background: #fff; }

/* ---------- What I'm Doing (home): four cards ----------
   Picture panel on top (a main image layered with smaller ones), then the title and one line.
   Panels are a pale neutral that warms to the card's colour on hover; the arrow slides a little. */
.doing-grid { list-style: none; padding: 0; margin-top: var(--s5);
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s6) var(--s5); }
.doing-grid > li { margin: 0; }
.doing-card { --tone: #1d4ed8; --tint: #e4ecfb; display: block; color: inherit; }
.doing-card.tone-slate { --tone: #334155; --tint: #e3e8f0; }
.doing-card.tone-rose  { --tone: #9f1239; --tint: #f6e2e5; }
.doing-card.tone-mint  { --tone: #0f766e; --tint: #dcefe8; }
a.doing-card:hover { color: inherit; text-decoration: none; }

.d-art { position: relative; display: block; aspect-ratio: 16 / 10; overflow: hidden; border-radius: 12px;
  background-color: #f3f5f8;
  background-image: linear-gradient(150deg, rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0));
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.22);
  transition: background-color 0.35s ease, box-shadow 0.35s ease; }
.doing-card:hover .d-art { background-color: var(--tint); box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.1), 0 16px 30px -22px rgba(15, 23, 42, 0.45); }
.d-sheet { position: absolute; display: block; overflow: hidden; border-radius: 7px; background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08), 0 8px 18px -10px rgba(15, 23, 42, 0.45); }
.d-sheet img { display: block; width: 100%; height: 100%; object-fit: cover; }
/* Research: system figure with a second paper figure tucked behind it */
.d-main { left: 3%; top: 5%; width: 72%; height: 90%; z-index: 2; }
.d-main img { object-fit: contain; padding: 3px; }
.d-side { right: 2.5%; top: 4%; width: 30%; height: 92%; transform: rotate(3deg); }
.d-side img { object-fit: contain; padding: 2px; }
/* Industry: photo with a small inset */
.d-photo { inset: 5px; }
.d-inset { left: 12px; top: 12px; width: 38%; aspect-ratio: 1120 / 677; border: 2px solid #fff; transform: rotate(-2deg); }
/* Community: three photos fanned out */
.d-fan .d-c { left: 15%; top: 5%; width: 70%; height: 90%; z-index: 2; border: 2px solid #fff; }
.d-fan .d-l, .d-fan .d-r { top: 16%; width: 38%; height: 68%; border: 2px solid #fff; }
.d-fan .d-l { left: 4%; transform: rotate(-6deg); }
.d-fan .d-r { right: 4%; transform: rotate(6deg); }
/* Markets: the chart on a white sheet */
.d-chart { left: 3.5%; right: 3.5%; top: 7%; bottom: 7%; }
/* Markets: a prediction-market contract card and a small candlestick chart tucked over the main chart */
.d-contract { left: 5%; top: 7%; width: 37%; aspect-ratio: 320 / 200; z-index: 2; border: 2px solid #fff; transform: rotate(-3deg); }
.d-candles { right: 8%; bottom: 16%; width: 32%; aspect-ratio: 260 / 170; z-index: 2; border: 2px solid #fff; transform: rotate(3deg); }
.d-chart img { object-fit: contain; padding: 2px 4px; }

.doing-grid h3 { display: flex; align-items: baseline; gap: 0.45rem; margin-top: var(--s4);
  color: var(--ink); font-size: 1.3rem; font-weight: 400; line-height: 1.25; transition: color 0.25s ease; }
.d-arrow { color: var(--tone); font-family: var(--font); font-size: 1rem; opacity: 0.55; transition: transform 0.25s ease, opacity 0.25s ease; }
a.doing-card:hover h3 { color: var(--tone); }
a.doing-card:hover .d-arrow { opacity: 1; transform: translateX(3px); }
.doing-grid p { margin-top: var(--s2); color: var(--ink); font-family: var(--font); font-size: var(--fs-meta); line-height: 1.6; }

@media (max-width: 960px) { .doing-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) { .doing-grid { grid-template-columns: 1fr; gap: var(--s6); } }
@media (prefers-reduced-motion: reduce) { a.doing-card:hover .d-arrow { transform: none; } }

/* Services: one picture per item under the date (a photo, or a logo on white), all the same shape */
.activities-page .timeline.compact { --rail: 18.5rem; }   /* year and picture side by side, then the text */
.timeline.compact .item.has-figure > .when { display: flex; align-items: flex-start; gap: var(--s4); }
.timeline.compact .item.has-figure > .when > span { flex: none; }
.svc-figure { flex: 1 1 auto; min-width: 0; margin-top: 0; }
.svc-figure img { aspect-ratio: 16 / 9; }
.svc-figure.is-logo { background: #fff; }
.svc-figure.is-logo img { object-fit: contain; padding: 0.75rem 1.25rem; }
.svc-figure.is-logo:hover img { transform: none; }
/* Home community card: EUMMA logo on a small white tag */
.d-logo { position: absolute; left: 10px; bottom: 10px; z-index: 3; display: block; padding: 4px 8px; border-radius: 6px; background: #fff;
  box-shadow: 0 4px 12px -6px rgba(15, 23, 42, 0.5); }
.d-logo img { display: block; height: 14px; width: auto; }

/* Experience: company logo tile at the start of each internship header */
.xp-head { align-items: center; column-gap: var(--s5); }   /* logo, title block, and date share one centre line */
.xp-head > div { flex: 1 1 16rem; }
.xp-logo { flex: none; display: grid; place-items: center; width: 6.5rem; height: 3.25rem; padding: 0.4rem 0.6rem;
  border: 1px solid var(--rule); border-radius: 10px; background: #fff; overflow: hidden; }
.xp-logo img { max-width: 100%; max-height: 100%; object-fit: contain; }
.xp-logo.is-dark { padding: 0.3rem 0.35rem; border-color: #141517; background: #141517; }
@media (max-width: 760px) { .xp-logo { width: 5.5rem; height: 2.75rem; } }

/* Home: name block sits a little right of its centred spot, bottom-aligned with the photo */
@media (min-width: 1000px) {
  .home-id { position: relative; left: 0.75rem; align-self: end; margin-bottom: 0.75rem; }   /* icons sit just above the photo's bottom line */
  .home-id h1 { font-size: 3.35rem; }
  .home-title { margin-top: var(--s4); font-size: 1.1rem; }
  .home-icons { margin-top: var(--s4); }
  .home-icons a { width: 2.15rem; height: 2.15rem; }
  .home-icons svg { width: 1rem; height: 1rem; }
  .home-hero .home-photo { position: relative; left: 1.25rem; }
  .home-hero { grid-template-columns: auto 18.75rem; }
}
@media (max-width: 760px) { .svc-figure { max-width: 14rem; } }

/* ---------- Learn more pages, academic layout (.pp-v2) ----------
   Key facts, summary, figure, then a sticky outline beside the paper text on wide screens.
   Booktabs-style tables, a theorem box, and a contributions callout. */
.paper-page.pp-v2 { max-width: 72rem; }
.pp-v2 .pp-hero h1 { max-width: 52rem; font-size: 2.3rem; }
.pp-affil { margin-top: var(--s1); color: var(--muted); font-size: var(--fs-meta); }
.pp-facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; margin: var(--s6) 0 0; border: 1px solid var(--rule); border-radius: 14px; overflow: hidden; background: #fff; }
.pp-facts > div { padding: var(--s4) var(--s5); border-left: 1px solid var(--rule); }
.pp-facts > div:first-child { border-left: 0; }
.pp-facts dt { color: var(--faint); font-size: 0.7rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; }
.pp-facts dd { margin: var(--s1) 0 0; color: var(--ink); font-size: var(--fs-meta); font-weight: 600; line-height: 1.45; }
.pp-v2 .pp-tldr { margin-top: var(--s6); border-left: 3px solid var(--cyan); border-radius: 0 14px 14px 0; background: #f5f8fc; }
.pp-v2 .pp-figure { margin-top: var(--s6); }

.pp-layout { display: grid; grid-template-columns: 13rem minmax(0, 1fr); gap: var(--s7); align-items: start; margin-top: var(--s7); }
.pp-v2 .pp-toc { position: sticky; top: 5.5rem; flex-direction: column; align-items: stretch; flex-wrap: nowrap; gap: 2px; margin: 0;
  padding: 0 0 0 var(--s3); border: 0; border-left: 2px solid var(--rule); border-radius: 0; background: none; }
.pp-v2 .pp-toc span { margin: 0 0 var(--s2); }
.pp-v2 .pp-toc a { position: relative; padding: 0.3rem 0.5rem; border: 0; border-radius: 6px; background: none; color: var(--muted); font-weight: 600;
  transition: color 0.2s ease, background-color 0.2s ease; }
.pp-v2 .pp-toc a::before { content: ""; position: absolute; left: calc(-1 * var(--s3) - 2px); top: 0.3rem; bottom: 0.3rem; width: 2px;
  background: var(--cyan); transform: scaleY(0); transition: transform 0.25s ease; }
.pp-v2 .pp-toc a:hover { background: #f1f5f9; color: var(--ink); }
.pp-v2 .pp-toc a.active { color: var(--cyan-text); }
.pp-v2 .pp-toc a.active::before { transform: scaleY(1); }
.pp-v2 .pp-doc { margin-top: 0; min-width: 0; }
.pp-v2 .pp-sec:first-child { padding-top: 0; border-top: 0; }
.pp-v2 .pp-sec > p, .pp-v2 .pp-sec > .pp-list { max-width: 46rem; }
.pp-sec h3 { margin-top: var(--s6); color: var(--ink); font-size: 1.05rem; font-weight: 800; }
.pp-list { margin-top: var(--s3); padding-left: 1.3rem; color: var(--ink); line-height: 1.7; }
.pp-list li + li { margin-top: var(--s2); }
.pp-list li::marker { color: var(--cyan-text); font-weight: 700; }
.pp-callout, .pp-theorem { margin-top: var(--s5); padding: var(--s5) var(--s6); border: 1px solid var(--rule); border-radius: 14px; background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04); }
.pp-callout ul { margin-top: var(--s3); padding-left: 1.2rem; color: var(--ink); line-height: 1.65; }
.pp-callout li + li { margin-top: var(--s2); }
.pp-callout li::marker { color: var(--cyan); }
.pp-theorem { border-left: 3px solid var(--navy); border-radius: 0 14px 14px 0; background: #fbfcfe; }
.pp-theorem > p { margin-top: var(--s3); color: var(--ink); line-height: 1.7; }
.pp-theorem .pp-eq { margin-top: var(--s3); background: #fff; }

.pp-table-wrap { margin-top: var(--s5); overflow-x: auto; }
.pp-table-wrap.narrow { max-width: 40rem; }
.pp-table-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s6); }
.pp-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; font-variant-numeric: tabular-nums; }
.pp-table caption { caption-side: top; padding-bottom: var(--s3); color: var(--muted); font-size: var(--fs-label); line-height: 1.5; text-align: left; }
.pp-table caption b { color: var(--ink); }
.pp-table thead { border-top: 2px solid var(--ink); border-bottom: 1px solid var(--ink); }
.pp-table tbody { border-bottom: 2px solid var(--ink); }
.pp-table th, .pp-table td { padding: 0.45rem 0.6rem; text-align: center; white-space: nowrap; }
.pp-table th { color: var(--ink); font-weight: 700; }
.pp-table thead tr + tr th { padding-top: 0; color: var(--muted); font-size: 0.78rem; font-weight: 600; }
.pp-table th:first-child, .pp-table td:first-child { text-align: left; }
.pp-table td { color: #334155; }
.pp-table tbody tr { transition: background-color 0.15s ease; }
.pp-table tbody tr:hover { background: #f8fafc; }
.pp-table tr.ours { background: #eff6ff; }
.pp-table tr.ours td { color: var(--ink); }
.pp-table tr.ours td:first-child { font-weight: 800; color: var(--cyan-deep); }
.pp-table b { color: var(--ink); font-weight: 800; }

@media (max-width: 1080px) {
  .pp-layout { grid-template-columns: minmax(0, 1fr); gap: var(--s5); }
  .pp-v2 .pp-toc { position: static; flex-direction: row; flex-wrap: wrap; align-items: center; gap: var(--s2); padding: var(--s3) var(--s4);
    border: 1px solid var(--rule); border-radius: 12px; background: #f8fafc; }
  .pp-v2 .pp-toc span { margin: 0 var(--s2) 0 0; }
  .pp-v2 .pp-toc a { padding: 0.25rem 0.7rem; border: 1px solid var(--rule); border-radius: 999px; background: #fff; color: var(--ink); }
  .pp-v2 .pp-toc a::before { display: none; }
}
@media (max-width: 760px) {
  .pp-v2 .pp-hero h1 { font-size: 1.7rem; }
  .pp-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pp-facts > div:nth-child(3) { border-left: 0; }
  .pp-facts > div:nth-child(n+3) { border-top: 1px solid var(--rule); }
  .pp-table-pair { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .pp-callout, .pp-theorem { padding: var(--s4); }
}

/* Learn more pages, print-paper treatment: serif text, thin rules, square corners, no colour panels or transitions */
.pp-v2 .pp-hero h1, .pp-v2 .pp-sec h2, .pp-v2 .pp-sec h3, .pp-v2 .pp-sec > p, .pp-v2 .pp-list, .pp-v2 .pp-callout ul,
.pp-v2 .pp-theorem > p, .pp-v2 .pp-where dd, .pp-v2 .pp-tldr p, .pp-v2 .pp-figure figcaption, .pp-v2 .pp-table,
.pp-v2 .pp-refs, .pp-v2 .pp-authors, .pp-v2 .pp-affil, .pp-v2 .pp-stats li > span, .pp-v2 .pp-facts dd { font-family: var(--serif); }
.pp-v2 .pp-hero h1 { font-weight: 700; letter-spacing: -0.01em; line-height: 1.25; }
.pp-v2 .pp-sec { padding-top: var(--s6); }
.pp-v2 .pp-sec h2 { gap: 0.6rem; font-size: 1.4rem; font-weight: 700; letter-spacing: 0; }
.pp-v2 .pp-sec h3 { font-size: 1.08rem; font-weight: 700; }
.pp-v2 .pp-secnum { display: inline; min-width: 0; height: auto; padding: 0; border-radius: 0; background: none; color: var(--ink); font-size: inherit; font-weight: 700; transform: none; }
.pp-v2 .pp-sec > p, .pp-v2 .pp-list, .pp-v2 .pp-where dd { font-size: 1.04rem; line-height: 1.72; }
.pp-v2 .pp-label { color: var(--ink); font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; }
.pp-v2 .pp-btn { border-radius: 4px; transition: none; }
.pp-v2 .pp-facts { border-radius: 0; border-width: 1px 0; border-color: var(--ink); background: none; }
.pp-v2 .pp-facts > div { padding: var(--s3) var(--s4); }
.pp-v2 .pp-facts dd { font-weight: 400; }
.pp-v2 .pp-tldr { padding: var(--s4) 0 var(--s4) var(--s5); border-left: 2px solid var(--ink); border-radius: 0; background: none; }
.pp-v2 .pp-tldr p { font-size: 1.06rem; }
.pp-v2 .pp-figure a { border-radius: 0; background: none; padding: 0; }
.pp-v2 .pp-figure img { border-radius: 0; }
.pp-v2 .pp-figure figcaption { text-align: left; }
.pp-v2 .pp-sec .pp-eq, .pp-v2 .pp-theorem .pp-eq { padding: var(--s2) 0; border: 0; border-radius: 0; background: none; color: var(--ink); }
.pp-v2 .pp-where { border-left: 0; padding-left: var(--s5); }
.pp-v2 .pp-where dt { color: var(--ink); font-weight: 400; }
.pp-v2 .pp-list li::marker, .pp-v2 .pp-callout li::marker { color: var(--ink); font-weight: 400; }
.pp-v2 .pp-callout, .pp-v2 .pp-theorem { border-radius: 0; box-shadow: none; background: none; }
.pp-v2 .pp-callout { border-width: 1px 0; border-color: var(--rule); padding: var(--s4) 0; }
.pp-v2 .pp-theorem { border: 0; border-left: 2px solid var(--ink); padding: var(--s2) 0 var(--s2) var(--s5); }
.pp-v2 .pp-theorem > p { font-style: italic; }
.pp-v2 .pp-stats { gap: 0; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink); }
.pp-v2 .pp-stats li { padding: var(--s4) var(--s5) var(--s4) 0; border-radius: 0; background: none; }
.pp-v2 .pp-stats li + li { padding-left: var(--s5); border-left: 1px solid var(--rule); }
.pp-v2 .pp-stats strong { color: var(--ink); font-family: var(--serif); font-size: 1.6rem; font-weight: 700; letter-spacing: 0; }
.pp-v2 .pp-table tbody tr { transition: none; }
.paper-page.pp-v2 p, .paper-page.pp-v2 li, .paper-page.pp-v2 dd { text-wrap: wrap; text-wrap: pretty; }
.pp-v2 .pp-sec p .katex, .pp-v2 .pp-list .katex, .pp-v2 .pp-where .katex, .pp-v2 .pp-table .katex { font-size: 1.04em; }
.pp-v2 .pp-bib, .pp-v2 .pp-bib pre { border-radius: 4px; }
.pp-v2 .pp-table tbody tr:hover { background: none; }
.pp-v2 .pp-table tr.ours { background: #f1f3f5; }
.pp-v2 .pp-table tr.ours td:first-child { color: var(--ink); font-weight: 700; }
.pp-v2 .pp-table b { font-weight: 700; }
.pp-v2 .pp-table td { color: var(--ink); }
.pp-v2 .pp-toc a, .pp-v2 .pp-toc a::before { transition: none; }
.pp-v2 .pp-toc a { border-radius: 0; }
.pp-v2 .pp-toc a.active { color: var(--ink); }
.pp-v2 .pp-toc a.active::before { background: var(--ink); }
@media (max-width: 760px) {
  .pp-v2 .pp-stats li, .pp-v2 .pp-stats li + li { padding: var(--s3) 0; border-left: 0; }
  .pp-v2 .pp-stats li + li { border-top: 1px solid var(--rule); }
}

/* Learn more pages: one measure for text, rules, equations and tables, so the right edge lines up */
.paper-page.pp-v2 { max-width: 66rem; }
.pp-v2 .pp-sec > p, .pp-v2 .pp-sec > .pp-list, .pp-v2 .pp-tldr p { max-width: none; }
.pp-v2 .pp-table-wrap.narrow { max-width: none; }
.pp-v2 .pp-table tr.pp-rule td { border-top: 1px solid var(--ink); }
@media (min-width: 1081px) { .pp-v2 .pp-layout { grid-template-columns: 11rem minmax(0, 1fr); } }
@media (max-width: 1080px) { .paper-page.pp-v2 { max-width: 48rem; } }
.pp-v2 .pp-sec > .pp-callout:last-child { border-bottom: 0; padding-bottom: 0; }
.pp-v2 .pp-where-lead { font-style: normal; color: var(--ink); }
.pp-sc { font-variant: small-caps; letter-spacing: 0.02em; }
.pp-v2 .pp-table tr.pp-group td { padding-top: 0.7rem; color: var(--muted); font-style: italic; text-align: left; border-top: 1px solid var(--rule); }
.pp-v2 .pp-table.compact { font-size: 0.8rem; }
.pp-v2 .pp-table.compact th, .pp-v2 .pp-table.compact td { padding-left: 0.35rem; padding-right: 0.35rem; }
.pp-eq, .pp-table-wrap { position: relative; }   /* keeps KaTeX hidden MathML inside the scrolling box */

/* ---------- Learn more pages, methods-first additions ----------
   Smaller figures, numbered display equations, an algorithm box, and a one-line finding under each table. */
.pp-v2 .pp-figure.fig-sm { max-width: 30rem; margin-left: auto; margin-right: auto; }
.pp-v2 .pp-figure.fig-md { max-width: 44rem; margin-left: auto; margin-right: auto; }
.pp-v2 .pp-figure.fig-lg { max-width: 54rem; margin-left: auto; margin-right: auto; }
.pp-v2 .pp-eq[data-n] { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: var(--s4); }
.pp-v2 .pp-eq[data-n] > .katex-display { min-width: 0; overflow-x: auto; overflow-y: hidden; }
.pp-v2 .pp-eq[data-n]::after { content: "(" attr(data-n) ")"; color: var(--ink); font-family: var(--serif); font-size: 0.95rem; }
.pp-v2 .pp-sec h3 .pp-secnum { margin-right: 0.55em; }
.pp-algo { margin-top: var(--s5); border-top: 1.5px solid var(--ink); border-bottom: 1.5px solid var(--ink); font-family: var(--serif); color: var(--ink); }
.pp-algo-title { padding: 0.35rem 0; border-bottom: 1px solid var(--ink); font-size: 0.95rem; }
.pp-algo-io { margin: 0; padding: 0.45rem 0 0; font-size: 0.92rem; line-height: 1.6; }
.pp-algo ol { margin: 0.35rem 0 0.5rem; padding-left: 2rem; font-size: 0.92rem; line-height: 1.7; }
.pp-algo ol li::marker { color: var(--muted); font-size: 0.85em; }
.pp-algo .in1 { margin-left: 1.25rem; }
.pp-algo .cm { color: var(--muted); font-style: italic; }
.pp-v2 .pp-finding { margin-top: var(--s3); font-family: var(--serif); color: var(--ink); line-height: 1.65; }
.pp-v2 .pp-finding > b:first-child { font-style: italic; font-weight: 700; }
.pp-v2 .pp-table td.l, .pp-v2 .pp-table th.l { text-align: left; }
.pp-v2 .pp-table.rq td, .pp-v2 .pp-table.wrap td { vertical-align: top; text-align: left; line-height: 1.5; white-space: normal; }
.pp-v2 .pp-table.rq td:first-child { white-space: nowrap; font-weight: 700; }
.pp-v2 .pp-table.rq td:last-child { min-width: 6.5rem; }
@media (max-width: 760px) { .pp-v2 .pp-eq[data-n]::after { font-size: 0.85rem; } }

/* Leadership: positions always in the accent blue (Services keeps the default colours) */
.activities-page .timeline:not(.compact) .item h3 { color: var(--cyan-text); }

/* Learn more pages: research pitch video above the architecture figure */
.pp-video { max-width: 46rem; margin: var(--s6) auto 0; }
.pp-video video { display: block; width: 100%; aspect-ratio: 16 / 9; background: #0b1220; border: 1px solid var(--rule); }
.pp-video figcaption { margin-top: var(--s2); color: var(--muted); font-family: var(--serif); font-size: var(--fs-meta); }

/* Research: research-area tags under each paper's badge; own name highlighted in the accent blue */
.paper-areas { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.15rem 0; margin-top: var(--s4);
  color: #475569; font-family: var(--serif); font-size: 0.92rem; font-style: italic; line-height: 1.5; }
.paper-areas::before { content: "Research area"; flex-basis: 100%; margin-bottom: 0.2rem; color: var(--cyan-text); font-family: var(--font);
  font-style: normal; font-size: 0.66rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; }
.paper-areas span { white-space: nowrap; }
.paper-areas i { margin: 0 0.45rem; color: #94a3b8; font-style: normal; }
.paper .authors .me, .authors .me, .pp-authors .me { color: var(--cyan-text); font-weight: 800; text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 3px; }

/* Project pages (pp-v2): left-aligned headers in text tables; stage names on one line */
.pp-v2 .pp-table.wrap th { text-align: left; }
.pp-v2 .pp-table.steps td:first-child { white-space: nowrap; font-weight: 700; }
.pp-v2 .pp-gallery figure a, .pp-v2 .pp-gallery img { border-radius: 0; }
.pp-v2 .pp-gallery figcaption { font-family: var(--serif); text-align: left; }
