/*
 * Jiaxing Li - personal homepage styles
 * Font: Inter, SIL Open Font License 1.1 (see assets/fonts/).
 */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../fonts/Inter-normal-400-700-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../fonts/Inter-normal-400-700-latin.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;
}

/* ------------------------------------------------------------------
   Design tokens
   Neutral grays, one blue accent used sparingly, soft fills instead of borders.
   ------------------------------------------------------------------ */
:root {
  --bg: #ffffff;
  --raised: #ffffff;
  --soft: #f4f4f5;
  --soft-2: #ebebed;
  --text: #18181b;
  --text-2: #3f3f46;
  --muted: #71717a;
  --faint: #a1a1aa;
  --border: #e7e7ea;
  --border-strong: #d4d4d8;
  --accent: #2456d6;
  --accent-soft: rgba(36, 86, 214, 0.08);
  --award-bg: #fdf3da;
  --award-text: #855800;
  --figure-bg: #ffffff;
  --header-bg: rgba(255, 255, 255, 0.82);
  --shadow: 0 1px 2px rgba(24, 24, 27, 0.05), 0 18px 40px -16px rgba(24, 24, 27, 0.22);

  --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

  --maxw: 1080px;
  --gutter: 24px;
  --label-w: 184px;
  --col-gap: 56px;
  --header-h: 56px;
  --radius: 12px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b0b0d;
    --raised: #232327;
    --soft: #18181b;
    --soft-2: #232327;
    --text: #f4f4f5;
    --text-2: #d4d4d8;
    --muted: #a1a1aa;
    --faint: #71717a;
    --border: #232327;
    --border-strong: #3f3f46;
    --accent: #84adff;
    --accent-soft: rgba(132, 173, 255, 0.12);
    --award-bg: rgba(245, 198, 106, 0.13);
    --award-text: #f2c66d;
    --figure-bg: #f4f4f5;
    --header-bg: rgba(11, 11, 13, 0.8);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 18px 40px -16px rgba(0, 0, 0, 0.7);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #0b0b0d;
  --raised: #232327;
  --soft: #18181b;
  --soft-2: #232327;
  --text: #f4f4f5;
  --text-2: #d4d4d8;
  --muted: #a1a1aa;
  --faint: #71717a;
  --border: #232327;
  --border-strong: #3f3f46;
  --accent: #84adff;
  --accent-soft: rgba(132, 173, 255, 0.12);
  --award-bg: rgba(245, 198, 106, 0.13);
  --award-text: #f2c66d;
  --figure-bg: #f4f4f5;
  --header-bg: rgba(11, 11, 13, 0.8);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 18px 40px -16px rgba(0, 0, 0, 0.7);
  color-scheme: dark;
}

/* ------------------------------------------------------------------
   Base
   ------------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 24px);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.6 var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

img { display: block; max-width: 100%; height: auto; }
p { margin: 0 0 1em; }
a { color: inherit; text-decoration: none; }

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

::selection { background: color-mix(in srgb, var(--accent) 20%, transparent); }

.icon {
  width: 1em;
  height: 1em;
  flex: none;
  vertical-align: -0.125em;
}

/* Controls that need JavaScript are hidden when it is unavailable. */
html:not(.js) .js-only { display: none !important; }

.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -48px;
  z-index: 100;
  padding: 8px 14px;
  border-radius: 8px;
  background: var(--raised);
  color: var(--text);
}
.skip-link:focus { top: 12px; box-shadow: var(--shadow); }

