/* Homepage of Xiangru (Edward) Jian.
   Layout: one ~920px reading column with generous whitespace (al-folio spirit), a sticky hairline
   nav, and a psql-style job-market console as the single bold object on the page. */

/* Self-hosted fonts (SIL Open Font License; latin subset): IBM Plex Sans, IBM Plex Mono, Newsreader */
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/ibm-plex-mono-normal-400.woff2") format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/ibm-plex-mono-normal-500.woff2") format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: italic;
  font-weight: 400;
  font-stretch: 100%;
  font-display: swap;
  src: url("../fonts/ibm-plex-sans-italic.woff2") format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 400;
  font-stretch: 100%;
  font-display: swap;
  src: url("../fonts/ibm-plex-sans-normal.woff2") format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 500;
  font-stretch: 100%;
  font-display: swap;
  src: url("../fonts/ibm-plex-sans-normal.woff2") format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 600;
  font-stretch: 100%;
  font-display: swap;
  src: url("../fonts/ibm-plex-sans-normal.woff2") format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Newsreader';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/newsreader-italic.woff2") format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Newsreader';
  font-style: italic;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/newsreader-italic.woff2") format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Newsreader';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/newsreader-normal.woff2") format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Newsreader';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/newsreader-normal.woff2") format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Newsreader';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/newsreader-normal.woff2") format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  /* color: cool paper + ink, a City-sky accent, Waterloo gold for status and honors */
  --paper: #fbfcfe;
  --surface: #ffffff;
  --ink: #131a24;
  --ink-2: #3a4655;
  --muted: #637083;
  --line: #e3e8ef;
  --line-strong: #cad3df;
  --sky: #1c6bb0;
  --sky-ink: #134f85;
  --sky-wash: #e9f2fb;
  --gold: #875e05;
  --gold-wash: #fbf3dd;
  --green: #1f7a4d;
  --green-wash: #e5f4ec;
  --rose: #a2405a;
  --rose-wash: #fbe9ee;
  --shadow: 0 1px 2px rgba(19, 26, 36, .05), 0 8px 24px -16px rgba(19, 26, 36, .25);

  /* the console keeps one dark look in both themes */
  --console: #0f1823;
  --console-bar: #142131;
  --console-ink: #d8e4f0;
  --console-dim: #7d91a6;
  --console-line: #233548;
  --console-key: #7fc1f2;
  --console-str: #f0c36a;
  --console-ok: #62d39c;

  /* type */
  --font-display: "Newsreader", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --font-body: "IBM Plex Sans", "Helvetica Neue", Arial, system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --step--2: .75rem;
  --step--1: .8125rem;
  --step-0: 1rem;
  --step-1: 1.125rem;
  --step-2: 1.375rem;
  --step-3: clamp(1.6rem, 1.3rem + 1vw, 1.95rem);
  --step-4: clamp(2.3rem, 1.6rem + 3vw, 3.35rem);

  --wrap: 920px;
  --gutter: 20px;
  --radius: 10px;
  --nav-h: 56px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0d1218;
    --surface: #131a23;
    --ink: #e6ecf3;
    --ink-2: #c2ccd8;
    --muted: #8a98aa;
    --line: #212d3b;
    --line-strong: #2e3d4f;
    --sky: #7dbbe9;
    --sky-ink: #a6d1f3;
    --sky-wash: #132639;
    --gold: #e2b65a;
    --gold-wash: #2a2313;
    --green: #6fd3a2;
    --green-wash: #13281f;
    --rose: #ee9ab0;
    --rose-wash: #2c1820;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 12px 28px -18px rgba(0, 0, 0, .7);
    --console: #0a1017;
    --console-bar: #0f1822;
    --console-line: #1f2e3e;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0d1218;
  --surface: #131a23;
  --ink: #e6ecf3;
  --ink-2: #c2ccd8;
  --muted: #8a98aa;
  --line: #212d3b;
  --line-strong: #2e3d4f;
  --sky: #7dbbe9;
  --sky-ink: #a6d1f3;
  --sky-wash: #132639;
  --gold: #e2b65a;
  --gold-wash: #2a2313;
  --green: #6fd3a2;
  --green-wash: #13281f;
  --rose: #ee9ab0;
  --rose-wash: #2c1820;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 12px 28px -18px rgba(0, 0, 0, .7);
  --console: #0a1017;
  --console-bar: #0f1822;
  --console-line: #1f2e3e;
  color-scheme: dark;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 16px); }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.65;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--sky); text-decoration: none; text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { color: var(--sky-ink); text-decoration: underline; }
