/* ==========================================================================
   Minghua He — academic homepage
   Hand-written stylesheet, no framework.
   Design tokens first; one accent color; awards are the only warm accent.
   ========================================================================== */

/* ---------- Tokens ---------- */

:root {
  --bg: #faf8f3;
  --bg-subtle: #f2eee6;
  --bg-panel: #fffefb;
  --text: #1f1d1a;
  --text-2: #403b34;
  --text-3: #7a7266;
  --line: #e6dfd3;
  --line-soft: #efeae0;
  --accent: #c4633e;
  --accent-hover: #a94f2d;
  --accent-soft: #f8ece5;
  --chip-bg: #f0ebe1;
  --chip-text: #5c5548;
  --award-bg: #fdf3e0;
  --award-border: #f0d09a;
  --award-text: #8f5310;
  --shadow: 0 1px 2px rgba(63, 51, 39, 0.06);
  --header-bg: rgba(250, 248, 243, 0.85);

  --font-text: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-display: 'Newsreader', Georgia, 'Times New Roman', serif;

  /* vibrant layer — Claude-style warm palette */
  --grad: linear-gradient(135deg, #d46a4c 0%, #e58e76 45%, #e0b274 100%);
  --glow: rgba(212, 106, 76, 0.22);
  --aurora-1: rgba(217, 119, 87, 0.16);
  --aurora-2: rgba(229, 142, 118, 0.13);
  --aurora-3: rgba(222, 178, 116, 0.15);
  --dot: rgba(122, 114, 102, 0.17);
  --chip-venue-bg: #f4d8c5;
  --chip-venue-text: #8f3e1f;
  --chip-venue-line: #dfae8f;
  --chip-rank-bg: #e6e9cb;
  --chip-rank-text: #55602c;
  --chip-rank-line: #c3cd94;
  --chip-teal-bg: #d8e9df;
  --chip-teal-text: #2f5d4c;
  --chip-teal-line: #abd1bd;
  --chip-rose-bg: #f5d6dc;
  --chip-rose-text: #8c3a47;
  --chip-rose-line: #e2adb8;
  --award-grad: linear-gradient(135deg, #f2b33d 0%, #e8952f 55%, #dd7327 100%);
}

[data-theme="dark"] {
  --bg: #1b1917;
  --bg-subtle: #232019;
  --bg-panel: #211e1b;
  --text: #f0ebe3;
  --text-2: #d3ccc1;
  --text-3: #9c9488;
  --line: #3a342c;
  --line-soft: #2c2822;
  --accent: #e89b7b;
  --accent-hover: #f0b296;
  --accent-soft: rgba(217, 119, 87, 0.14);
  --chip-bg: #2e2922;
  --chip-text: #c6beb0;
  --award-bg: rgba(242, 179, 61, 0.10);
  --award-border: rgba(242, 179, 61, 0.35);
  --award-text: #f2b33d;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  --header-bg: rgba(27, 25, 23, 0.85);

  /* vibrant layer: warm ember tuning */
  --grad: linear-gradient(135deg, #e88d68 0%, #f0ab88 45%, #e8c68e 100%);
  --glow: rgba(232, 141, 104, 0.30);
  --aurora-1: rgba(217, 119, 87, 0.20);
  --aurora-2: rgba(229, 142, 118, 0.16);
  --aurora-3: rgba(222, 178, 116, 0.16);
  --dot: rgba(156, 148, 136, 0.12);
  --chip-venue-bg: rgba(217, 119, 87, 0.22);
  --chip-venue-text: #f4b394;
  --chip-venue-line: rgba(217, 119, 87, 0.55);
  --chip-rank-bg: rgba(163, 176, 96, 0.20);
  --chip-rank-text: #ccd695;
  --chip-rank-line: rgba(163, 176, 96, 0.52);
  --chip-teal-bg: rgba(94, 156, 127, 0.20);
  --chip-teal-text: #a5d8bf;
  --chip-teal-line: rgba(94, 156, 127, 0.52);
  --chip-rose-bg: rgba(196, 90, 106, 0.22);
  --chip-rose-text: #efaeb8;
  --chip-rose-line: rgba(196, 90, 106, 0.55);
  --award-grad: linear-gradient(135deg, #f2b33d 0%, #e8952f 55%, #e07840 100%);
}

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

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 84px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text-2);
  font-family: var(--font-text);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

::selection {
  background: var(--accent-soft);
  color: var(--accent);
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
  text-underline-offset: 3px;
}

img {
  max-width: 100%;
  display: block;
}

button {
  font-family: inherit;
}

.wrap {
  max-width: 900px;
  margin-inline: auto;
  padding-inline: 24px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: #fff;
  padding: 8px 16px;
  border-radius: 0 0 8px 0;
  z-index: 100;
}

.skip-link:focus {
  left: 0;
}

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

/* ---------- Header ---------- */

.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background 0.25s ease, border-color 0.25s ease;
}

.site-header.scrolled {
  background: var(--header-bg);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom-color: var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 60px;
}

.brand {
  font-weight: 600;
  font-size: 15px;
  color: var(--text);
  letter-spacing: -0.01em;
  white-space: nowrap;
}

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

.site-nav {
  display: flex;
  align-items: center;
  gap: 22px;
  margin-left: auto;
}

.nav-link {
  font-size: 14.5px;
  font-weight: 500;
  color: var(--text-3);
  padding: 4px 0;
}

.nav-link:hover {
  color: var(--text);
  text-decoration: none;
}

.nav-link.active {
  color: var(--accent);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-3);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.icon-btn:hover {
  background: var(--chip-bg);
  color: var(--text);
}

.icon {
  width: 18px;
  height: 18px;
}

/* theme toggle: show the icon of the mode you would switch to */
.icon-moon { display: none; }
.icon-sun { display: block; }
[data-theme="dark"] .icon-moon { display: block; }
[data-theme="dark"] .icon-sun { display: none; }

.menu-btn { display: none; }
.icon-close { display: none; }

/* ---------- Sections ---------- */

main {
  padding-top: 60px;
}

.section {
  padding-block: 56px;
}

.section + .section,
section + section {
  border-top: 1px solid var(--line-soft);
}

.section-hero {
  padding-top: 72px;
  border-top: none;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
  margin: 0 0 20px;
}

.section-title::after {
  content: '';
  height: 4px;
  width: 56px;
  border-radius: 999px;
  background: var(--grad);
  opacity: 0.9;
}

.t-emoji {
  font-size: 0.8em;
  line-height: 1;
}

.section-note {
  font-size: 14.5px;
  color: var(--text-3);
  margin: -8px 0 24px;
  max-width: 60ch;
}

.overline {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
  margin: 0 0 10px;
}

/* ---------- Hero ---------- */

.hero {
  display: grid;
  grid-template-columns: 1fr 210px;
  gap: 56px;
  align-items: start;
}

.hero-name {
  font-family: var(--font-display);
  font-size: 46px;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.15;
  color: var(--text);
  margin: 0 0 10px;
  background-image: var(--grad);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  width: fit-content;
  padding-right: 2px;
  animation: grad-shift 9s ease-in-out infinite alternate;
}

.hero-tagline {
  font-size: 17px;
  font-weight: 500;
  color: var(--accent);
  margin: 0 0 22px;
}

.hero-bio {
  font-size: 15.5px;
  color: var(--text-2);
  max-width: 62ch;
}

.hero-bio strong {
  color: var(--text);
  font-weight: 600;
}

/* links inside bio come from _data/profile.yml with class="bio-link" */
.bio-link {
  color: var(--accent);
  font-weight: 500;
}

.callout {
  margin: 22px 0 0;
  padding: 11px 15px;
  border-left: 2px solid;
  border-image: var(--grad) 1;
  background: var(--accent-soft);
  border-radius: 0 10px 10px 0;
  font-size: 14px;
  color: var(--text-2);
  max-width: 56ch;
}

.highlights {
  margin-top: 28px;
}

.highlight-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 28px;
}

.highlight-grid li {
  font-size: 14px;
  color: var(--text-2);
  padding-left: 12px;
  border-left: 2px solid;
  border-image: var(--grad) 1;
  line-height: 1.5;
}

.hero-side {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.portrait {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: 16px;
  border: 3px solid transparent;
  background: var(--grad) border-box;
  box-shadow: 0 6px 28px var(--glow);
}

.contact-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.contact-list a {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-3);
}

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

.contact-list .icon {
  width: 16px;
  height: 16px;
}

/* ---------- Chips ---------- */

.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1.5px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.5;
  white-space: nowrap;
}