/* Underlined text link, used in running text. */
.prose a,
.hero__affil a,
.timeline__note a,
.notfound a {
  color: var(--text);
  font-weight: 500;
  text-decoration: underline;
  text-decoration-color: var(--border-strong);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: text-decoration-color 0.15s ease;
}
.prose a:hover,
.hero__affil a:hover,
.timeline__note a:hover,
.notfound a:hover { text-decoration-color: currentColor; }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 17px;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.icon-btn:hover { background: var(--soft); color: var(--text); }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 0;
  border-radius: 8px;
  background: var(--text);
  color: var(--bg);
  font: 500 0.875rem/1.2 var(--font-sans);
  cursor: pointer;
  transition: opacity 0.15s ease;
}
.btn:hover { opacity: 0.86; }
.btn.is-copied { background: var(--accent); color: #fff; opacity: 1; }

/* ------------------------------------------------------------------
   Header
   ------------------------------------------------------------------ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--header-bg);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}
.site-header.is-scrolled,
.site-header.is-open { border-bottom-color: var(--border); }

.site-header__inner {
  position: relative;
  max-width: var(--maxw);
  height: var(--header-h);
  margin: 0 auto;
  padding: 0 var(--gutter);
  display: flex;
  align-items: center;
  gap: 12px;
}

.site-header__brand {
  margin-right: auto;
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.site-nav { display: flex; gap: 2px; }
.site-nav a {
  padding: 6px 10px;
  border-radius: 7px;
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 500;
  white-space: nowrap;
  transition: color 0.15s ease, background-color 0.15s ease;
}
.site-nav a:hover { color: var(--text); }
.site-nav a.is-active { color: var(--text); background: var(--soft); }

.site-header__actions { display: flex; gap: 4px; }
.nav-menu { display: none; }

.theme-toggle .icon--sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon--sun { display: block; }
:root[data-theme="dark"] .theme-toggle .icon--moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon--sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .icon--moon { display: none; }
}

/* ------------------------------------------------------------------
   Page grid: a narrow label column and a content column.
   The hero puts the photo in the label column.
   ------------------------------------------------------------------ */
.hero,
.section {
  display: grid;
  grid-template-columns: var(--label-w) minmax(0, 1fr);
  column-gap: var(--col-gap);
}

.hero {
  align-items: center;
  padding: 72px 0 40px;
}

.hero__photo {
  width: 148px;
  height: 148px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 0 1px var(--border);
}

.hero__name {
  margin: 0;
  font-size: 2.5rem;
  font-weight: 650;
  line-height: 1.05;
  letter-spacing: -0.035em;
}

.hero__role {
  margin: 14px 0 0;
  color: var(--text);
  font-size: 1.125rem;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.hero__affil {
  margin: 2px 0 0;
  color: var(--muted);
}
.hero__affil a { font-weight: 400; }
.sep { margin: 0 0.5em; color: var(--faint); }

.hero__now {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 16px 0 0;
  padding: 3px 12px 3px 10px;
  border-radius: 999px;
  background: var(--soft);
  color: var(--text-2);
  font-size: 0.875rem;
  font-weight: 500;
}
.hero__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
}

.hero__links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin: 22px 0 0;
  padding: 0;
  list-style: none;
}
.hero__links a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--text-2);
  font-size: 0.9375rem;
  font-weight: 500;
  transition: color 0.15s ease;
}
.hero__links .icon { color: var(--muted); font-size: 1.05em; transition: color 0.15s ease; }
.hero__links a:hover,
.hero__links a:hover .icon { color: var(--text); }

/* ------------------------------------------------------------------
   Sections
   ------------------------------------------------------------------ */
.section { padding: 48px 0; }

.section__head {
  position: sticky;
  top: calc(var(--header-h) + 28px);
  align-self: start;
}

.section__title {
  margin: 0;
  color: var(--text);
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: -0.015em;
}

.section__body { min-width: 0; }

.subhead {
  margin: 28px 0 12px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.prose {
  max-width: 66ch;
  color: var(--text-2);
  font-size: 1.0625rem;
  line-height: 1.7;
}
.prose p:last-child { margin-bottom: 0; }

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.chips li {
  padding: 4px 11px;
  border-radius: 7px;
  background: var(--soft);
  color: var(--text-2);
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.55;
}
.chips .chip--core {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}

.aside-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 500;
  transition: color 0.15s ease;
}
.aside-link:hover { color: var(--text); }

/* ------------------------------------------------------------------
   Research themes
   ------------------------------------------------------------------ */
.themes { margin: 0; padding: 0; list-style: none; }
.theme {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px;
  column-gap: 40px;
  padding: 24px 0;
  border-top: 1px solid var(--border);
}
.theme:first-child { padding-top: 0; border-top: 0; }
.theme:last-child { padding-bottom: 0; }

.theme__title {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin: 0 0 8px;
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: -0.015em;
}
.theme__num {
  color: var(--faint);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
}
.theme__summary {
  margin: 0;
  color: var(--text-2);
  font-size: 0.9375rem;
  line-height: 1.65;
}

.theme__papers { margin: 0; padding: 2px 0 0; list-style: none; }
.theme__papers a {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 0;
  color: var(--text);
  font-size: 0.875rem;
  font-weight: 500;
  transition: color 0.15s ease;
}
.theme__papers a:hover { color: var(--accent); }
.theme__venue {
  color: var(--muted);
  font-size: 0.8125rem;
  font-weight: 400;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* ------------------------------------------------------------------
   Publications
   ------------------------------------------------------------------ */
.pubs-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
}
html:not(.js) .pubs-toolbar { justify-content: flex-end; }

.filters {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border-radius: 10px;
  background: var(--soft);
}
.filter {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font: 500 0.8125rem/1.3 var(--font-sans);
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.15s ease, background-color 0.15s ease;
}
.filter span { color: var(--faint); font-variant-numeric: tabular-nums; }
.filter:hover { color: var(--text); }
.filter.is-active {
  background: var(--raised);
  color: var(--text);
  box-shadow: 0 1px 2px rgba(24, 24, 27, 0.08), 0 0 0 1px var(--border);
}
.filter.is-active span { color: var(--muted); }