:focus-visible { outline: 2px solid var(--sky); outline-offset: 2px; border-radius: 4px; }
b, strong { font-weight: 600; }
h1, h2, h3, h4 { text-wrap: balance; margin: 0; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }

.wrap { width: 100%; max-width: calc(var(--wrap) + 2 * var(--gutter)); margin-inline: auto; padding-inline: var(--gutter); }

.i { width: 1em; height: 1em; flex: none; display: inline-block; vertical-align: -0.125em; }

.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--surface); padding: .5rem .75rem; border-radius: 6px; }
.skip:focus { left: 12px; }

/* ---------- progress + nav ---------- */
.progress { position: fixed; inset: 0 0 auto 0; height: 2px; z-index: 60; pointer-events: none; }
.progress span { display: block; height: 100%; width: 0; background: var(--sky); transition: width .1s linear; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  padding-top: env(safe-area-inset-top, 0px);
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar__inner { display: flex; align-items: center; gap: 1.25rem; min-height: var(--nav-h); }
.brand { font-family: var(--font-display); font-size: 1.15rem; font-weight: 500; color: var(--ink); letter-spacing: -.005em; white-space: nowrap; }
.brand:hover { color: var(--ink); text-decoration: none; }
.navlinks { display: flex; gap: .15rem; margin-left: auto; overflow-x: auto; scrollbar-width: none; }
.navlinks::-webkit-scrollbar { display: none; }
.navlinks a {
  display: block;
  padding: .35rem .6rem;
  font-size: .875rem;
  color: var(--muted);
  border-radius: 6px;
  white-space: nowrap;
}
.navlinks a:hover { color: var(--ink); background: var(--sky-wash); text-decoration: none; }
.navlinks a:focus-visible { outline-offset: -2px; }
.navlinks a[aria-current="true"] { color: var(--ink); box-shadow: inset 0 -2px 0 var(--sky); border-radius: 0; }
.topbar__actions { display: flex; align-items: center; gap: .5rem; }

.theme-toggle {
  display: inline-grid; place-items: center;
  width: 34px; height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
}
.theme-toggle:hover { color: var(--ink); border-color: var(--line-strong); }
.theme-toggle .i { width: 17px; height: 17px; }
.theme-toggle .i--sun { display: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .theme-toggle .i--sun { display: block; } :root:not([data-theme="light"]) .theme-toggle .i--moon { display: none; } }
:root[data-theme="dark"] .theme-toggle .i--sun { display: block; }
:root[data-theme="dark"] .theme-toggle .i--moon { display: none; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .45rem;
  padding: .5rem .9rem;
  border-radius: 8px;
  border: 1px solid transparent;
  font-size: .875rem; font-weight: 500; line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color .15s, border-color .15s, color .15s, transform .15s;
}
.btn:hover { text-decoration: none; }
.btn--small { padding: .38rem .7rem; font-size: .8125rem; }
.btn--solid { background: var(--ink); color: var(--paper); }
.btn--solid:hover { background: var(--sky); color: var(--paper); }

/* ---------- hero ---------- */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 216px;
  gap: 2.75rem;
  align-items: start;
  padding-block: 3.5rem 2.25rem;
}
.name {
  font-family: var(--font-display);
  font-size: var(--step-4);
  font-weight: 500;
  line-height: 1.04;
  letter-spacing: -.018em;
  font-optical-sizing: auto;
}
.name__nick { font-style: italic; font-weight: 400; color: var(--muted); }
.name__native { font-family: "Noto Serif SC", "Songti SC", serif; font-size: .6em; font-weight: 400; color: var(--muted); letter-spacing: .04em; }
.status-pill {
  display: inline-flex; align-items: center; gap: .5rem;
  margin-bottom: 1rem;
  padding: .25rem .7rem;
  border: 1px solid color-mix(in srgb, var(--gold) 40%, transparent);
  border-radius: 999px;
  background: var(--gold-wash);
  color: var(--gold);
  font-family: var(--font-mono); font-size: var(--step--2); font-weight: 500; letter-spacing: .02em;
}
.status-pill:hover { text-decoration: none; color: var(--gold); border-color: var(--gold); }
.status-pill__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); }
.hero__role { margin-top: .85rem; color: var(--ink-2); font-size: var(--step-1); line-height: 1.45; }
.hero__role a { color: inherit; border-bottom: 1px solid var(--line-strong); }
.hero__role a:hover { color: var(--sky); border-color: var(--sky); text-decoration: none; }
.bio { margin-top: 1.4rem; color: var(--ink-2); max-width: 64ch; display: grid; gap: .9rem; }
.bio strong { color: var(--ink); }