/* category chips: deep-dyed tints, one hue per category */
.chip-venue {
  background: var(--chip-venue-bg);
  color: var(--chip-venue-text);
  border: 1px solid var(--chip-venue-line);
  font-weight: 650;
}

.chip-rank {
  background: var(--chip-rank-bg);
  color: var(--chip-rank-text);
  border: 1px solid var(--chip-rank-line);
  font-weight: 650;
}

.chip-teal {
  background: var(--chip-teal-bg);
  color: var(--chip-teal-text);
  border: 1px solid var(--chip-teal-line);
  font-weight: 650;
}

.chip-rose {
  background: var(--chip-rose-bg);
  color: var(--chip-rose-text);
  border: 1px solid var(--chip-rose-line);
  font-weight: 650;
}

.chip-award {
  background: var(--award-grad);
  color: #ffffff;
  border: none;
  font-weight: 600;
  text-shadow: 0 1px 1px rgba(120, 53, 15, 0.25);
  box-shadow: 0 1px 8px rgba(245, 158, 11, 0.35);
  position: relative;
  overflow: hidden;
}

/* one-shot shine sweep on hover (never loops) */
.chip-award::before {
  content: '';
  position: absolute;
  top: 0;
  left: -110%;
  width: 90%;
  height: 100%;
  background: linear-gradient(105deg, transparent, rgba(255, 255, 255, 0.45), transparent);
  transition: left 0.55s ease;
}