.pub-group[hidden] { display: none; }
.pub-year {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 28px 0 0;
  color: var(--muted);
  font-size: 0.8125rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.pub-year::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

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

.pub {
  display: grid;
  grid-template-columns: 168px minmax(0, 1fr);
  gap: 24px;
  padding: 18px 0;
}
.pub:last-child { padding-bottom: 4px; }
.pub[hidden] { display: none; }
.pub--no-image { grid-template-columns: minmax(0, 1fr); }

.pub__thumb {
  display: block;
  align-self: start;
  aspect-ratio: 16 / 10;
  padding: 6px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--figure-bg);
  transition: border-color 0.15s ease;
}
.pub__thumb:hover { border-color: var(--border-strong); }
.pub__thumb img { width: 100%; height: 100%; object-fit: contain; }

.pub__body { min-width: 0; }
.pub__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  margin: 0 0 6px;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 7px;
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.6;
  white-space: nowrap;
}
.badge--muted { background: var(--soft); color: var(--muted); }
.badge--award { background: var(--award-bg); color: var(--award-text); }
.badge .icon { font-size: 1.1em; }
.pub__note { color: var(--muted); font-size: 0.8125rem; }

.pub__title {
  margin: 0 0 4px;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.45;
  letter-spacing: -0.01em;
}
.pub__title a { color: var(--text); transition: color 0.15s ease; }
.pub__title a:hover { color: var(--accent); }

.pub__authors {
  margin: 0;
  color: var(--text-2);
  font-size: 0.9063rem;
  line-height: 1.55;
}
.pub__authors strong,
.paper__authors strong { color: var(--text); font-weight: 600; }

.pub__venue {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.875rem;
}

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}
.links a,
.links button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  font: 500 0.8125rem/1.6 var(--font-sans);
  cursor: pointer;
  transition: color 0.15s ease;
}
.links .icon { font-size: 0.95em; }
.links a:hover,
.links button:hover { color: var(--text); }

/* ------------------------------------------------------------------
   Education, experience, teaching, service
   ------------------------------------------------------------------ */
.timeline { margin: 0; padding: 0; list-style: none; }
.timeline > li {
  display: grid;
  grid-template-columns: 136px minmax(0, 1fr);
  gap: 24px;
  padding: 14px 0;
}
.timeline > li:first-child { padding-top: 0; }
.timeline > li:last-child { padding-bottom: 0; }
.timeline p { margin: 0; }

.timeline__date {
  padding-top: 1px;
  color: var(--muted);
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
}
.timeline--groups > li { grid-template-columns: 176px minmax(0, 1fr); }
.timeline--groups .timeline__date { color: var(--text-2); font-weight: 500; }

.timeline__head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.timeline__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.timeline__kind {
  padding: 0 7px;
  border-radius: 6px;
  background: var(--soft);
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.7;
}
.timeline__org { color: var(--text-2); font-size: 0.9375rem; }
.timeline__note { margin-top: 2px !important; color: var(--muted); font-size: 0.875rem; }

.timeline__points {
  max-width: 70ch;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
  color: var(--text-2);
  font-size: 0.9375rem;
  line-height: 1.65;
}
.timeline__points li {
  position: relative;
  margin: 6px 0;
  padding-left: 18px;
}
.timeline__points li::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 0.7em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--faint);
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}
.tags li {
  padding: 0 8px;
  border-radius: 6px;
  background: var(--soft);
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.8;
}

.service-list {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--text-2);
  font-size: 0.9375rem;
}

/* ------------------------------------------------------------------
   BibTeX dialog and code blocks
   ------------------------------------------------------------------ */
.bib-dialog {
  width: min(680px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--bg);
  color: var(--text);
  box-shadow: var(--shadow);
}
.bib-dialog::backdrop {
  background: rgba(9, 9, 11, 0.4);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}
.bib-dialog__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 20px 0;
}
.bib-dialog__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.45;
  letter-spacing: -0.01em;
}
.bib-dialog__code,
.code-block pre {
  margin: 0;
  padding: 14px 16px;
  overflow: auto;
  border-radius: 10px;
  background: var(--soft);
  color: var(--text-2);
  font: 0.78rem/1.65 var(--font-mono);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.bib-dialog__code { max-height: 50vh; margin: 16px 20px 0; }
.bib-dialog__actions {
  display: flex;
  justify-content: flex-end;
  padding: 16px 20px 20px;
}

.code-block { position: relative; }
.code-block pre { padding-right: 88px; }
.copy-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border: 0;
  border-radius: 7px;
  background: var(--raised);
  color: var(--muted);
  font: 500 0.75rem/1.3 var(--font-sans);
  box-shadow: 0 0 0 1px var(--border);
  cursor: pointer;
  transition: color 0.15s ease;
}
.copy-btn:hover { color: var(--text); }
.copy-btn.is-copied { color: var(--accent); }