.links { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.5rem; }
.link-chip {
  display: inline-flex; align-items: center; gap: .45rem;
  padding: .32rem .75rem .32rem .6rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font-size: .8125rem; font-weight: 500;
  color: var(--ink-2);
  transition: border-color .15s, color .15s, transform .15s;
}
.link-chip .i { color: var(--muted); transition: color .15s; }
.link-chip:hover { color: var(--ink); border-color: var(--ink); text-decoration: none; transform: translateY(-1px); }
.link-chip:hover .i { color: var(--sky); }

.hero__photo { margin: .35rem 0 0; }
.hero__photo img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: var(--radius);
  background: var(--line);
  box-shadow: var(--shadow);
}
.hero__photo figcaption { display: flex; align-items: center; gap: .35rem; margin-top: .7rem; font-size: var(--step--1); color: var(--muted); }

/* ---------- job-market console ---------- */
.market {
  border-radius: 12px;
  overflow: hidden;
  background: var(--console);
  color: var(--console-ink);
  border: 1px solid var(--console-line);
  box-shadow: 0 24px 48px -32px rgba(10, 20, 32, .65);
}
.market :focus-visible { outline-color: var(--console-key); }
.market__bar {
  display: flex; align-items: center; gap: .9rem; flex-wrap: wrap;
  padding: .55rem 1rem;
  background: var(--console-bar);
  border-bottom: 1px solid var(--console-line);
  font-family: var(--font-mono);
  font-size: var(--step--2);
  color: var(--console-dim);
}
.dots { display: inline-flex; gap: 6px; }
.dots span { width: 10px; height: 10px; border-radius: 50%; background: var(--console-line); }
.market__status {
  margin-left: auto;
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .18rem .6rem;
  border: 1px solid color-mix(in srgb, var(--console-str) 45%, transparent);
  border-radius: 999px;
  color: var(--console-str);
  font-weight: 500;
  letter-spacing: .02em;
  font-size: inherit;
}
.pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--console-ok); box-shadow: 0 0 0 0 color-mix(in srgb, var(--console-ok) 60%, transparent); animation: pulse 2.4s ease-out 2; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--console-ok) 55%, transparent); } 70%, 100% { box-shadow: 0 0 0 7px transparent; } }