.chip-award:hover::before {
  left: 120%;
}

/* ---------- News ---------- */

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

.news-item {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 18px;
  padding: 8px 0;
  font-size: 15px;
}

.news-date {
  color: var(--text-3);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  padding-top: 2px;
  white-space: nowrap;
}

.news-body {
  color: var(--text-2);
}

.news-highlight .news-body {
  color: var(--text);
  font-weight: 500;
}

.news-body .chip {
  margin-inline: 2px;
  vertical-align: 1px;
}

/* news lives in a compact scrollable panel */
.panel-scroll.news-panel {
  max-height: 230px;
}

.text-btn {
  margin-top: 12px;
  border: none;
  background: none;
  padding: 4px 0;
  font-size: 14px;
  font-weight: 500;
  color: var(--accent);
  cursor: pointer;
}

.text-btn:hover {
  color: var(--accent-hover);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.text-btn .when-expanded { display: none; }
.text-btn[aria-expanded="true"] .when-collapsed { display: none; }
.text-btn[aria-expanded="true"] .when-expanded { display: inline; }

/* ---------- Publication tabs ---------- */

.pub-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.pub-tab {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--bg-panel);
  border-radius: 999px;
  padding: 7px 16px;
  font-size: 14.5px;
  font-weight: 550;
  color: var(--text-3);
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.15s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.pub-tab:hover {
  color: var(--text);
  border-color: color-mix(in srgb, var(--accent) 40%, var(--line));
  transform: translateY(-1px);
}

.pub-tab.active {
  color: #ffffff;
  background-image: var(--grad);
  border-color: transparent;
  box-shadow: 0 3px 14px var(--glow);
  animation: tab-pop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes tab-pop {
  from { transform: scale(0.94); }
  to { transform: scale(1); }
}

.pub-tab .count {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-3);
  background: var(--chip-bg);
  border-radius: 999px;
  padding: 1px 7px;
  margin-left: 5px;
  vertical-align: 1px;
}

.pub-tab.active .count {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.22);
}

/* ---------- Publication panels ---------- */

.pub-panel[hidden] {
  display: none;
}

@supports (content-visibility: hidden) {
  /* keep inactive panels reachable by find-in-page (Cmd/Ctrl+F) */
  .pub-panel[hidden="until-found"] {
    display: block;
    content-visibility: hidden;
  }
}

.pub-panel:not([hidden]) {
  animation: fade-in 0.2s ease-out;
}

@keyframes fade-in {
  from { opacity: 0; transform: translateY(3px); }
  to { opacity: 1; transform: none; }
}

.panel-scroll {
  max-height: min(72vh, 800px);
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--bg-panel) 72%, transparent);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  padding: 4px 20px;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}

.panel-scroll::-webkit-scrollbar {
  width: 6px;
}

.panel-scroll::-webkit-scrollbar-track {
  background: transparent;
}

.panel-scroll::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #e58e76, #d46a4c);
  border-radius: 3px;
}

.panel-scroll::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #d97757, #b0512f);
}