/* ------------------------------------------------------------------
   Publication page
   ------------------------------------------------------------------ */
.paper {
  max-width: 760px;
  margin: 0 auto;
  padding: 48px 0 16px;
}
.back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 32px;
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 500;
  transition: color 0.15s ease;
}
.back:hover { color: var(--text); }

.paper__title {
  margin: 4px 0 14px;
  font-size: clamp(1.6rem, 3.4vw, 2.1rem);
  font-weight: 650;
  line-height: 1.2;
  letter-spacing: -0.028em;
}
.paper__authors { margin: 0 0 4px; color: var(--text-2); }
.paper__venue { margin: 0; color: var(--muted); }
.paper__header .links { gap: 8px; margin-top: 20px; }
.paper__header .links a {
  padding: 5px 12px;
  border-radius: 8px;
  background: var(--soft);
  color: var(--text);
  transition: background-color 0.15s ease;
}
.paper__header .links a:hover { background: var(--soft-2); }

.paper__figure {
  margin: 36px 0 8px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--figure-bg);
}
.paper__figure img { width: auto; max-height: 440px; margin: 0 auto; }

.paper__section { margin-top: 40px; }
.paper__section h2 {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.paper__abstract { color: var(--text-2); line-height: 1.75; }

/* ------------------------------------------------------------------
   404
   ------------------------------------------------------------------ */
.notfound { padding: 120px 0 64px; text-align: center; }
.notfound .notfound__code {
  margin: 0;
  color: var(--faint);
  font-size: 4rem;
  font-weight: 650;
  line-height: 1;
  letter-spacing: -0.04em;
}
.notfound h1 {
  margin: 14px 0 8px;
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.notfound p { color: var(--text-2); }

/* ------------------------------------------------------------------
   Footer
   ------------------------------------------------------------------ */
.site-footer {
  margin-top: 56px;
  border-top: 1px solid var(--border);
}
.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 32px;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 28px var(--gutter) 40px;
  color: var(--muted);
  font-size: 0.8125rem;
}
.site-footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.site-footer__links a { color: var(--text-2); transition: color 0.15s ease; }
.site-footer__links a:hover { color: var(--text); }
.site-footer__copy { margin: 0; }

/* ------------------------------------------------------------------
   Smaller screens
   ------------------------------------------------------------------ */
@media (max-width: 1024px) {
  :root { --label-w: 148px; --col-gap: 40px; }
  .hero__photo { width: 128px; height: 128px; }
  .theme { grid-template-columns: minmax(0, 1fr) 228px; column-gap: 28px; }
}

/* The full menu needs about 820px; below 880px it folds into the menu button. */
@media (max-width: 880px) {
  .js .nav-menu { display: inline-grid; }
  .js .site-nav {
    position: absolute;
    top: calc(var(--header-h) - 2px);
    left: var(--gutter);
    right: var(--gutter);
    display: none;
    flex-direction: column;
    gap: 2px;
    padding: 6px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--bg);
    box-shadow: var(--shadow);
  }
  .js .site-header.is-open .site-nav { display: flex; }
  .js .site-nav a { padding: 10px 12px; font-size: 0.9375rem; }
  html:not(.js) .site-nav { overflow-x: auto; }
}

@media (max-width: 820px) {
  .hero,
  .section { display: block; }
  .hero { padding: 44px 0 12px; }
  .hero__aside { margin-bottom: 22px; }
  .hero__photo { width: 96px; height: 96px; }
  .section { padding: 36px 0; }
  .section__head { position: static; margin-bottom: 18px; }
  .section__title { font-size: 1.25rem; letter-spacing: -0.02em; }
  .theme { grid-template-columns: minmax(0, 1fr); row-gap: 12px; }
  .pub { grid-template-columns: 136px minmax(0, 1fr); gap: 18px; }
}

@media (max-width: 600px) {
  :root { --gutter: 18px; }
  .hero__name { font-size: 2.125rem; }
  .prose { font-size: 1rem; }
  .pub { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .pub__thumb { width: 100%; max-width: 420px; aspect-ratio: 2 / 1; }
  .timeline > li,
  .timeline--groups > li { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .code-block pre { padding-right: 16px; padding-top: 40px; }
  .site-footer__inner { flex-direction: column; align-items: flex-start; }
}

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

@media print {
  .site-header, .site-footer, .links, .filters, .theme-toggle, .bib-dialog { display: none !important; }
  body { background: #fff; color: #000; }
  .section__head { position: static; }
}
