/* ── HEADER ACTIONS (THEME TOGGLE + DOWNLOAD) ─────── */
.header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.theme-toggle.header-theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--border-light) 82%, var(--accent) 12%);
  background: color-mix(in srgb, var(--surface-strong) 62%, transparent);
  color: color-mix(in srgb, var(--accent-strong) 88%, var(--text-secondary) 12%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.42);
  cursor: pointer;
  transition:
    background-color var(--t),
    border-color var(--t),
    color var(--t),
    box-shadow var(--t),
    transform var(--t);
}
.theme-toggle.header-theme-toggle:focus-visible {
  outline: 2px solid transparent;
  box-shadow:
    0 0 0 2px var(--focus-ring-inner),
    0 0 0 5px var(--focus-ring-outer);
}
.theme-toggle.header-theme-toggle:hover {
  background: var(--hover-wash-soft);
  border-color: color-mix(in srgb, var(--accent) 22%, var(--border-light));
  color: var(--accent-strong);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.46),
    0 10px 18px rgba(24, 33, 46, 0.04);
  transform: translateY(-1px);
}
.theme-toggle.header-theme-toggle .theme-toggle-icon {
  width: 15px;
  height: 15px;
  stroke: currentColor;
  transition:
    stroke var(--t),
    transform var(--t);
}
.theme-toggle.header-theme-toggle:hover .theme-toggle-icon {
  transform: none;
}
/* ── READING PROGRESS BAR ───────────────────────────── */
#reading-progress {
  position: fixed;
  top: 0;
  left: var(--sidebar-w);
  right: 0;
  height: 2px;
  background: linear-gradient(
    90deg,
    color-mix(in srgb, var(--sidebar-accent) 88%, transparent) 0%,
    color-mix(in srgb, var(--sidebar-accent) 52%, transparent) 100%
  );
  transform-origin: left center;
  transform: scaleX(0);
  z-index: 300;
  pointer-events: none;
  opacity: 0.76;
  transition: transform 0.08s linear;
  will-change: transform;
}

@media (max-width: 1024px) {
  #reading-progress {
    left: 0;
    top: auto;
    bottom: 0;
    height: 2px;
    opacity: 0.66;
  }
}

/* ── SCROLL TO TOP BUTTON ───────────────────────────── */
#scrollToTopBtn {
  position: fixed;
  right: 32px;
  bottom: 32px;
  z-index: 1000;
  width: 46px;
  height: 46px;
  border: 1px solid color-mix(in srgb, var(--border-light) 84%, var(--accent) 10%);
  border-radius: 50%;
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--surface-strong) 92%, transparent) 0%,
    color-mix(in srgb, var(--surface-muted) 78%, var(--accent-warm-light)) 100%
  );
  color: var(--text-secondary);
  box-shadow:
    0 10px 22px rgba(24, 33, 46, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.48);
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.32s cubic-bezier(0.2, 0.7, 0.2, 1),
    background 0.18s,
    color 0.18s,
    border-color 0.18s,
    box-shadow 0.18s,
    transform 0.18s;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

#scrollToTopBtn svg {
  width: 28px;
  height: 28px;
  stroke: var(--accent-strong);
  transition: stroke 0.18s;
}

#scrollToTopBtn.show {
  opacity: 1;
  pointer-events: auto;
}

#scrollToTopBtn:hover {
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--surface-strong) 84%, var(--accent-warm-light)) 0%,
    color-mix(in srgb, var(--surface-muted) 72%, var(--accent-soft)) 100%
  );
  border-color: color-mix(in srgb, var(--accent) 20%, var(--border-light));
  color: var(--text-primary);
  box-shadow:
    0 14px 24px rgba(24, 33, 46, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.52);
  transform: translateY(-1px);
}

#scrollToTopBtn:hover svg {
  stroke: currentColor;
}
:root {
  --sidebar-bg: #0e1827;
  --sidebar-bg-soft: #172335;
  --sidebar-accent: #ceb07c;
  --sidebar-text: #edf1f8;
  --sidebar-muted: #9eaac0;
  --main-bg: #ece7df;
  --main-bg-soft: #f7f3ed;
  --surface: rgba(255, 252, 248, 0.88);
  --surface-strong: #fffdf9;
  --surface-muted: #f4efe8;
  --text-primary: #1b2330;
  --text-secondary: #404d5e;
  --text-muted: #6a7686;
  --accent: #46617f;
  --accent-strong: #334b66;
  --accent-soft: rgba(70, 97, 127, 0.1);
  --accent-warm: #9d6d32;
  --accent-warm-light: #f2e7d5;
  --border: #d9d2c7;
  --border-light: #e8e1d7;
  --rule: rgba(71, 83, 103, 0.18);
  --tag-journal-bg: #eaf0f5;
  --tag-journal-color: #375676;
  --tag-conf-bg: #edf3ef;
  --tag-conf-color: #315946;
  --tag-poster-bg: #f6ede4;
  --tag-poster-color: #8e5622;
  --tag-review-bg: #f5e7e4;
  --tag-review-color: #8d4f4a;
  --year-pill-bg: #f2ece3;
  --year-pill-border: #ddd3c6;
  --year-pill-text: #5a6777;
  --shadow-xs: 0 1px 2px rgba(24, 33, 46, 0.05);
  --shadow-sm:
    0 10px 24px rgba(24, 33, 46, 0.05), 0 1px 2px rgba(24, 33, 46, 0.05);
  --shadow-md:
    0 18px 42px rgba(24, 33, 46, 0.08), 0 3px 8px rgba(24, 33, 46, 0.05);
  --shadow-soft:
    0 24px 56px rgba(24, 33, 46, 0.08), 0 4px 12px rgba(24, 33, 46, 0.05);
  --sidebar-w: 272px;
  --section-gap: clamp(52px, 5.4vw, 72px);
  --radius: 18px;
  --radius-sm: 12px;
  --t: 0.24s cubic-bezier(0.2, 0.7, 0.2, 1);
  --ring: 0 0 0 3px color-mix(in srgb, var(--accent) 26%, transparent);
  color-scheme: light;
  --link-hover-bg: rgba(70, 97, 127, 0.08);
  --link-hover-border: rgba(70, 97, 127, 0.2);
  --pub-link-doi-color: #435164;
  --pub-link-doi-bg: #f6f2eb;
  --pub-link-web-color: #395879;
  --pub-link-web-bg: #edf3f8;
  --pub-link-ext-color: #4a5565;
  --pub-link-ext-bg: #f4f1eb;
  --seminar-bg: #edf3f8;
  --seminar-color: #395879;
  --block-title-bg: rgba(70, 97, 127, 0.06);
  --hover-wash-soft: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.42) 0%,
    rgba(255, 255, 255, 0.12) 100%
  );
  --hover-wash-strong: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.54) 0%,
    rgba(255, 255, 255, 0.16) 100%
  );
  --interaction-shadow: 0 12px 28px rgba(24, 33, 46, 0.06);
  --interaction-shadow-strong: 0 18px 34px rgba(24, 33, 46, 0.08);
  --interaction-border: color-mix(
    in srgb,
    var(--accent) 10%,
    var(--border-light)
  );
  --sidebar-surface: rgba(255, 255, 255, 0.038);
  --sidebar-surface-hover: rgba(255, 255, 255, 0.07);
  --sidebar-border-soft: rgba(255, 255, 255, 0.1);
  --sidebar-rail: rgba(255, 255, 255, 0.09);
  --sidebar-active-wash: linear-gradient(
    90deg,
    rgba(206, 176, 124, 0.16) 0%,
    rgba(206, 176, 124, 0.05) 58%,
    rgba(206, 176, 124, 0) 100%
  );
  --focus-ring-outer: color-mix(in srgb, var(--accent-strong) 46%, white 54%);
  --focus-ring-inner: color-mix(in srgb, var(--surface-strong) 88%, white 12%);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --sidebar-bg: #09111d;
  --sidebar-bg-soft: #101c2b;
  --sidebar-accent: #dfc18d;
  --sidebar-text: #f1f4fb;
  --sidebar-muted: #95a3bb;
  --main-bg: #0d1420;
  --main-bg-soft: #141d2b;
  --surface: rgba(19, 28, 42, 0.9);
  --surface-strong: #162133;
  --surface-muted: #182436;
  --text-primary: #ebf0f8;
  --text-secondary: #c5d0e2;
  --text-muted: #9ca9bd;
  --accent: #9ab5d2;
  --accent-strong: #c5d6ea;
  --accent-soft: rgba(154, 181, 210, 0.12);
  --accent-warm: #dfbd7b;
  --accent-warm-light: rgba(223, 193, 141, 0.16);
  --border: #314154;
  --border-light: #253547;
  --rule: rgba(184, 201, 224, 0.16);
  --tag-journal-bg: #1e3046;
  --tag-journal-color: #b8d0ea;
  --tag-conf-bg: #1b3227;
  --tag-conf-color: #acd2bb;
  --tag-poster-bg: #3e291b;
  --tag-poster-color: #efc69b;
  --tag-review-bg: #442628;
  --tag-review-color: #f0b8b4;
  --year-pill-bg: #1c2b3d;
  --year-pill-border: #364b62;
  --year-pill-text: #d5dfed;
  --shadow-xs: 0 1px 2px rgba(3, 7, 18, 0.42);
  --shadow-sm: 0 12px 30px rgba(3, 7, 18, 0.34), 0 1px 2px rgba(3, 7, 18, 0.36);
  --shadow-md: 0 18px 42px rgba(3, 7, 18, 0.42), 0 4px 10px rgba(3, 7, 18, 0.3);
  --shadow-soft:
    0 26px 62px rgba(3, 7, 18, 0.42), 0 6px 14px rgba(3, 7, 18, 0.3);
  --link-hover-bg: rgba(154, 181, 210, 0.12);
  --link-hover-border: rgba(154, 181, 210, 0.26);
  --pub-link-doi-color: #d4deee;
  --pub-link-doi-bg: #1c2a3b;
  --pub-link-web-color: #c4d7ec;
  --pub-link-web-bg: #203245;
  --pub-link-ext-color: #d5dde9;
  --pub-link-ext-bg: #1b2738;
  --seminar-bg: #203246;
  --seminar-color: #c4d7ec;
  --block-title-bg: rgba(154, 181, 210, 0.12);
  --hover-wash-soft: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.08) 0%,
    rgba(255, 255, 255, 0.025) 100%
  );
  --hover-wash-strong: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.11) 0%,
    rgba(255, 255, 255, 0.035) 100%
  );
  --interaction-shadow: 0 14px 30px rgba(3, 7, 18, 0.28);
  --interaction-shadow-strong: 0 20px 40px rgba(3, 7, 18, 0.36);
  --interaction-border: color-mix(
    in srgb,
    var(--accent) 14%,
    var(--border-light)
  );
  --sidebar-surface: rgba(255, 255, 255, 0.042);
  --sidebar-surface-hover: rgba(255, 255, 255, 0.082);
  --sidebar-border-soft: rgba(255, 255, 255, 0.11);
  --sidebar-rail: rgba(255, 255, 255, 0.1);
  --sidebar-active-wash: linear-gradient(
    90deg,
    rgba(223, 193, 141, 0.18) 0%,
    rgba(223, 193, 141, 0.06) 58%,
    rgba(223, 193, 141, 0) 100%
  );
  --focus-ring-outer: color-mix(
    in srgb,
    var(--accent-strong) 52%,
    rgba(255, 255, 255, 0.18)
  );
  --focus-ring-inner: color-mix(
    in srgb,
    var(--surface-strong) 76%,
    rgba(255, 255, 255, 0.08)
  );
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  text-size-adjust: 100%;
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 32px;
}