/* bottom fade hint that more content is below */
.panel-scroll::after {
  content: '';
  position: sticky;
  bottom: -4px;
  display: block;
  height: 28px;
  margin: -28px -20px -4px;
  background: linear-gradient(transparent, color-mix(in srgb, var(--bg) 90%, transparent));
  pointer-events: none;
}

/* ---------- Publication rows ---------- */

.pub-row {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 22px;
  padding: 20px 12px;
  margin-inline: -12px;
  align-items: start;
  position: relative;
  border-radius: 12px;
  transition: box-shadow 0.25s ease, background-color 0.25s ease;
}

/* gradient border ring, revealed on hover */
.pub-row::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 12px;
  padding: 1px;
  background: var(--grad);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}

.pub-row:hover {
  background-color: var(--bg-subtle);
  box-shadow: 0 6px 26px var(--glow);
  z-index: 1;
}

.pub-row:hover::before {
  opacity: 1;
}

.pub-row.no-thumb {
  grid-template-columns: 1fr;
}

.pub-row + .pub-row {
  border-top: 1px solid var(--line-soft);
}

.pub-thumb img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
  margin-top: 4px;
}

.pub-title {
  font-size: 16.5px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: -0.005em;
  color: var(--text);
  margin: 0 0 5px;
}

.pub-authors {
  font-size: 13.5px;
  color: var(--text-3);
  line-height: 1.55;
  margin: 0 0 8px;
}

.pub-authors .me {
  color: var(--text);
  font-weight: 700;
  background-image: var(--grad);
  background-repeat: no-repeat;
  background-size: 100% 2px;
  background-position: 0 100%;
  padding-bottom: 1px;
}

.pub-authors .pub-team {
  color: var(--accent);
  font-weight: 600;
}

.pub-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 8px;
}

.pub-tldr {
  font-size: 14px;
  color: var(--text-3);
  line-height: 1.6;
  margin: 0 0 8px;
  max-width: 68ch;
}

.pub-links {
  font-size: 13.5px;
  font-weight: 500;
  margin: 0;
}

.pub-links .dot {
  color: var(--line);
  margin-inline: 7px;
}

/* ---------- Gallery ---------- */

.gallery-intro {
  font-size: 15px;
  color: var(--text-2);
  max-width: 60ch;
  margin: 0 0 24px;
}