.market__body { padding: 1.1rem 1.25rem .9rem; font-family: var(--font-mono); font-size: .875rem; line-height: 1.6; overflow-x: auto; }
.sql { margin: 0; font: inherit; white-space: pre; color: var(--console-ink); }
.pr { color: var(--console-dim); user-select: none; }
.kw { color: var(--console-key); }
.str { color: var(--console-str); }
.psql-wrap { margin: .7rem 0 .55rem; }
.psql { border-collapse: collapse; font-size: inherit; }
.psql th { font-weight: 500; color: var(--console-ink); text-align: center; padding: 0 .9rem .1rem; border-bottom: 1px solid var(--console-dim); }
.psql td { padding: .05rem .9rem; white-space: nowrap; }
.psql th + th, .psql td + td { border-left: 1px solid var(--console-dim); }
.psql th:first-child, .psql td:first-child { padding-left: .1rem; }
.ok { color: var(--console-ok); }
.ok::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: currentColor; margin-right: .45rem; vertical-align: .12em; }
.psql-foot { color: var(--console-dim); margin-top: .35rem; }
.caret { display: inline-block; width: .55em; height: 1.05em; background: var(--console-ink); vertical-align: -0.18em; animation: blink 1.1s steps(1) 4; }
@keyframes blink { 50% { opacity: 0; } }