body {
  font-family: "Plus Jakarta Sans", sans-serif;
  position: relative;
  background:
    radial-gradient(
      circle at 14% 0%,
      rgba(255, 255, 255, 0.7) 0%,
      rgba(255, 255, 255, 0) 24%
    ),
    radial-gradient(
      circle at 86% 10%,
      rgba(206, 176, 124, 0.13) 0%,
      transparent 32%
    ),
    radial-gradient(
      circle at 22% 100%,
      rgba(70, 97, 127, 0.08) 0%,
      transparent 38%
    ),
    linear-gradient(
      180deg,
      #faf6f0 0%,
      var(--main-bg-soft) 24%,
      var(--main-bg) 62%,
      #e5ddd1 100%
    );
  color: var(--text-primary);
  display: flex;
  min-height: 100vh;
  font-size: 16px;
  line-height: 1.72;
  text-rendering: optimizeLegibility;
  font-feature-settings:
    "kern" 1,
    "liga" 1;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
}

body::before {
  background:
    radial-gradient(
      circle at top,
      rgba(255, 255, 255, 0.24) 0,
      rgba(255, 255, 255, 0) 42%
    ),
    linear-gradient(
      120deg,
      rgba(255, 255, 255, 0.26) 0,
      rgba(255, 255, 255, 0) 28%
    );
  opacity: 0.72;
}

body::after {
  background:
    radial-gradient(
      circle at 18% 24%,
      rgba(70, 97, 127, 0.06) 0%,
      transparent 26%
    ),
    radial-gradient(
      circle at 80% 76%,
      rgba(157, 109, 50, 0.05) 0%,
      transparent 30%
    );
  opacity: 0.9;
}

.skip-link {
  position: fixed;
  left: 12px;
  top: -44px;
  z-index: 1000;
  background: var(--text-primary);
  color: var(--surface-strong);
  text-decoration: none;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.03em;
  padding: 10px 14px;
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
  transition: top var(--t);
}

.skip-link:focus-visible {
  top: 10px;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid transparent;
  outline-offset: 2px;
  box-shadow:
    0 0 0 2px var(--focus-ring-inner),
    0 0 0 5px var(--focus-ring-outer);
}

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

.header-subtitle,
.pub-context-note,
.pub-summary,
.edu-dept,
.edu-advisor,
.pub-authors,
.pub-venue,
.teach-inst,
.teach-courses,
.honor-text,
.service-role,
.talk-meta,
.sidebar-updated {
  text-wrap: pretty;
}

.edu-dept,
.edu-advisor,
.pub-authors,
.pub-venue,
.teach-inst,
.teach-courses,
.honor-text,
.service-role,
.talk-meta,
.pub-context-note {
  hyphens: auto;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ── MOBILE NAV ─────────────────────────────── */
.mobile-nav {
  display: none;
  position: sticky;
  top: 0;
  z-index: 200;
  flex-direction: column;
  align-items: stretch;
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--sidebar-bg) 96%, transparent) 0%,
    color-mix(in srgb, var(--sidebar-bg-soft) 93%, transparent) 100%
  );
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--sidebar-border-soft);
  box-shadow:
    0 1px 0 color-mix(in srgb, var(--sidebar-accent) 22%, transparent),
    0 8px 18px rgba(3, 7, 18, 0.1);
  padding: 11px 20px 10px;
  gap: 10px;
}

.mobile-nav-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.mobile-nav-brand {
  min-width: 0;
  flex: 1 1 auto;
}

.mobile-nav-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.mobile-nav-name {
  font-family: "Cormorant", serif;
  font-size: 19px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.02em;
  line-height: 0.98;
}

.mobile-nav-links {
  display: flex;
  gap: 4px;
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  scroll-snap-type: x proximity;
  padding: 4px;
  border-radius: 999px;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.038) 0%,
    rgba(255, 255, 255, 0.018) 100%
  );
  border: 1px solid rgba(255, 255, 255, 0.065);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

.mobile-nav-links::-webkit-scrollbar {
  display: none;
}

.mobile-nav-links a {
  display: inline-flex;
  align-items: center;
  color: var(--sidebar-muted);
  text-decoration: none;
  font-size: 11.25px;
  font-weight: 550;
  letter-spacing: 0.035em;
  padding: 7px 12px;
  min-height: 35px;
  border-radius: 999px;
  border: 1px solid transparent;
  white-space: nowrap;
  scroll-snap-align: start;
  -webkit-tap-highlight-color: transparent;
  transition:
    color var(--t),
    background var(--t),
    border-color var(--t),
    box-shadow var(--t),
    transform var(--t);
}

.mobile-nav-links a:focus {
  outline: none;
}

.mobile-nav-links a:focus-visible {
  outline: 2px solid transparent;
  box-shadow:
    0 0 0 2px rgba(9, 17, 29, 0.88),
    0 0 0 5px rgba(206, 176, 124, 0.45);
}

.mobile-nav-links a.active,
.mobile-nav-links a[aria-current="location"] {
  color: #fffaf0;
  background: linear-gradient(
    90deg,
    rgba(223, 193, 141, 0.12) 0%,
    rgba(223, 193, 141, 0.04) 74%,
    rgba(223, 193, 141, 0) 100%
  );
  border-color: rgba(223, 193, 141, 0.18);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 4px 10px rgba(3, 7, 18, 0.08);
}