.gallery-intro strong {
  color: var(--text);
  font-weight: 600;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.gallery-item {
  position: relative;
  margin: 0;
  border-radius: 10px;
  overflow: hidden;
  aspect-ratio: 4 / 5;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.gallery-item:hover img {
  transform: scale(1.04);
}

.gallery-item figcaption {
  position: absolute;
  inset: auto 0 0 0;
  padding: 28px 12px 10px;
  background: linear-gradient(to top, rgba(124, 45, 18, 0.72), rgba(87, 52, 28, 0.42) 55%, transparent);
  display: flex;
  flex-direction: column;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.gallery-item:hover figcaption {
  opacity: 1;
}

.gallery-caption {
  color: #fff;
  font-size: 13px;
  font-weight: 600;
}

.gallery-location {
  color: rgba(255, 255, 255, 0.8);
  font-size: 12px;
}

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

.site-footer {
  border-top: 1px solid var(--line-soft);
  margin-top: 24px;
}

.footer-inner {
  padding-block: 32px 40px;
  font-size: 13px;
  color: var(--text-3);
  display: flex;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.footer-inner p {
  margin: 0;
}

.footer-note a {
  color: var(--text-3);
  text-decoration: underline;
  text-underline-offset: 3px;
}

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

/* ---------- Responsive ---------- */

@media (max-width: 860px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .hero-side {
    flex-direction: row;
    align-items: flex-end;
    gap: 24px;
    order: -1;
  }

  .portrait {
    width: 150px;
  }

  .highlight-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .site-nav {
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    padding: 8px 24px 12px;
  }

  .site-nav.open {
    display: flex;
  }

  .site-nav .nav-link {
    padding: 10px 0;
    font-size: 15px;
    border-bottom: 1px solid var(--line-soft);
  }

  .site-nav .nav-link:last-child {
    border-bottom: none;
  }

  .menu-btn {
    display: inline-flex;
  }

  .menu-btn[aria-expanded="true"] .icon-menu { display: none; }
  .menu-btn[aria-expanded="true"] .icon-close { display: block; }

  .hero-name {
    font-size: 36px;
  }

  .section {
    padding-block: 44px;
  }

  .pub-row {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .pub-thumb {
    display: none;
  }

  .panel-scroll {
    max-height: 70vh;
    max-height: 70svh;
    padding: 2px 14px;
  }

  .panel-scroll::after {
    margin-inline: -14px;
  }

  .news-item {
    grid-template-columns: 56px 1fr;
    gap: 12px;
  }

  .exp-grid {
    grid-template-columns: 1fr;
  }

  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer-inner {
    flex-direction: column;
  }
}

/* ---------- Vibrant layer: atmosphere & motion ---------- */

@keyframes grad-shift {
  from { background-position: 0% 50%; }
  to { background-position: 100% 50%; }
}

/* gradient section-title text (emoji stays outside, in full color) */
.grad-text {
  background-image: var(--grad);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: grad-shift 10s ease-in-out infinite alternate;
  padding-right: 1px;
}

/* top gradient line — sits above the fixed header, slowly drifting */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--grad);
  background-size: 200% 100%;
  animation: grad-shift 14s ease-in-out infinite alternate;
  z-index: 60;
  pointer-events: none;
}

/* page-wide atmosphere: aurora wash + dot grid, fixed to the viewport */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background-image:
    radial-gradient(640px 640px at 12% -6%, var(--aurora-1), transparent 68%),
    radial-gradient(560px 560px at 88% 2%, var(--aurora-2), transparent 66%),
    radial-gradient(720px 720px at -6% 62%, var(--aurora-3), transparent 70%),
    radial-gradient(600px 600px at 105% 78%, var(--aurora-1), transparent 70%),
    radial-gradient(var(--dot) 1px, transparent 1.4px);
  background-repeat: no-repeat, no-repeat, no-repeat, no-repeat, repeat;
  background-size: auto, auto, auto, auto, 22px 22px;
}

/* page-wide cursor glow (desktop only, driven by JS) */
.cursor-glow {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.5s ease;
  background: radial-gradient(320px circle at var(--mx, 50%) var(--my, 30%), var(--aurora-3), transparent 70%);
}

.cursor-glow.on {
  opacity: 1;
}

/* one-shot scroll reveal (class added by JS; no-JS pages stay visible) */
@media (prefers-reduced-motion: no-preference) {
  .reveal {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.6s ease, transform 0.6s ease;
  }

  .reveal.in-view {
    opacity: 1;
    transform: none;
  }
}

/* sliding underline for content links */
.hero-bio a,
.section-note a,
.pub-links a,
.footer-note a {
  text-decoration: none;
  background-image: linear-gradient(currentColor, currentColor);
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 0% 1.5px;
  transition: background-size 0.25s ease, color 0.15s ease;
}

.hero-bio a:hover,
.section-note a:hover,
.pub-links a:hover,
.footer-note a:hover {
  text-decoration: none;
  background-size: 100% 1.5px;
}

/* news celebration emoji */
.news-emoji {
  margin-right: 2px;
}

/* pub titles catch the gradient on row hover */
.pub-row:hover .pub-title {
  background-image: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* active nav link in gradient */
.nav-link.active {
  background-image: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ---------- Research experience cards ---------- */

.exp-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.exp-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: color-mix(in srgb, var(--bg-panel) 72%, transparent);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  position: relative;
  text-decoration: none;
  transition: transform 0.22s ease, box-shadow 0.25s ease;
}

.exp-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 14px;
  padding: 1px;
  background: var(--grad);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}

.exp-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px var(--glow);
  text-decoration: none;
}

.exp-card:hover::before {
  opacity: 1;
}

.exp-logo {
  flex-shrink: 0;
  width: 54px;
  height: 54px;
  border-radius: 12px;
  background: #ffffff;
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 9px;
}

.exp-logo img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.exp-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.exp-org {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.35;
}

.exp-sub {
  font-size: 12.5px;
  color: var(--text-3);
}

.exp-role {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--accent);
  margin-top: 2px;
}

.exp-focus {
  font-size: 12.5px;
  color: var(--text-3);
  margin-top: 1px;
}

/* ---------- Motion & print ---------- */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media print {
  .site-header,
  .skip-link,
  .text-btn {
    display: none;
  }

  .panel-scroll {
    max-height: none;
    overflow: visible;
    border: none;
    padding: 0;
  }

  .pub-panel[hidden] {
    display: block !important;
    content-visibility: visible !important;
  }

  .panel-scroll.news-panel {
    max-height: none;
  }
}