.market__foot {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem 1.5rem;
  padding: 1rem 1.25rem 1.1rem;
  border-top: 1px solid var(--console-line);
  background: var(--console-bar);
}
.market__note { flex: 1 1 18rem; min-width: 0; font-size: .9375rem; color: var(--console-ink); line-height: 1.55; }
.market__note b { color: #fff; }
.market__cvnote { display: block; margin-top: .3rem; font-size: .8125rem; color: var(--console-dim); }
.market__actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.btn--light { background: var(--console-ink); color: var(--console); }
.btn--light:hover { background: #fff; color: var(--console); }
.btn--ghost { border-color: var(--console-line); color: var(--console-ink); background: transparent; }
.btn--ghost:hover { border-color: var(--console-dim); color: #fff; }
.email-copy { display: inline-flex; align-items: stretch; }
.email-copy .btn { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.email-text { user-select: all; }
.copy {
  position: relative;
  display: inline-grid; place-items: center;
  width: 36px;
  border: 1px solid var(--console-line); border-left: 0;
  border-radius: 0 8px 8px 0;
  background: transparent;
  color: var(--console-dim);
  cursor: pointer;
}
.copy:hover { color: #fff; border-color: var(--console-dim); }
.copy__done { position: absolute; bottom: calc(100% + 6px); right: 0; font-size: var(--step--2); color: var(--console-ok); white-space: nowrap; font-family: var(--font-mono); }

/* ---------- sections ---------- */
.section { padding-block: 3.75rem 0; }
.section__head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; padding-bottom: .9rem; margin-bottom: 1.6rem; border-bottom: 1px solid var(--line); }
.section h2 { font-family: var(--font-display); font-size: var(--step-3); font-weight: 500; letter-spacing: -.01em; line-height: 1.15; }
.section__aside { display: inline-flex; align-items: center; gap: .3rem; font-size: .875rem; }
.label { font-family: var(--font-mono); font-size: var(--step--2); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }

/* research */
.vision {
  font-family: var(--font-display);
  font-size: var(--step-2);
  line-height: 1.45;
  color: var(--ink);
  max-width: 40em;
  font-optical-sizing: auto;
}
.thesis { display: flex; flex-wrap: wrap; align-items: baseline; gap: .35rem .75rem; margin-top: 1.1rem; }
.thesis__title { font-style: italic; color: var(--ink-2); }

.themes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; margin-top: 2.25rem; }
.theme { display: flex; flex-direction: column; gap: .6rem; padding: 1.25rem 1.2rem 1.3rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); min-width: 0; }
.theme__icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 9px; background: var(--sky-wash); color: var(--sky); }
.theme__icon .i { width: 19px; height: 19px; }
.theme__title { font-size: 1.0625rem; font-weight: 600; line-height: 1.3; margin-top: .2rem; }
.theme__text { font-size: .9rem; line-height: 1.55; color: var(--ink-2); }
.works { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: auto; padding-top: .5rem; }
.work {
  display: inline-flex; align-items: baseline; gap: .4rem;
  padding: .2rem .55rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: .8125rem; line-height: 1.35;
  color: var(--ink);
  background: var(--paper);
  transition: border-color .15s, background-color .15s;
  flex-wrap: wrap; row-gap: 0;
}
a.work:hover { border-color: var(--sky); background: var(--sky-wash); text-decoration: none; color: var(--ink); }
.work__name { font-weight: 500; }
.work__venue { font-family: var(--font-mono); font-size: .6875rem; color: var(--muted); white-space: nowrap; }

.highlights { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 2rem 0 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.highlight { padding: 1rem 1rem 1.05rem; min-width: 0; }
.highlight + .highlight { border-left: 1px solid var(--line); }
.highlight dt { font-family: var(--font-display); font-size: 1.6rem; font-weight: 500; line-height: 1.1; font-variant-numeric: tabular-nums; }
.highlight dt a { color: var(--ink); }
.highlight dt a:hover { color: var(--sky); text-decoration: none; }
.highlight dd { margin: .35rem 0 0; font-size: var(--step--1); line-height: 1.45; color: var(--muted); }

/* datasets */
.section__aside--muted { color: var(--muted); font-family: var(--font-mono); font-size: var(--step--2); }
.section__intro { max-width: 64ch; margin: -.4rem 0 1.5rem; color: var(--ink-2); font-size: .9375rem; }
.datasets { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.dataset {
  display: flex; flex-direction: column; gap: .7rem;
  min-width: 0;
  padding: 1.15rem 1.2rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.dataset__head { display: grid; gap: .2rem; }
.dataset__domain { font-family: var(--font-mono); font-size: .6875rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.dataset__name { font-family: var(--font-display); font-size: 1.4rem; font-weight: 500; line-height: 1.2; letter-spacing: -.005em; }
.dataset__name a { color: var(--ink); }
.dataset__name a:hover { color: var(--sky); }
.dataset__meta { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .6rem; }
.dataset__venue { font-family: var(--font-mono); font-size: var(--step--2); color: var(--sky); }
.dataset__role { padding: .05rem .45rem; border-radius: 4px; background: var(--gold-wash); color: var(--gold); font-size: .72rem; font-weight: 600; }
.dataset__desc { font-size: .875rem; line-height: 1.55; color: var(--ink-2); }
.dataset__stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem 1rem; margin: auto 0 0; padding-top: .8rem; border-top: 1px dashed var(--line-strong); }
.dataset__stats--n3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.dstat { min-width: 0; }
.dstat dt { font-family: var(--font-display); font-size: 1.45rem; font-weight: 500; line-height: 1.1; color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.dstat dd { margin: .2rem 0 0; font-size: .75rem; line-height: 1.35; color: var(--muted); }
.dataset__links { display: flex; flex-wrap: wrap; gap: .4rem; }
.dataset--suite { grid-column: 1 / -1; }
/* an odd card at the end of the grid spans the full row */
.dataset:not(.dataset--suite):last-child:nth-child(even) { grid-column: 1 / -1; }
.dataset:not(.dataset--suite):last-child:nth-child(even) .dataset__stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.suite { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; margin-top: .2rem; }
.suite__part { display: flex; flex-direction: column; gap: .45rem; min-width: 0; padding: .9rem .95rem 1rem; border-radius: 8px; background: var(--paper); border: 1px solid var(--line); }
.suite__name { font-family: var(--font-display); font-size: 1.15rem; font-weight: 500; line-height: 1.2; }
.suite__name a { color: var(--ink); }
.suite__name a:hover { color: var(--sky); }
.suite__desc { font-size: .8125rem; line-height: 1.5; color: var(--ink-2); }
.dataset__stats--compact { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem .75rem; padding-top: .65rem; }
.dataset__stats--compact .dstat dt { font-size: 1.2rem; }
.dataset__links:empty { display: none; }

/* news */
.news { display: grid; }
.news__item {
  display: grid;
  grid-template-columns: 5.25rem 4.6rem minmax(0, 1fr);
  gap: .25rem 1rem;
  align-items: baseline;
  padding-block: .6rem;
  border-bottom: 1px dashed var(--line);
}
.news__item:last-child { border-bottom: 0; }
.js .news.is-collapsed .is-extra { display: none; }
.news__date { font-family: var(--font-mono); font-size: var(--step--1); color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.news__tag {
  justify-self: start;
  font-family: var(--font-mono); font-size: .6875rem; letter-spacing: .04em; text-transform: lowercase;
  padding: .05rem .45rem; border-radius: 4px;
  color: var(--muted); background: var(--line);
}
.news__tag--paper { color: var(--sky); background: var(--sky-wash); }
.news__tag--talk { color: var(--rose); background: var(--rose-wash); }
.news__tag--career { color: var(--gold); background: var(--gold-wash); }
.news__tag--release { color: var(--green); background: var(--green-wash); }
.news__text { font-size: .9375rem; line-height: 1.6; color: var(--ink-2); min-width: 0; }
.news__text b { color: var(--ink); }

.more-btn {
  margin-top: 1rem;
  padding: .45rem .9rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  font-size: .875rem; color: var(--ink-2);
  cursor: pointer;
}
.more-btn:hover { border-color: var(--line-strong); color: var(--ink); }
html:not(.js) .more-btn,
html:not(.js) .pubbar,
html:not(.js) .theme-toggle,
html:not(.js) .copy,
html:not(.js) .more-toggle { display: none; }
html:not(.js) .email-copy .btn { border-radius: 8px; }
html:not(.js) .more-authors[hidden] { display: inline !important; }

/* publications */
.pubbar { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1rem; }
.seg { display: inline-flex; padding: 3px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); }
.seg__btn { border: 0; background: transparent; padding: .35rem .8rem; border-radius: 6px; font-size: .875rem; font-weight: 500; color: var(--muted); cursor: pointer; }
.seg__btn[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.seg__count { font-family: var(--font-mono); font-size: .75rem; }
.topics { display: flex; flex-wrap: wrap; gap: .35rem; }
.topic { border: 1px solid var(--line); background: transparent; padding: .25rem .65rem; border-radius: 999px; font-size: .8125rem; color: var(--ink-2); cursor: pointer; }
.topic:hover { border-color: var(--line-strong); color: var(--ink); }
.topic[aria-pressed="true"] { border-color: var(--sky); color: var(--sky); background: var(--sky-wash); }
.legend { display: flex; flex-wrap: wrap; gap: .25rem 1.1rem; margin-top: 1rem; font-size: var(--step--1); color: var(--muted); }
.legend__count { margin-left: auto; font-family: var(--font-mono); font-size: var(--step--2); }

.pubs { margin-top: .5rem; }
.pub { display: grid; grid-template-columns: 6rem minmax(0, 1fr); gap: 1.25rem; padding-block: 1.25rem; border-bottom: 1px solid var(--line); }
.pub:last-child, .pub.is-last { border-bottom: 0; }
.pub.is-hidden { display: none; }
.pub__venue { display: flex; flex-direction: column; align-items: stretch; gap: .3rem; padding-top: .2rem; }
.venue {
  display: block;
  padding: .3rem .25rem;
  border-radius: 6px;
  font-family: var(--font-mono); font-size: .6875rem; font-weight: 500; letter-spacing: .03em;
  text-align: center; line-height: 1.25;
  border: 1px solid transparent;
}
.venue--conf { background: var(--sky-wash); color: var(--sky); }
.venue--journal { background: var(--gold-wash); color: var(--gold); }
.venue--demo { background: var(--green-wash); color: var(--green); }
.venue--workshop, .venue--preprint { border-color: var(--line-strong); color: var(--muted); }
.pub__year { font-family: var(--font-mono); font-size: var(--step--2); color: var(--muted); text-align: center; }
.pub__body { min-width: 0; display: grid; gap: .3rem; }
.pub__title { font-size: 1.0625rem; font-weight: 600; line-height: 1.4; }
.pub__title a { color: var(--ink); }
.pub__title a:hover { color: var(--sky); }
.pub__authors { font-size: .9rem; color: var(--ink-2); line-height: 1.55; }
.me { color: var(--ink); font-weight: 600; text-decoration: underline; text-decoration-color: var(--sky); text-decoration-thickness: 2px; text-underline-offset: .2em; }
.more-toggle { border: 0; background: none; padding: 0; color: var(--sky); font-size: inherit; cursor: pointer; }
.more-authors:focus { outline: none; }
.more-toggle:hover { text-decoration: underline; }
.pub__where { font-size: .875rem; color: var(--muted); }
.pub__tldr { font-size: .875rem; color: var(--ink-2); line-height: 1.55; max-width: 72ch; }
.pub__links { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .35rem; }
.lbtn {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .18rem .55rem;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  font-size: .78rem; font-weight: 500;
  color: var(--ink-2);
}
.lbtn .i { color: var(--muted); }
.lbtn:hover { border-color: var(--sky); color: var(--sky); text-decoration: none; }
.lbtn:hover .i { color: var(--sky); }
.award {
  display: inline-flex; align-items: center;
  padding: .18rem .55rem;
  border-radius: 6px;
  font-size: .78rem; font-weight: 600;
  color: var(--gold);
  background: var(--gold-wash);
}
.pubs__empty { padding: 1.5rem 0; color: var(--muted); }

/* experience */
.cols { display: grid; gap: 2.5rem; }
.cols--exp { grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); }
.cols--three { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2rem; }
.col__label { margin-bottom: 1rem; font-family: var(--font-mono); font-size: var(--step--2); font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.timeline { position: relative; display: grid; gap: 1.4rem; padding-left: 1.25rem; }
.timeline::before { content: ""; position: absolute; left: 3px; top: .5rem; bottom: .5rem; width: 1px; background: var(--line-strong); }
.tl { position: relative; min-width: 0; }
.tl::before { content: ""; position: absolute; left: calc(-1.25rem + 0px); top: .48rem; width: 7px; height: 7px; border-radius: 50%; background: var(--paper); border: 1.5px solid var(--sky); }
.tl:first-child::before { background: var(--sky); }
.tl__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: .1rem 1rem; }
.tl__org { font-weight: 600; line-height: 1.4; }
.tl__org a { color: var(--ink); }
.tl__org a:hover { color: var(--sky); }
.tl__dates { font-family: var(--font-mono); font-size: var(--step--2); color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.tl__dates--block { margin-top: .1rem; }
.tl__role { font-size: .9rem; color: var(--ink-2); }
.tl__detail { margin-top: .3rem; font-size: .875rem; color: var(--muted); line-height: 1.55; }
.tl__mentor { display: block; margin-top: .15rem; }

/* talks */
.talks { display: grid; }
.talk { display: grid; grid-template-columns: 5.25rem minmax(0, 1fr); gap: 1rem; padding-block: .75rem; border-bottom: 1px dashed var(--line); }
.talk:last-child { border-bottom: 0; }
.talk__date { font-family: var(--font-mono); font-size: var(--step--1); color: var(--muted); padding-top: .1rem; white-space: nowrap; }
.talk__body { display: grid; gap: .1rem; min-width: 0; }
.talk__venue { font-weight: 600; }
.talk__venue a { color: var(--ink); }
.talk__venue a:hover { color: var(--sky); }
.talk__title { font-family: var(--font-display); font-size: 1.0625rem; font-style: italic; color: var(--ink-2); line-height: 1.45; }
.talk__slides { display: inline-flex; align-items: center; gap: .25rem; margin-left: .35rem; font-family: var(--font-body); font-style: normal; font-size: .8rem; }

/* teaching / service / honors */
.h2--small { font-family: var(--font-display); font-size: 1.35rem !important; padding-bottom: .6rem; margin-bottom: 1rem !important; border-bottom: 1px solid var(--line); }
.plain { display: grid; gap: .85rem; font-size: .9rem; color: var(--ink-2); line-height: 1.5; }
.plain b { color: var(--ink); }
.sub { display: block; margin-top: .1rem; font-size: var(--step--1); color: var(--muted); }
.course { font-family: var(--font-mono); font-size: .8rem; font-weight: 500; color: var(--sky); margin-right: .25rem; }

/* footer */
.footer { margin-top: 4.5rem; border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom, 0px); }
.footer__inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 1.5rem; padding-block: 1.5rem 2rem; font-size: var(--step--1); color: var(--muted); }
.footer a { color: var(--muted); }
.footer a:hover { color: var(--sky); }

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .themes { grid-template-columns: minmax(0, 1fr); }
  .theme { display: grid; grid-template-columns: 36px minmax(0, 1fr); column-gap: 1rem; }
  .theme > *:not(.theme__icon) { grid-column: 2; }
  .theme__icon { grid-row: 1 / span 2; }
  .highlights { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .highlight:nth-child(3) { border-left: 0; }
  .highlight:nth-child(n + 3) { border-top: 1px solid var(--line); }
  .cols--exp, .cols--three { grid-template-columns: minmax(0, 1fr); }
  .suite { grid-template-columns: minmax(0, 1fr); }
  .suite .dataset__stats--compact { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* Two-row top nav whenever the seven section links no longer fit on one row */
@media (max-width: 820px) {
  :root { --nav-h: auto; }
  .topbar__inner { flex-wrap: wrap; gap: 0 .75rem; padding-top: .45rem; }
  .brand { order: 1; }
  .topbar__actions { order: 2; margin-left: auto; }
  .navlinks {
    order: 3;
    width: calc(100% + 2 * var(--gutter));
    margin: .25rem calc(-1 * var(--gutter)) 0;
    padding: 0 2rem .25rem calc(var(--gutter) - .6rem);
    -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 2rem), transparent);
    mask-image: linear-gradient(90deg, #000 calc(100% - 2rem), transparent);
  }
  html { scroll-padding-top: 104px; }
}

@media (max-width: 720px) {
  :root { --gutter: 16px; }

  .hero { grid-template-columns: minmax(0, 1fr); gap: 1.5rem; padding-block: 2rem 1.75rem; }
  .hero__photo { order: -1; display: flex; align-items: flex-end; gap: 1rem; margin: 0; }
  .hero__photo img { width: 112px; }
  .hero__photo figcaption { margin: 0 0 .25rem; }

  .market__status { margin-left: 0; }
  .market__path { display: none; }
  .market__body { font-size: .72rem; padding-inline: .9rem; }
  .psql th, .psql td { padding-inline: .5rem; }
  .market__foot { padding-inline: 1rem; }

  .section { padding-block: 3rem 0; }
  .news__item { grid-template-columns: auto minmax(0, 1fr); gap: .15rem .6rem; }
  .news__text { grid-column: 1 / -1; }
  .datasets { grid-template-columns: minmax(0, 1fr); }
  .suite { grid-template-columns: minmax(0, 1fr); }
  .suite .dataset__stats--compact { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dataset:not(.dataset--suite):last-child:nth-child(even) .dataset__stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pub { grid-template-columns: minmax(0, 1fr); gap: .55rem; }
  .pub__venue { flex-direction: row; align-items: center; gap: .5rem; padding: 0; }
  .venue { padding: .2rem .5rem; }
  .legend__count { margin-left: 0; }
  .talk { grid-template-columns: minmax(0, 1fr); gap: .15rem; }
}

@media (max-width: 374px) {
  .status-pill__more { display: none; }
  .dataset__stats--n3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dots { display: none; }
  .market__bar { gap: .6rem; }
  .market__body { font-size: .68rem; padding-inline: .75rem; }
  .sql { white-space: pre-wrap; }
  .psql th, .psql td { padding-inline: .4rem; }
  .psql td:first-child { white-space: normal; }
}

@media (max-width: 340px) {
  .highlights { grid-template-columns: minmax(0, 1fr); }
  .highlight + .highlight { border-left: 0; border-top: 1px solid var(--line); }
}

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

@media print {
  .topbar, .progress, .theme-toggle, .pubbar, .more-btn, .market__actions { display: none !important; }
  .js .news.is-collapsed .is-extra, .pub.is-hidden { display: grid !important; }
  .more-authors[hidden] { display: inline !important; }
  .more-toggle { display: none !important; }
}