/* ── THEME TOGGLE ───────────────────────────── */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 12px;
  min-height: 36px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface-muted) 88%, transparent);
  color: var(--text-secondary);
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition:
    background-color var(--t),
    border-color var(--t),
    color var(--t),
    box-shadow var(--t),
    transform var(--t);
}

.theme-toggle:hover {
  background: var(--hover-wash-soft);
  border-color: var(--link-hover-border);
  color: var(--accent-strong);
  box-shadow: var(--interaction-shadow);
  transform: translateY(-1px);
}

.theme-toggle-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

/* Moon: shown in light mode; Sun: shown in dark mode */
.theme-toggle .icon-sun {
  display: none;
}
:root[data-theme="dark"] .theme-toggle .icon-moon {
  display: none;
}
:root[data-theme="dark"] .theme-toggle .icon-sun {
  display: inline;
}

.theme-toggle-mobile {
  margin-left: 0;
  flex: 0 0 auto;
  padding: 7px 10px;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.038) 0%,
    rgba(255, 255, 255, 0.018) 100%
  );
  border-color: rgba(255, 255, 255, 0.085);
  color: var(--sidebar-muted);
}

/* Desktop sidebar toggle: styled to suit the dark sidebar */
.theme-toggle-desktop {
  width: 100%;
  margin-bottom: 10px;
  justify-content: flex-start;
  padding: 8px 12px;
  min-height: 40px;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.042) 0%,
    rgba(255, 255, 255, 0.024) 100%
  );
  border-color: rgba(255, 255, 255, 0.1);
  color: var(--sidebar-muted);
  border-radius: 14px;
  letter-spacing: 0.02em;
}

.theme-toggle-mobile:hover,
.theme-toggle-desktop:hover {
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.072) 0%,
    rgba(255, 255, 255, 0.032) 100%
  );
  border-color: rgba(255, 255, 255, 0.125);
  color: var(--sidebar-text);
  box-shadow: none;
}

.theme-toggle-desktop .icon-moon {
  color: var(--sidebar-accent);
}

:root[data-theme="dark"] .theme-toggle-desktop .icon-sun {
  color: #fbbf24;
}

.theme-toggle-desktop:focus-visible {
  outline: 2px solid transparent;
  box-shadow:
    0 0 0 2px rgba(9, 17, 29, 0.9),
    0 0 0 5px rgba(223, 193, 141, 0.46);
}

/* ── SIDEBAR ────────────────────────────────── */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background:
    radial-gradient(
      circle at 100% 0%,
      rgba(223, 193, 141, 0.12) 0%,
      rgba(223, 193, 141, 0) 28%
    ),
    radial-gradient(
      circle at 0% 100%,
      rgba(154, 181, 210, 0.08) 0%,
      rgba(154, 181, 210, 0) 34%
    ),
    linear-gradient(180deg, var(--sidebar-bg) 0%, var(--sidebar-bg-soft) 100%);
  display: flex;
  flex-direction: column;
  padding: 30px 22px 22px;
  z-index: 100;
  overflow-y: auto;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 16px 0 48px rgba(0, 0, 0, 0.24);
}

/* Gold accent strip at top */
.sidebar::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--sidebar-accent);
  pointer-events: none;
}

.sidebar::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.04) 0%,
      rgba(255, 255, 255, 0) 22%
    ),
    linear-gradient(
      120deg,
      rgba(255, 255, 255, 0.03) 0%,
      rgba(255, 255, 255, 0) 26%
    );
  pointer-events: none;
}

.sidebar > * {
  position: relative;
  z-index: 1;
}

.sidebar-profile {
  margin-bottom: 8px;
}

.sidebar-name {
  font-family: "Cormorant", serif;
  font-size: 25px;
  font-weight: 600;
  color: #fff;
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin-bottom: 7px;
}

.sidebar-role {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--sidebar-accent);
  margin-bottom: 16px;
}

.sidebar-contact {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--sidebar-muted);
  font-size: 12px;
  line-height: 1.45;
  text-decoration: none;
  transition:
    color var(--t),
    background-color var(--t),
    border-color var(--t),
    transform var(--t);
  font-weight: 500;
  padding: 6px 10px 6px 8px;
  border-radius: 12px;
  margin: 0 -6px;
  border: 1px solid transparent;
}

.contact-item:hover {
  color: var(--sidebar-text);
  background: var(--sidebar-surface);
  border-color: rgba(255, 255, 255, 0.06);
  transform: translateX(1px);
}

.contact-item svg {
  flex-shrink: 0;
  opacity: 0.65;
}

.sidebar-contact-social {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.contact-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #c4d0e8;
  text-decoration: none;
  font-size: 11.5px;
  line-height: 1;
  padding: 6px 10px;
  border-radius: 999px;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.07) 0%,
    rgba(255, 255, 255, 0.045) 100%
  );
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition:
    background-color var(--t),
    color var(--t),
    border-color var(--t),
    transform var(--t);
  font-weight: 500;
}

.contact-pill:hover {
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.11) 0%,
    rgba(255, 255, 255, 0.06) 100%
  );
  color: #fff;
  border-color: rgba(255, 255, 255, 0.16);
  transform: translateY(-1px);
}

.contact-pill svg {
  width: 11px;
  height: 11px;
  opacity: 0.8;
  flex-shrink: 0;
}

.sidebar-divider {
  height: 1px;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.1) 18%,
    rgba(223, 193, 141, 0.12) 52%,
    rgba(255, 255, 255, 0) 100%
  );
  margin: 16px 0;
}

.sidebar-nav-label {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #7a8daa;
  margin-bottom: 10px;
}

.sidebar-nav {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-left: 14px;
}

.sidebar-nav::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 7px;
  bottom: 7px;
  width: 1px;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.06) 10%,
    rgba(223, 193, 141, 0.1) 54%,
    rgba(255, 255, 255, 0) 100%
  );
}

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 40px;
  padding: 9px 12px 9px 14px;
  border-radius: 14px;
  color: var(--sidebar-muted);
  font-size: 12.75px;
  line-height: 1.25;
  font-weight: 500;
  text-decoration: none;
  transition:
    color var(--t),
    background var(--t),
    border-color var(--t),
    box-shadow var(--t),
    transform var(--t);
  border: 1px solid transparent;
}

.nav-item:focus-visible {
  outline: 2px solid transparent;
  box-shadow:
    0 0 0 2px rgba(9, 17, 29, 0.9),
    0 0 0 5px rgba(206, 176, 124, 0.5);
}

.nav-item.active,
.nav-item[aria-current="location"] {
  color: #f6efdf;
  font-weight: 550;
  background: linear-gradient(
    90deg,
    rgba(223, 193, 141, 0.13) 0%,
    rgba(223, 193, 141, 0.035) 78%,
    rgba(223, 193, 141, 0) 100%
  );
  border-color: rgba(223, 193, 141, 0.11);
  box-shadow:
    inset 2px 0 0 var(--sidebar-accent),
    inset 0 1px 0 rgba(255, 255, 255, 0.035);
  transform: none;
}

.nav-item .nav-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  border: 1px solid currentColor;
  background: transparent;
  flex-shrink: 0;
  opacity: 0.5;
  transition:
    opacity var(--t),
    background-color var(--t),
    box-shadow var(--t),
    transform var(--t);
}

.nav-item:hover .nav-dot {
  opacity: 0.82;
  box-shadow: 0 0 0 3px rgba(154, 181, 210, 0.14);
}

.nav-item.active .nav-dot {
  opacity: 1;
  background: currentColor;
  box-shadow: 0 0 0 3px rgba(223, 193, 141, 0.1);
  transform: scale(1.02);
}

.interests-label {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #7a8daa;
  margin-bottom: 10px;
}

.sidebar-focus {
  margin: 14px 0 4px;
}

.interests-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.interest-tag {
  display: inline-flex;
  align-items: center;
  font-size: 11.5px;
  line-height: 1.4;
  color: #c4d0e8;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.07) 0%,
    rgba(255, 255, 255, 0.04) 100%
  );
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  padding: 4px 9px;
  white-space: normal;
  font-weight: 500;
}

/* ── SIDEBAR FOOTER ─────────────────────────── */
.sidebar-footer {
  margin-top: auto;
  padding-top: 20px;
}

.sidebar-download {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 9px;
  width: 100%;
  min-height: 40px;
  padding: 8px 12px;
  border-radius: 14px;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.034) 0%,
    rgba(255, 255, 255, 0.018) 100%
  );
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--sidebar-text);
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-decoration: none;
  transition:
    background-color 0.22s,
    border-color 0.22s,
    color 0.22s,
    transform 0.22s,
    box-shadow 0.22s;
  margin-bottom: 12px;
  cursor: pointer;
}

.sidebar-download:hover {
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.065) 0%,
    rgba(255, 255, 255, 0.028) 100%
  );
  border-color: rgba(223, 193, 141, 0.14);
  color: #fff9ee;
  transform: translateY(-1px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.sidebar-download svg {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
  box-sizing: content-box;
  padding: 4px;
  border-radius: 999px;
  color: var(--sidebar-accent);
  background: rgba(223, 193, 141, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.sidebar-download-label {
  min-width: 0;
}

.sidebar-download-meta {
  font-family: "Fira Code", monospace;
  font-size: 9.5px;
  color: var(--sidebar-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sidebar-updated {
  font-size: 11.5px;
  color: #6b7d99;
  text-align: left;
  padding-left: 2px;
  letter-spacing: 0.02em;
  line-height: 1.5;
}

/* ── MAIN CONTENT ───────────────────────────── */
.main {
  margin-left: var(--sidebar-w);
  flex: 1;
  padding: clamp(46px, 5vw, 64px) clamp(22px, 6vw, 84px) 118px;
  max-width: calc(960px + var(--sidebar-w));
  position: relative;
}

/* ── PAGE HEADER ────────────────────────────── */
.page-header {
  margin-bottom: var(--section-gap);
  padding: clamp(28px, 4.2vw, 42px) clamp(20px, 4vw, 44px)
    clamp(24px, 3.4vw, 38px);
  border: 1px solid color-mix(in srgb, var(--border) 92%, transparent);
  border-top: 2px solid rgba(206, 176, 124, 0.72);
  border-radius: var(--radius);
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--surface-strong) 94%, transparent) 0%,
    color-mix(in srgb, var(--surface) 94%, transparent) 64%,
    color-mix(in srgb, var(--surface-muted) 72%, transparent) 100%
  );
  box-shadow:
    0 18px 38px rgba(24, 33, 46, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.52);
  position: relative;
  overflow: hidden;
}

.page-header::before,
.page-header::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.page-header::before {
  inset: auto -98px -122px auto;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(206, 176, 124, 0.11) 0%,
    rgba(206, 176, 124, 0) 72%
  );
}

.page-header::after {
  inset: 0;
  background:
    linear-gradient(
      120deg,
      rgba(255, 255, 255, 0.3) 0%,
      rgba(255, 255, 255, 0) 30%
    ),
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.18) 0%,
      rgba(255, 255, 255, 0) 100%
    ),
    radial-gradient(
      circle at 82% 16%,
      rgba(206, 176, 124, 0.08) 0%,
      rgba(206, 176, 124, 0) 28%
    );
  opacity: 0.46;
}

.page-header > * {
  position: relative;
  z-index: 1;
}

.header-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.header-kicker {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
}

.header-download {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 10px 5px 9px;
  border: 1px solid
    color-mix(in srgb, var(--border-light) 86%, var(--accent) 10%);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface-strong) 50%, transparent);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 10.25px;
  font-weight: 600;
  letter-spacing: 0.045em;
  transition:
    background-color 0.22s,
    border-color 0.22s,
    color 0.22s,
    box-shadow 0.22s,
    transform 0.22s;
  cursor: pointer;
}

.header-download:hover {
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--surface-strong) 76%, transparent) 0%,
    color-mix(in srgb, var(--surface-muted) 70%, transparent) 100%
  );
  border-color: color-mix(in srgb, var(--accent) 20%, var(--border-light));
  color: var(--text-primary);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.44),
    0 8px 18px rgba(24, 33, 46, 0.04);
  transform: none;
}

.header-download svg {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
  color: color-mix(in srgb, var(--accent-strong) 82%, var(--accent-warm) 18%);
  opacity: 1;
}

.header-name {
  font-family: "Cormorant", serif;
  font-size: clamp(40px, 8.4vw, 72px);
  font-weight: 400;
  line-height: 0.9;
  color: var(--text-primary);
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.header-name em {
  font-style: italic;
  font-weight: 300;
  color: var(--text-secondary);
}

.header-rule {
  height: 1px;
  background: linear-gradient(90deg, var(--rule) 0%, transparent 72%);
  margin: 24px 0 16px;
}

.header-subtitle {
  font-size: clamp(10.5px, 1.15vw, 12px);
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 16px;
  max-width: 56ch;
  line-height: 1.68;
}

.header-links {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}

.header-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-secondary);
  text-decoration: none;
  letter-spacing: 0.03em;
  transition:
    background-color var(--t),
    color var(--t),
    border-color var(--t),
    box-shadow var(--t),
    transform var(--t);
  padding: 6px 11px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface-muted) 72%, transparent);
  max-width: 100%;
  overflow-wrap: anywhere;
}

.header-link:hover {
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--surface-strong) 70%, transparent) 0%,
    color-mix(in srgb, var(--surface-muted) 72%, transparent) 100%
  );
  color: var(--accent-strong);
  border-color: color-mix(in srgb, var(--accent) 16%, var(--border-light));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.36);
  text-decoration: none;
  transform: none;
}

.header-link svg {
  opacity: 0.62;
}

/* ── SECTIONS ───────────────────────────────── */
section {
  margin-bottom: var(--section-gap);
  scroll-margin-top: 32px;
  opacity: 0;
  transform: translateY(16px);
  transition:
    opacity 0.52s cubic-bezier(0.2, 0.7, 0.2, 1),
    transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1);
}

section.visible {
  opacity: 1;
  transform: none;
}

section:nth-of-type(1) {
  transition-delay: 0.02s;
}

section:nth-of-type(2) {
  transition-delay: 0.04s;
}

section:nth-of-type(3) {
  transition-delay: 0.06s;
}

section:nth-of-type(4) {
  transition-delay: 0.08s;
}

section:nth-of-type(5) {
  transition-delay: 0.1s;
}

section:nth-of-type(6) {
  transition-delay: 0.12s;
}

.section-header {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 24px;
}

.section-title {
  font-family: "Cormorant", serif;
  font-size: clamp(27px, 4vw, 35px);
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 16px;
  white-space: nowrap;
  text-wrap: balance;
}

.section-title::before {
  content: "";
  display: inline-block;
  width: 2px;
  height: 28px;
  border-radius: 2px;
  background: linear-gradient(
    to bottom,
    var(--accent-warm),
    rgba(157, 109, 50, 0.16)
  );
  flex-shrink: 0;
}

.section-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(
    90deg,
    color-mix(in srgb, var(--accent) 10%, var(--border-light)) 0%,
    transparent 78%
  );
  opacity: 0.74;
}

/* ── EDUCATION ──────────────────────────────── */
.edu-list,
.teach-list,
.honors-list,
.service-list,
.talks-list,
.pub-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  border-top: none;
}

.edu-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 22px;
  padding: 22px 6px;
  border: none;
  background: transparent;
  box-shadow: none;
  transition: background-color var(--t);
}

.edu-item:hover {
  background: var(--hover-wash-soft);
}

.edu-degree {
  font-family: "Cormorant", serif;
  font-size: 23px;
  font-weight: 600;
  color: var(--text-primary);
  grid-column: 1;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.edu-period {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-muted);
  grid-column: 2;
  white-space: nowrap;
  font-family: "Fira Code", monospace;
  margin-top: 3px;
}

.edu-dept {
  font-size: 13.5px;
  color: color-mix(in srgb, var(--text-secondary) 94%, var(--text-primary));
  grid-column: 1 / -1;
  line-height: 1.65;
}

.edu-advisor {
  font-size: 13px;
  color: color-mix(in srgb, var(--text-muted) 92%, var(--text-secondary));
  grid-column: 1 / -1;
}

.edu-advisor span {
  color: var(--text-secondary);
  font-weight: 600;
}

.edu-advisor a {
  color: var(--text-secondary);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 2px;
  transition: color var(--t);
}

.edu-advisor a:hover {
  color: var(--accent);
}

/* ── PUBLICATIONS ───────────────────────────── */

.pub-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 24px;
  padding-bottom: 2px;
}

.pub-toolbar::-webkit-scrollbar {
  display: none;
}

.pub-filters {
  display: flex;
  gap: 7px;
  flex-wrap: nowrap;
  align-items: stretch;
  flex: 0 0 auto;
}

.pub-filters::-webkit-scrollbar {
  display: none;
}

.pub-toolbar-meta {
  display: flex;
  align-items: center;
  gap: 0;
  flex: 0 0 auto;
  margin-left: auto;
  padding-left: 10px;
}

.pub-summary {
  font-size: 11.25px;
  line-height: 1.45;
  color: color-mix(in srgb, var(--text-muted) 94%, var(--text-secondary));
  white-space: nowrap;
  padding-left: 2px;
  letter-spacing: 0.02em;
}

.pub-context-note {
  margin-bottom: 22px;
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--surface-strong) 72%, var(--surface-muted)) 0%,
    color-mix(in srgb, var(--surface-muted) 88%, transparent) 100%
  );
  border: 1px solid color-mix(in srgb, var(--border-light) 90%, transparent);
  border-left: 3px solid rgba(157, 109, 50, 0.34);
  border-radius: var(--radius);
  padding: 13px 16px;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.7;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.42);
}

.pub-context-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--text-muted);
  margin-top: 2px;
}

.pub-filter {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  min-height: 34px;
  background: color-mix(in srgb, var(--surface-muted) 68%, transparent);
  border: 1px solid color-mix(in srgb, var(--border-light) 92%, transparent);
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition:
    color var(--t),
    border-color var(--t),
    background-color var(--t),
    transform var(--t);
  white-space: nowrap;
  border-radius: 999px;
}

.pub-filter:hover {
  color: var(--text-secondary);
  border-color: var(--link-hover-border);
  background: var(--hover-wash-soft);
}

.pub-filter.active {
  font-weight: 700;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.34),
    0 8px 18px rgba(24, 33, 46, 0.04);
}

.pub-filter[data-filter="all"].active {
  border-color: color-mix(
    in srgb,
    var(--text-primary) 20%,
    var(--border-light)
  );
  background: color-mix(in srgb, var(--text-primary) 6%, var(--surface-strong));
  color: var(--text-primary);
}

.pub-filter[data-filter="journal"].active {
  border-color: color-mix(
    in srgb,
    var(--tag-journal-color) 28%,
    var(--border-light)
  );
  background: color-mix(
    in srgb,
    var(--tag-journal-bg) 84%,
    var(--surface-strong)
  );
  color: var(--tag-journal-color);
}

.pub-filter[data-filter="conference"].active {
  border-color: color-mix(
    in srgb,
    var(--tag-conf-color) 28%,
    var(--border-light)
  );
  background: color-mix(in srgb, var(--tag-conf-bg) 84%, var(--surface-strong));
  color: var(--tag-conf-color);
}

.pub-filter[data-filter="poster"].active {
  border-color: color-mix(
    in srgb,
    var(--tag-poster-color) 30%,
    var(--border-light)
  );
  background: color-mix(
    in srgb,
    var(--tag-poster-bg) 84%,
    var(--surface-strong)
  );
  color: var(--tag-poster-color);
}

.pub-filter[data-filter="review"].active {
  border-color: color-mix(
    in srgb,
    var(--tag-review-color) 30%,
    var(--border-light)
  );
  background: color-mix(
    in srgb,
    var(--tag-review-bg) 84%,
    var(--surface-strong)
  );
  color: var(--tag-review-color);
}

.filter-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  flex-shrink: 0;
  opacity: 0.65;
  transition: opacity var(--t);
}

.pub-filter.active .filter-dot {
  opacity: 1;
}

.pub-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 16px;
  border-radius: 999px;
  font-size: 9.5px;
  font-weight: 700;
  padding: 0 4px;
  background: rgba(27, 35, 48, 0.07);
  color: inherit;
  margin-left: 2px;
}

.pub-filter.active .pub-count {
  background: rgba(27, 35, 48, 0.1);
}

.pub-group {
  margin-bottom: 38px;
}

.pub-group-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 14px;
  padding-bottom: 0;
  border-bottom: none;
  display: flex;
  align-items: center;
  gap: 10px;
}

.pub-group-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 999px;
  flex-shrink: 0;
}

.pub-load-error {
  padding: 18px 20px;
  border-radius: var(--radius);
  border: 1px solid color-mix(in srgb, var(--border-light) 90%, transparent);
  background: color-mix(in srgb, var(--surface-muted) 88%, transparent);
  color: var(--text-secondary);
}

.pub-item {
  padding: 22px 6px;
  border: none;
  background: transparent;
  box-shadow: none;
  transition: background-color var(--t);
}

.pub-item:hover {
  background: var(--hover-wash-soft);
}

.pub-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 9px;
}

.pub-title {
  font-family: "Cormorant", serif;
  font-size: 21px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.25;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.pub-badge {
  flex-shrink: 0;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 5px 9px;
  border-radius: 999px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.pub-badge.journal {
  background: var(--tag-journal-bg);
  color: var(--tag-journal-color);
}

.pub-badge.conference {
  background: var(--tag-conf-bg);
  color: var(--tag-conf-color);
}

.pub-badge.poster {
  background: var(--tag-poster-bg);
  color: var(--tag-poster-color);
}

.pub-badge.review {
  background: var(--tag-review-bg);
  color: var(--tag-review-color);
}

.pub-authors {
  font-size: 13px;
  color: color-mix(in srgb, var(--text-secondary) 94%, var(--text-primary));
  margin-bottom: 7px;
  line-height: 1.65;
}

.pub-authors strong {
  color: var(--text-primary);
  font-weight: 700;
}

.pub-venue {
  font-size: 13px;
  color: color-mix(in srgb, var(--text-muted) 92%, var(--text-secondary));
  margin-bottom: 10px;
  line-height: 1.65;
}

.pub-venue .venue-name {
  color: var(--accent);
  font-weight: 600;
}

.pub-links {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.pub-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 500;
  font-family: "Fira Code", monospace;
  letter-spacing: 0.02em;
  color: var(--text-muted);
  text-decoration: none;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--border-light) 90%, transparent);
  background: color-mix(in srgb, var(--surface-muted) 84%, transparent);
  transition:
    background-color var(--t),
    border-color var(--t),
    color var(--t),
    box-shadow var(--t),
    transform var(--t);
}

.pub-link:hover {
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--surface-strong) 74%, transparent) 0%,
    color-mix(in srgb, var(--surface-muted) 68%, transparent) 100%
  );
  border-color: color-mix(in srgb, var(--accent) 16%, var(--border-light));
  color: var(--accent-strong);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.34);
  transform: none;
}

.pub-link-icon {
  width: 12px;
  height: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.pub-link-icon svg {
  width: 12px;
  height: 12px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.pub-link-doi {
  color: var(--pub-link-doi-color);
  background: var(--pub-link-doi-bg);
}

.pub-link-web {
  color: var(--pub-link-web-color);
  background: var(--pub-link-web-bg);
}

.pub-link-external {
  color: var(--pub-link-ext-color);
  background: var(--pub-link-ext-bg);
}

.pub-note {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  color: var(--accent-warm);
  font-weight: 600;
  margin-top: 8px;
}

.pub-note svg {
  flex-shrink: 0;
}

/* ── TEACHING ───────────────────────────────── */
.teach-block {
  margin-bottom: 34px;
}

.teach-block-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-secondary);
  padding: 0;
  margin-bottom: 12px;
  background: none;
  border: none;
  display: block;
}

.teach-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0 14px;
  align-items: start;
  padding: 18px 6px;
  border: none;
  background: transparent;
  box-shadow: none;
  transition: background-color var(--t);
}

.teach-item:hover {
  background: var(--hover-wash-soft);
}

.teach-marker {
  width: 3px;
  height: 24px;
  border-radius: 1px;
  background: var(--accent-warm);
  margin-top: 3px;
  flex-shrink: 0;
}

.teach-role {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 3px;
  letter-spacing: -0.01em;
}

.teach-inst {
  font-size: 13px;
  color: color-mix(in srgb, var(--text-secondary) 94%, var(--text-primary));
  margin-bottom: 6px;
}

.teach-courses {
  font-size: 12.5px;
  color: color-mix(in srgb, var(--text-muted) 82%, var(--text-secondary));
  font-weight: 500;
  font-style: italic;
  line-height: 1.65;
}

.teach-period {
  font-size: 11px;
  font-family: "Fira Code", monospace;
  color: var(--text-muted);
  white-space: nowrap;
  margin-top: 2px;
}

/* ── HONORS ─────────────────────────────────── */
.honor-item {
  display: grid;
  grid-template-columns: 20px 1fr auto;
  gap: 0 11px;
  align-items: center;
  padding: 16px 6px;
  border: none;
  background: transparent;
  box-shadow: none;
  transition: background-color var(--t);
}

.honor-item:hover {
  background: var(--hover-wash-soft);
}

.honor-star {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-warm);
  flex-shrink: 0;
}

.honor-text {
  font-size: 13.5px;
  color: var(--text-primary);
  line-height: 1.6;
  font-weight: 600;
}

.honor-year {
  font-size: 11px;
  font-family: "Fira Code", monospace;
  color: var(--text-muted);
  white-space: nowrap;
}

/* ── SERVICE ─────────────────────────────────── */
.service-block {
  margin-bottom: 28px;
}

.service-block-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-secondary);
  padding: 0;
  margin-bottom: 12px;
  background: none;
  border: none;
  display: block;
}

.service-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 14px;
  padding: 14px 6px;
  border: none;
  background: transparent;
  box-shadow: none;
  transition: background-color var(--t);
}

.service-item:hover {
  background: var(--hover-wash-soft);
}

.service-role {
  font-size: 13.75px;
  color: var(--text-primary);
  font-weight: 500;
  line-height: 1.58;
}

.service-role em {
  font-style: normal;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-secondary);
  display: block;
  margin-bottom: 4px;
}

.service-year {
  font-size: 11px;
  font-family: "Fira Code", monospace;
  color: var(--text-muted);
  grid-row: 1;
  grid-column: 2;
  align-self: center;
  white-space: nowrap;
}

/* Reviewer grid */
.reviewer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 28px;
  border-top: none;
}

.reviewer-item {
  padding: 12px 4px;
  background: transparent;
  border: none;
  font-size: 12.75px;
  color: var(--text-primary);
  box-shadow: none;
  transition: background-color var(--t);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 500;
}

.reviewer-item:hover {
  background: var(--hover-wash-soft);
}

.reviewer-year {
  font-size: 10.5px;
  font-family: "Fira Code", monospace;
  color: var(--text-muted);
  margin-left: 8px;
}

/* ── TALKS ───────────────────────────────────── */
.talk-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0 18px;
  padding: 18px 6px;
  border: none;
  background: transparent;
  box-shadow: none;
  transition: background-color var(--t);
  align-items: start;
}

.talk-item:hover {
  background: var(--hover-wash-soft);
}

.talk-year {
  font-size: 11px;
  font-family: "Fira Code", monospace;
  color: var(--year-pill-text);
  font-weight: 600;
  margin-top: 3px;
}

.talk-title {
  font-family: "Cormorant", serif;
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
  line-height: 1.3;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.edu-item,
.pub-item,
.teach-item,
.honor-item,
.service-item,
.reviewer-item,
.talk-item {
  position: relative;
  border-bottom: none;
  border-radius: 14px;
  padding-inline: 12px;
  overflow: hidden;
  isolation: isolate;
  transition:
    background-color var(--t),
    box-shadow var(--t),
    transform var(--t);
}

.edu-item::before,
.pub-item::before,
.teach-item::before,
.honor-item::before,
.service-item::before,
.reviewer-item::before,
.talk-item::before {
  content: "";
  position: absolute;
  inset: 18% auto 18% 0;
  width: 1px;
  border-radius: 999px;
  background: linear-gradient(
    to bottom,
    color-mix(in srgb, var(--accent-warm) 74%, white 26%),
    rgba(157, 109, 50, 0.08)
  );
  opacity: 0;
  transform: translateY(6px);
  transition:
    opacity var(--t),
    transform var(--t);
}

.edu-item:hover,
.edu-item:focus-within,
.pub-item:hover,
.pub-item:focus-within,
.teach-item:hover,
.teach-item:focus-within,
.honor-item:hover,
.honor-item:focus-within,
.service-item:hover,
.service-item:focus-within,
.reviewer-item:hover,
.reviewer-item:focus-within,
.talk-item:hover,
.talk-item:focus-within {
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--surface-strong) 70%, transparent) 0%,
    color-mix(in srgb, var(--surface-muted) 58%, transparent) 100%
  );
  box-shadow:
    inset 0 0 0 1px color-mix(
      in srgb,
      var(--accent) 8%,
      var(--border-light)
    ),
    0 10px 22px rgba(24, 33, 46, 0.035);
  transform: none;
}

.edu-item:hover::before,
.edu-item:focus-within::before,
.pub-item:hover::before,
.pub-item:focus-within::before,
.teach-item:hover::before,
.teach-item:focus-within::before,
.honor-item:hover::before,
.honor-item:focus-within::before,
.service-item:hover::before,
.service-item:focus-within::before,
.reviewer-item:hover::before,
.reviewer-item:focus-within::before,
.talk-item:hover::before,
.talk-item:focus-within::before {
  opacity: 1;
  transform: none;
}

.header-download,
.header-link,
.contact-pill,
.pub-link,
.sidebar-download,
.nav-item,
.pub-filter {
  -webkit-tap-highlight-color: transparent;
}

.talk-meta {
  font-size: 12.5px;
  color: color-mix(in srgb, var(--text-muted) 88%, var(--text-secondary));
}

.talk-meta .talk-type {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 8px;
  border-radius: 999px;
  margin-right: 6px;
  background: var(--tag-conf-bg);
  color: var(--tag-conf-color);
}

.talk-type.invited {
  background: var(--accent-warm-light);
  color: var(--accent-warm);
}

.talk-type.seminar {
  background: var(--seminar-bg);
  color: var(--seminar-color);
}

/* ── DARK MODE TUNING ───────────────────────── */
:root[data-theme="dark"] body {
  background:
    radial-gradient(
      circle at 84% 8%,
      rgba(154, 181, 210, 0.14),
      transparent 34%
    ),
    radial-gradient(
      circle at 12% 88%,
      rgba(223, 193, 141, 0.1),
      transparent 36%
    ),
    radial-gradient(
      circle at 18% 0%,
      rgba(255, 255, 255, 0.04),
      transparent 26%
    ),
    linear-gradient(
      180deg,
      var(--main-bg-soft) 0%,
      var(--main-bg) 52%,
      #0a111b 100%
    );
}

:root[data-theme="dark"] body::before {
  background:
    radial-gradient(
      circle at top,
      rgba(255, 255, 255, 0.06) 0,
      rgba(255, 255, 255, 0) 42%
    ),
    linear-gradient(
      120deg,
      rgba(255, 255, 255, 0.05) 0,
      rgba(255, 255, 255, 0) 24%
    );
  opacity: 0.8;
}

:root[data-theme="dark"] body::after {
  background:
    radial-gradient(
      circle at 20% 24%,
      rgba(154, 181, 210, 0.08) 0%,
      transparent 28%
    ),
    radial-gradient(
      circle at 78% 78%,
      rgba(223, 193, 141, 0.06) 0%,
      transparent 30%
    );
  opacity: 0.45;
}

:root[data-theme="dark"] .mobile-nav {
  background: linear-gradient(
    180deg,
    rgba(9, 17, 29, 0.94) 0%,
    rgba(14, 24, 39, 0.88) 100%
  );
  border-bottom-color: rgba(255, 255, 255, 0.08);
  box-shadow:
    0 1px 0 rgba(223, 193, 141, 0.28),
    0 8px 18px rgba(3, 7, 18, 0.16);
}

:root[data-theme="dark"] .theme-toggle {
  background: rgba(24, 36, 54, 0.82);
  border-color: rgba(154, 181, 210, 0.18);
  color: #d8e2f2;
}

:root[data-theme="dark"] .mobile-nav-links a.active,
:root[data-theme="dark"] .mobile-nav-links a[aria-current="location"] {
  background: linear-gradient(
    90deg,
    rgba(223, 193, 141, 0.13) 0%,
    rgba(223, 193, 141, 0.045) 76%,
    rgba(223, 193, 141, 0) 100%
  );
  border-color: rgba(223, 193, 141, 0.18);
}

@media (hover: hover) and (pointer: fine) {
  .mobile-nav-links a:hover {
    color: #fff;
    background: rgba(154, 181, 210, 0.1);
    border-color: rgba(255, 255, 255, 0.13);
    box-shadow: none;
  }

  .nav-item:hover {
    color: #d8e8f8;
    background: rgba(154, 181, 210, 0.09);
    border-color: rgba(154, 181, 210, 0.15);
    box-shadow: none;
  }

  :root[data-theme="dark"] .mobile-nav-links a:hover {
    background: rgba(255, 255, 255, 0.045);
  }
}

:root[data-theme="dark"] .contact-pill {
  color: #d6e1f8;
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.16);
}

:root[data-theme="dark"] .page-header {
  border-top-color: rgba(223, 193, 141, 0.62);
}

:root[data-theme="dark"] .page-header::after {
  opacity: 0.2;
}

:root[data-theme="dark"] .theme-toggle.header-theme-toggle {
  background: rgba(24, 36, 54, 0.5);
  border-color: rgba(154, 181, 210, 0.16);
  color: #d7e5f8;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

:root[data-theme="dark"] .theme-toggle.header-theme-toggle:hover {
  background: rgba(27, 40, 60, 0.72);
  border-color: rgba(154, 181, 210, 0.24);
  color: #f0f5fd;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 10px 18px rgba(3, 7, 18, 0.12);
}

:root[data-theme="dark"] .header-link {
  background: rgba(24, 36, 54, 0.58);
  border-color: rgba(154, 181, 210, 0.14);
}

:root[data-theme="dark"] .header-link:hover {
  background: rgba(27, 40, 60, 0.72);
  border-color: rgba(154, 181, 210, 0.22);
}

:root[data-theme="dark"] .header-download {
  background: rgba(24, 36, 54, 0.42);
  border-color: rgba(154, 181, 210, 0.16);
}

:root[data-theme="dark"] .header-download:hover {
  background: rgba(27, 40, 60, 0.58);
  border-color: rgba(154, 181, 210, 0.2);
}

:root[data-theme="dark"] .sidebar-nav-label,
:root[data-theme="dark"] .interests-label {
  color: #94a8cc;
}

:root[data-theme="dark"] .sidebar-download {
  background: rgba(255, 255, 255, 0.02);
  border-color: rgba(255, 255, 255, 0.065);
}

:root[data-theme="dark"] .sidebar-download:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(223, 193, 141, 0.16);
}

:root[data-theme="dark"] .sidebar-updated {
  color: #8798b8;
}

:root[data-theme="dark"] .theme-toggle:hover {
  background: var(--hover-wash-soft);
  border-color: var(--link-hover-border);
  color: #d7e5ff;
}

:root[data-theme="dark"] #scrollToTopBtn {
  background: linear-gradient(
    135deg,
    rgba(24, 36, 54, 0.92) 0%,
    rgba(20, 30, 44, 0.94) 100%
  );
  border-color: rgba(154, 181, 210, 0.16);
  color: #d5e2f4;
  box-shadow:
    0 12px 24px rgba(3, 7, 18, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

:root[data-theme="dark"] #scrollToTopBtn:hover {
  background: linear-gradient(
    135deg,
    rgba(31, 45, 66, 0.94) 0%,
    rgba(23, 35, 52, 0.96) 100%
  );
  border-color: rgba(223, 193, 141, 0.18);
  color: #f4f8ff;
}

:root[data-theme="dark"] .pub-count {
  background: rgba(148, 163, 184, 0.2);
}

:root[data-theme="dark"] .pub-filter.active .pub-count {
  background: rgba(141, 179, 255, 0.25);
}

:root[data-theme="dark"] .pub-summary,
:root[data-theme="dark"] .pub-group-label,
:root[data-theme="dark"] .pub-context-icon {
  color: #a9b8d4;
}

:root[data-theme="dark"] .header-rule {
  background: linear-gradient(
    90deg,
    rgba(184, 201, 224, 0.22) 0%,
    transparent 72%
  );
}

:root[data-theme="dark"] .section-title::before {
  background: linear-gradient(to bottom, #dfc18d, rgba(223, 193, 141, 0.22));
}

:root[data-theme="dark"] .year-badge,
:root[data-theme="dark"] .pub-venue .pub-year {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

/* ── YEAR BADGES ────────────────────────────── */
.year-badge,
.pub-venue .pub-year {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: "Fira Code", monospace;
  font-size: 11px;
  font-weight: 600;
  color: var(--year-pill-text);
  letter-spacing: 0.02em;
  white-space: nowrap;
  background: var(--year-pill-bg);
  border: 1px solid var(--year-pill-border);
  border-radius: 999px;
  padding: 3px 8px;
  margin: 0;
}

.year-badge,
.pub-venue .pub-year,
.pub-summary,
.sidebar-updated,
.sidebar-download-meta,
.pub-count {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

/* ── HIDDEN ─────────────────────────────────── */
.pub-item.hidden {
  display: none;
}

/* ── SCROLLBAR ──────────────────────────────── */
.sidebar::-webkit-scrollbar {
  width: 3px;
}

.sidebar::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
}

/* ── RESPONSIVE ─────────────────────────────── */

/* Tablet landscape and below (≤1024px): hide sidebar, show mobile nav */
@media (max-width: 1024px) {
  .sidebar {
    display: none;
  }
  .mobile-nav {
    display: flex;
  }
  body {
    display: block;
  }
  html {
    scroll-padding-top: 106px;
  }
  section {
    scroll-margin-top: 110px;
  }

  .main {
    margin-left: 0;
    max-width: 100%;
    padding: 40px 36px 100px;
  }

  .page-header {
    padding: 28px 28px 26px;
  }
  .header-name {
    font-size: 58px;
  }

  /* Keep 2-column reviewer grid on tablets — there's plenty of space */
  .reviewer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* iPad portrait (≤768px) */
@media (max-width: 768px) {
  :root {
    --section-gap: 50px;
  }

  html {
    scroll-padding-top: 104px;
  }

  section {
    scroll-margin-top: 108px;
  }

  .mobile-nav {
    padding: 10px 14px 9px;
    gap: 8px;
  }

  .mobile-nav-name {
    font-size: 16px;
  }

  .mobile-nav-links a {
    min-height: 32px;
  }

  .main {
    padding: 32px 24px 90px;
  }
  .page-header {
    padding: 24px 22px 22px;
  }
  .header-topline {
    gap: 10px;
    flex-wrap: wrap;
    align-items: flex-start;
  }
  .header-name {
    font-size: clamp(40px, 7vw, 50px);
  }
  .section-title {
    font-size: clamp(23px, 4.2vw, 27px);
    white-space: normal;
  }
  .pub-filter {
    padding: 6px 10px;
  }
  .pub-toolbar {
    gap: 10px;
    flex-wrap: wrap;
    overflow: visible;
    align-items: flex-start;
  }
  .pub-filters {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 2px;
  }
  .pub-toolbar-meta {
    width: 100%;
    margin-left: 0;
    padding-left: 0;
  }
  .pub-summary {
    white-space: normal;
    max-width: 38rem;
  }
}

/* Phone landscape / large phone (≤640px) */
@media (max-width: 640px) {
  :root {
    --section-gap: 46px;
  }

  html {
    scroll-padding-top: 156px;
  }

  section {
    scroll-margin-top: 156px;
  }

  .main {
    padding: 24px 16px 72px;
  }
  .page-header {
    padding: 20px 18px 18px;
  }
  .section-header {
    gap: 12px;
    margin-bottom: 20px;
  }
  .header-name {
    font-size: clamp(34px, 10vw, 42px);
  }
  .header-subtitle {
    font-size: 10px;
    letter-spacing: 0.1em;
  }
  .header-links {
    gap: 5px;
  }
  .header-link {
    max-width: 100%;
    white-space: normal;
  }
  .header-download,
  .header-link {
    font-size: 11px;
  }
  .section-title {
    font-size: clamp(22px, 6.2vw, 25px);
  }

  /* Education: stack period below degree in single column */
  .edu-item {
    grid-template-columns: 1fr;
  }
  .edu-period {
    grid-column: 1;
    text-align: left;
    margin-top: 2px;
  }

  /* Teaching: keep vertical marker on left, move period below content */
  .teach-item {
    grid-template-columns: auto 1fr;
  }
  .teach-marker {
    grid-row: 1 / span 2;
  }
  .teach-period {
    grid-column: 2;
    grid-row: 2;
    margin-top: 6px;
  }

  /* Reviewer: single column on phones */
  .reviewer-grid {
    grid-template-columns: 1fr;
  }

  /* Publications */
  .pub-toolbar {
    gap: 10px;
  }
  .pub-top {
    flex-direction: column;
    gap: 6px;
  }
  .pub-item {
    padding: 16px 4px;
  }
  .mobile-nav {
    padding: 10px 14px 10px;
    gap: 8px;
  }
  .mobile-nav-top {
    gap: 10px;
  }
  .mobile-nav-links {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    overflow: visible;
    scroll-snap-type: none;
    padding: 6px;
    border-radius: 20px;
  }
  .mobile-nav-links a {
    justify-content: center;
    min-height: 34px;
    padding: 8px 7px;
    text-align: center;
    white-space: normal;
    line-height: 1.2;
    letter-spacing: 0.03em;
  }
}

/* Phone portrait (≤480px) */
@media (max-width: 480px) {
  :root {
    --section-gap: 40px;
  }

  html {
    scroll-padding-top: 152px;
  }

  section {
    scroll-margin-top: 152px;
  }

  .main {
    padding: 20px 14px 60px;
  }
  .page-header {
    padding: 18px 16px 16px;
    border-radius: 14px;
  }
  .header-name {
    font-size: 34px;
  }
  .section-title {
    font-size: 23px;
  }
  .header-topline {
    gap: 10px;
  }
  .section-line {
    opacity: 0.58;
  }
  .header-download,
  .header-link {
    padding: 5px 9px;
    font-size: 10.5px;
  }
  .header-download {
    gap: 6px;
    padding: 4px 9px;
  }

  /* Honor: year wraps below text instead of squishing it */
  .honor-item {
    grid-template-columns: 20px 1fr;
  }
  .honor-year {
    grid-column: 2;
    grid-row: 2;
  }

  /* Service: stack year below role */
  .service-item {
    grid-template-columns: 1fr;
  }
  .service-year {
    grid-column: 1;
    grid-row: auto;
    margin-top: 3px;
  }

  /* Pub filter tabs: tighter */
  .pub-filter {
    padding: 8px 11px;
    font-size: 11.5px;
  }
  .mobile-nav-name {
    font-size: 15px;
  }
  .mobile-nav-top {
    gap: 8px;
  }
  .header-links {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .header-link {
    width: 100%;
    justify-content: flex-start;
    border-radius: 14px;
  }
  .mobile-nav-links a {
    padding: 7px 6px;
    font-size: 10.25px;
    min-height: 33px;
  }
  .theme-toggle-mobile .theme-toggle-text {
    display: none;
  }
  .theme-toggle-mobile {
    padding: 6px 8px;
  }
  .pub-summary {
    font-size: 11px;
    max-width: none;
  }

  /* Talks: tighter */
  .talk-item {
    gap: 0 12px;
    padding: 12px 4px;
  }
  .talk-title {
    font-size: 16px;
  }
}

@media (pointer: coarse) {
  .header-download,
  .header-link,
  .sidebar-download,
  .mobile-nav-links a,
  .pub-filter,
  .theme-toggle {
    min-height: 40px;
  }
}

/* Very small phones (≤375px) */
@media (max-width: 375px) {
  html {
    scroll-padding-top: 148px;
  }

  section {
    scroll-margin-top: 148px;
  }

  .main {
    padding: 16px 12px 56px;
  }
  .page-header {
    padding: 16px 14px 14px;
  }
  .header-name {
    font-size: 30px;
    line-height: 0.95;
  }
  .mobile-nav {
    padding: 8px 12px 9px;
  }
  .mobile-nav-name {
    font-size: 14px;
  }
  .pub-count {
    display: none;
  }
  .filter-dot {
    display: none;
  }
  .pub-summary {
    white-space: normal;
  }
  .header-subtitle {
    letter-spacing: 0.08em;
  }
}

@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;
    scroll-behavior: auto !important;
  }

  section {
    opacity: 1;
    transform: none;
    transition-delay: 0s !important;
  }
}

@media (prefers-contrast: more) {
  :root {
    --interaction-border: color-mix(
      in srgb,
      var(--text-primary) 24%,
      var(--border-light)
    );
    --focus-ring-outer: color-mix(in srgb, var(--accent-strong) 68%, white 32%);
  }

  .header-link,
  .header-download,
  .contact-pill,
  .sidebar-download,
  .nav-item,
  .pub-filter,
  .pub-link,
  .theme-toggle,
  .mobile-nav-links a,
  .contact-item,
  .page-header,
  .pub-context-note {
    border-color: color-mix(
      in srgb,
      var(--text-primary) 22%,
      var(--border-light)
    );
  }

  .section-line {
    background: linear-gradient(
      90deg,
      color-mix(in srgb, var(--text-primary) 20%, var(--border-light)) 0%,
      transparent 78%
    );
  }
}

@media (forced-colors: active) {
  body::before,
  body::after,
  .sidebar::before,
  .sidebar::after,
  .page-header::before,
  .page-header::after,
  .section-line {
    display: none;
  }

  .page-header,
  .pub-context-note,
  .theme-toggle,
  .header-link,
  .header-download,
  .contact-pill,
  .sidebar-download,
  .nav-item,
  .pub-filter,
  .pub-link,
  .mobile-nav-links a,
  .contact-item {
    forced-color-adjust: auto;
    border: 1px solid CanvasText;
    box-shadow: none !important;
  }
}

/* ── THEME TRANSITION ────────────────────────── */
.theme-transitioning *,
.theme-transitioning *::before,
.theme-transitioning *::after {
  transition:
    background-color 0.3s ease,
    color 0.3s ease,
    border-color 0.3s ease,
    box-shadow 0.3s ease !important;
}

/* ── PRINT ──────────────────────────────────── */
@media print {
  :root,
  :root[data-theme="dark"] {
    --main-bg: #fff;
    --surface: #fff;
    --surface-strong: #fff;
    --surface-muted: #f9fafc;
    --text-primary: #0f172a;
    --text-secondary: #334155;
    --text-muted: #516070;
    --border: #dde3ed;
    --border-light: #eef1f8;
  }

  .sidebar,
  .mobile-nav {
    display: none;
  }

  body::before,
  body::after,
  .page-header::before,
  .page-header::after {
    display: none;
  }

  .main {
    margin-left: 0;
    padding: 24px;
  }

  .page-header {
    box-shadow: none;
  }

  section {
    opacity: 1 !important;
    transform: none !important;
  }

  #reading-progress,
  #scrollToTopBtn {
    display: none;
  }
}

/* ── PUB LIST FILTER FADE ────────────────────── */
.pub-list {
  transition: opacity 0.14s ease;
}

.pub-list.filtering {
  opacity: 0;
  pointer-events: none;
}

/* ── ITEM STAGGER ENTRANCE ANIMATIONS ───────── */
/*
  Static list items start invisible and slide up into view.
  JS adds .item-visible (with per-item transition-delay) when the
  parent section enters the viewport.
  Scoped to motion-OK users only.
*/
@media not (prefers-reduced-motion: reduce) {
  .edu-item,
  .teach-item,
  .honor-item,
  .service-item,
  .talk-item,
  .reviewer-item {
    opacity: 0;
    transform: translateY(8px);
  }
}

.item-visible {
  opacity: 1 !important;
  transform: none !important;
}

/* ── ITEM TRANSITION: include opacity for stagger ── */
.edu-item,
.pub-item,
.teach-item,
.honor-item,
.service-item,
.reviewer-item,
.talk-item {
  transition:
    opacity 0.42s cubic-bezier(0.2, 0.7, 0.2, 1),
    transform 0.42s cubic-bezier(0.2, 0.7, 0.2, 1),
    background-color var(--t),
    box-shadow var(--t);
}

/* ── CONTACT ICON HOVER POLISH ───────────────── */
.contact-item:hover svg {
  opacity: 0.9;
  transition: opacity var(--t);
}

.contact-pill svg {
  transition: opacity var(--t);
}

.contact-pill:hover svg {
  opacity: 1;
}

/* ── SIDEBAR NAV ACTIVE DOT PULSE ────────────── */
.nav-item.active .nav-dot,
.nav-item[aria-current="location"] .nav-dot {
  animation: dot-settle 0.55s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

@keyframes dot-settle {
  0%   { box-shadow: 0 0 0 0   rgba(206, 176, 124, 0);    transform: scale(0.6); }
  60%  { box-shadow: 0 0 0 5px rgba(206, 176, 124, 0.18); transform: scale(1.15); }
  100% { box-shadow: 0 0 0 3px rgba(206, 176, 124, 0.1);  transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .nav-item.active .nav-dot,
  .nav-item[aria-current="location"] .nav-dot {
    animation: none;
  }
}

/* ── SECTION HEADER REFINED ──────────────────── */
/* Subtle color warmth on section title accent bar transition */
.section-title::before {
  transition: opacity 0.28s ease;
}

/* ── PUB FILTER SMOOTH ACTIVE TRANSITION ─────── */
.pub-filter {
  transition:
    color var(--t),
    border-color var(--t),
    background-color var(--t),
    box-shadow var(--t),
    transform 0.18s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.pub-filter.active {
  transform: scale(1.01);
}

/* ── TALK YEAR VERTICAL ALIGNMENT REFINEMENT ─── */
.talk-year {
  min-width: 36px;
}
