/* cecetaca.com — site stylesheet
   Subtle academic. Lilac on accents, restrained glass on nav + hero pills + featured plate.
*/
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-body);
  color: var(--fg);
  background: var(--bg);
}
img { max-width: 100%; display: block; }

/* ================= Layout primitives ================= */
.container { max-width: 1280px; margin: 0 auto; padding: 0 24px; }
.container-narrow { max-width: 820px; margin: 0 auto; padding: 0 24px; }

.section { padding: 80px 0; }
.section + .section { border-top: 1px solid var(--border); }

/* When the nav scrolls to a section, leave clearance for the sticky
   top nav (56px pill + 12px top margin + breathing room). Anchors land
   below the nav instead of underneath it.
   The section itself has 56px of vertical padding (in compact density),
   so the heading is always ~56px below the section's top. We tune the
   scroll-margin so the heading lands ~16-20px below the nav pill, not
   the section box itself. */
[data-nav-section] { scroll-margin-top: 92px; }
@media (max-width: 1024px) {
  /* Phones (portrait + landscape), small tablets, and iPad mini portrait:
     leave a comfortable buffer below the nav so the section heading
     doesn't crowd the pill. Section has 56px of internal padding-top
     in compact density, so scroll-margin-top of 60 lands the heading
     ~116px from viewport top — ~48px below the nav. */
  [data-nav-section] { scroll-margin-top: 120px; }
}
.section.alt { background: var(--bg-alt); }

.eyebrow {
  font-family: var(--font-display);
  font-size: 12px; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--fg-muted); margin: 0 0 16px;
}
h1, h2, h3, h4 { font-family: var(--font-display); }
h1.section-title { font-size: 32px; letter-spacing: -0.01em; margin: 0 0 8px; font-weight: 700; }
h2.section-title { font-size: 22px; margin: 0 0 8px; font-weight: 700; }
.section-sub { color: var(--fg-muted); font-size: 15px; margin: 0 0 32px; max-width: 620px; }

/* ================= Top nav (Liquid Glass pill) ================= */
.topnav {
  position: sticky; top: 12px; z-index: 50;
  margin: 12px auto 0; max-width: 1240px; padding: 0 16px;
}
.topnav-inner {
  display: flex; align-items: center; gap: 8px;
  height: 56px; padding: 0 8px 0 18px;
  border-radius: var(--radius-pill);
  background: rgba(255,255,255,0.62);
  -webkit-backdrop-filter: blur(22px) saturate(190%);
          backdrop-filter: blur(22px) saturate(190%);
  border: 0.5px solid rgba(255,255,255,0.9);
  box-shadow:
    0 1px 0 rgba(255,255,255,0.6) inset,
    0 0 0 0.5px rgba(60,60,67,0.14),
    0 12px 32px -10px rgba(20,8,40,0.18);
  position: relative;
  overflow: hidden;
  isolation: isolate;
  transition:
    background 360ms var(--ease),
    box-shadow 360ms var(--ease),
    border-color 360ms var(--ease),
    transform 360ms var(--ease-out);
  --mx: 50%; --my: -30%;
}
.topnav-inner.liquid-glass::after {
  /* refractive sheen — a soft rim that intensifies on hover */
  content: "";
  position: absolute; inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.55) 0%, rgba(255,255,255,0) 35%),
    linear-gradient(0deg,   rgba(255,255,255,0.18) 0%, rgba(255,255,255,0) 30%);
  mix-blend-mode: overlay;
  opacity: 0.7;
  transition: opacity 360ms var(--ease);
  z-index: 0;
}
.topnav-inner .lg-specular {
  position: absolute; inset: -20%;
  pointer-events: none;
  background: radial-gradient(
    260px 180px at var(--mx, 50%) var(--my, -30%),
    rgba(140,92,255,0.28) 0%,
    rgba(191,160,255,0.18) 30%,
    rgba(255,255,255,0.0) 70%
  );
  opacity: 0;
  transition: opacity 320ms var(--ease);
  z-index: 0;
  filter: blur(2px);
}
.topnav-inner:hover .lg-specular { opacity: 1; }
.topnav-inner:hover {
  background: rgba(255,255,255,0.78);
  border-color: rgba(255,255,255,1);
  box-shadow:
    0 1px 0 rgba(255,255,255,0.7) inset,
    0 0 0 0.5px rgba(140,92,255,0.22),
    0 18px 44px -12px rgba(91,46,201,0.28),
    0 0 60px -12px rgba(140,92,255,0.18);
}
.topnav-inner:hover::after { opacity: 1; }
.topnav-inner > * { position: relative; z-index: 1; }
.topnav-brand {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-display);
  font-weight: 700; font-size: 15px;
  color: var(--fg); letter-spacing: -0.005em;
  text-decoration: none;
}
.topnav-brand:hover { text-decoration: none; color: var(--fg); }
.topnav-brand-mark {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--lilac-50);
  border: 0.5px solid rgba(140,92,255,0.18);
  flex: none; object-fit: cover; object-position: center top;
  display: block;
}
.topnav-brand small { color: var(--fg-muted); font-weight: 500; font-family: var(--font-body); }
.topnav-spacer { flex: 1; }
.topnav-links { display: flex; gap: 2px; align-items: center; }
.topnav-link {
  position: relative;
  font-family: var(--font-body); font-size: 14px; font-weight: 500; color: var(--fg);
  padding: 8px 14px; border-radius: var(--radius-pill); text-decoration: none;
  cursor: pointer;
  overflow: hidden;
  isolation: isolate;
  transition:
    color 220ms var(--ease),
    transform 320ms var(--ease-out),
    box-shadow 320ms var(--ease);
}
.topnav-link .topnav-link-label { position: relative; z-index: 2; }
.topnav-link .topnav-link-shine {
  position: absolute; inset: 0;
  border-radius: inherit;
  background:
    radial-gradient(120% 200% at 50% -40%, rgba(255,255,255,0.85) 0%, rgba(255,255,255,0.0) 60%),
    linear-gradient(180deg, rgba(140,92,255,0.18), rgba(140,92,255,0.06));
  opacity: 0;
  transform: scale(0.7);
  transition: opacity 280ms var(--ease), transform 380ms var(--ease-out);
  z-index: 1;
  pointer-events: none;
  box-shadow:
    inset 0 0.5px 0 rgba(255,255,255,0.85),
    inset 0 -0.5px 0 rgba(140,92,255,0.18),
    0 4px 14px -4px rgba(140,92,255,0.45);
  -webkit-backdrop-filter: blur(8px) saturate(180%);
          backdrop-filter: blur(8px) saturate(180%);
}
.topnav-link:hover { color: var(--brand); text-decoration: none; transform: translateY(-1px); }
.topnav-link:hover .topnav-link-shine { opacity: 1; transform: scale(1); }
.topnav-link:active { transform: translateY(0); }
.topnav-link.active { color: white; }
.topnav-link.active .topnav-link-shine {
  opacity: 1; transform: scale(1);
  background: linear-gradient(180deg, var(--lilac-500), var(--lilac-700));
  box-shadow:
    inset 0 0.5px 0 rgba(255,255,255,0.45),
    inset 0 -0.5px 0 rgba(20,8,40,0.20),
    0 6px 18px -4px rgba(140,92,255,0.55);
  -webkit-backdrop-filter: none; backdrop-filter: none;
}
.topnav-link.active:hover { color: white; }
.topnav-tools { display: flex; gap: 4px; align-items: center; padding-left: 4px; border-left: 0.5px solid rgba(60,60,67,0.18); margin-left: 4px; }
.topnav-icon {
  position: relative;
  width: 36px; height: 36px; border-radius: 50%;
  flex: none;
  display: grid; place-items: center; color: var(--fg-muted);
  background: transparent; border: 0; cursor: pointer; font-size: 14px;
  transition: background 220ms var(--ease), color 220ms var(--ease), transform 320ms var(--ease-out), box-shadow 320ms var(--ease);
  overflow: hidden;
}
.topnav-icon::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  background: radial-gradient(80% 100% at 50% 0%, rgba(255,255,255,0.9), rgba(255,255,255,0) 70%),
              linear-gradient(180deg, rgba(140,92,255,0.20), rgba(140,92,255,0.05));
  opacity: 0; transform: scale(0.6);
  transition: opacity 260ms var(--ease), transform 360ms var(--ease-out);
}
.topnav-icon i { position: relative; z-index: 1; transition: transform 320ms var(--ease-out); }
.topnav-icon:hover { color: var(--brand); transform: translateY(-1px); box-shadow: 0 6px 16px -6px rgba(140,92,255,0.45); }
.topnav-icon:hover::before { opacity: 1; transform: scale(1); }
.topnav-icon:hover i { transform: scale(1.06); }

/* Theme menu */
.topnav-theme { position: relative; }
.theme-menu {
  position: absolute; right: 0; top: calc(100% + 10px);
  min-width: 200px;
  background: rgba(255,255,255,0.78);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
          backdrop-filter: blur(28px) saturate(180%);
  border: 0.5px solid rgba(255,255,255,0.9);
  border-radius: 14px;
  box-shadow:
    0 1px 0 rgba(255,255,255,0.6) inset,
    0 0 0 0.5px rgba(60,60,67,0.14),
    0 16px 40px -10px rgba(20,8,40,0.28);
  padding: 6px;
  z-index: 60;
  animation: themeMenuIn 180ms var(--ease-out);
  transform-origin: top right;
}
@keyframes themeMenuIn {
  from { opacity: 0; transform: translateY(-6px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0)    scale(1); }
}
.theme-menu-label {
  font-family: var(--font-display);
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.10em; text-transform: uppercase;
  color: var(--fg-muted); padding: 8px 10px 6px;
}
.theme-menu-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%; text-align: left;
  font-family: var(--font-body); font-size: 13.5px; color: var(--fg);
  padding: 8px 10px; border-radius: 9px;
  background: transparent; border: 0; cursor: pointer;
  transition: background 140ms var(--ease), color 140ms var(--ease);
}
.theme-menu-item i:first-child { width: 16px; color: var(--fg-muted); font-size: 13px; }
.theme-menu-item:hover { background: rgba(140,92,255,0.10); color: var(--brand); }
.theme-menu-item:hover i:first-child { color: var(--brand); }
.theme-menu-item.on { color: var(--brand); }
.theme-menu-item.on i:first-child { color: var(--brand); }
.theme-menu-check { margin-left: auto; font-size: 11px; }
.topnav-cta {
  position: relative;
  font-family: var(--font-body); font-size: 13px; font-weight: 600;
  background: linear-gradient(180deg, var(--lilac-500), var(--lilac-700));
  color: white; border: 0;
  padding: 8px 14px; border-radius: var(--radius-pill);
  cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; gap: 6px;
  box-shadow:
    inset 0 0.5px 0 rgba(255,255,255,0.45),
    inset 0 -0.5px 0 rgba(20,8,40,0.20),
    0 6px 18px -4px rgba(140,92,255,0.45);
  overflow: hidden;
  transition: transform 320ms var(--ease-out), box-shadow 320ms var(--ease);
}
.topnav-cta::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  background: linear-gradient(180deg, rgba(255,255,255,0.45), rgba(255,255,255,0) 60%);
  opacity: 0.7; pointer-events: none;
  transition: opacity 320ms var(--ease);
}
.topnav-cta:hover { color: white; text-decoration: none; transform: translateY(-1px); box-shadow: inset 0 0.5px 0 rgba(255,255,255,0.55), inset 0 -0.5px 0 rgba(20,8,40,0.25), 0 12px 28px -6px rgba(140,92,255,0.65); }
.topnav-cta:hover::before { opacity: 1; }
.topnav-cta:active { transform: translateY(0); }

/* Hamburger (mobile only) */
.topnav-burger {
  display: none;
  align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 50%;
  flex: none;
  background: transparent; border: 0; cursor: pointer;
  margin-left: 4px;
  flex-direction: column; gap: 4px;
  position: relative;
  transition: background 200ms var(--ease);
}
.topnav-burger:hover { background: rgba(140,92,255,0.10); }
.topnav-burger span {
  width: 18px; height: 1.5px; border-radius: 2px;
  background: var(--fg);
  transition: transform 240ms var(--ease), opacity 200ms var(--ease);
}
.topnav-burger.open span:nth-child(1) { transform: translateY(5.5px) rotate(45deg); }
.topnav-burger.open span:nth-child(2) { opacity: 0; }
.topnav-burger.open span:nth-child(3) { transform: translateY(-5.5px) rotate(-45deg); }

.topnav-mobile-sheet {
  display: none;
  margin: 8px 16px 0;
  padding: 8px;
  background: rgba(255,255,255,0.92);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
          backdrop-filter: blur(28px) saturate(180%);
  border: 0.5px solid rgba(255,255,255,0.95);
  border-radius: 16px;
  box-shadow:
    0 1px 0 rgba(255,255,255,0.6) inset,
    0 0 0 0.5px rgba(60,60,67,0.14),
    0 16px 40px -10px rgba(20,8,40,0.28);
  animation: themeMenuIn 200ms var(--ease-out);
  flex-direction: column; gap: 2px;
}
.topnav-mobile-link {
  font-family: var(--font-body); font-size: 15px; font-weight: 500;
  color: var(--fg);
  padding: 12px 14px; border-radius: 10px;
  text-decoration: none;
  transition: background 140ms var(--ease), color 140ms var(--ease);
}
.topnav-mobile-link:hover { background: rgba(140,92,255,0.08); color: var(--brand); text-decoration: none; }
.topnav-mobile-link.active { background: rgba(140,92,255,0.14); color: var(--brand); font-weight: 600; }
.topnav-mobile-link.cta {
  margin-top: 4px;
  background: linear-gradient(180deg, var(--lilac-500), var(--lilac-700));
  color: white;
  text-align: left;
  display: inline-flex; align-items: center; gap: 8px;
  box-shadow: 0 6px 18px -4px rgba(140,92,255,0.45);
}
.topnav-mobile-link.cta:hover { color: white; background: linear-gradient(180deg, var(--lilac-500), var(--lilac-700)); filter: brightness(1.05); }

@media (max-width: 720px) {
  .topnav-mobile-sheet { display: flex; }
  /* Search button collapses into the hamburger sheet on mobile. */
  .topnav-search { display: none; }
}

/* Books on the home page — make the row clickable with a subtle
   hover lift and a brand-tinted title. */
.home-book-row { transition: transform 200ms var(--ease-out); }
.home-book-row:hover { text-decoration: none; transform: translateY(-1px); }
.home-book-row:hover .home-book-title { color: var(--brand); }

/* Disqus comments section on detail pages. */
.disqus-section {
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}
.disqus-section h3.pub-detail-h3 { margin-top: 0; margin-bottom: 16px; }
:root[data-theme="dark"] .disqus-section { border-top-color: var(--border); }

/* Real book cover images (when featured.jpg is present in the book dir).
   Let each cover keep its natural aspect ratio so nothing gets cropped. */
.book-cover-image {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
  background: transparent;
  box-shadow: 0 8px 22px -10px rgba(20, 8, 40, 0.35);
}
.book-detail-cover-image {
  display: block;
  width: 140px;
  height: auto;
  border-radius: 10px;
  box-shadow: 0 10px 28px -10px rgba(20, 8, 40, 0.45);
}

/* Clickable book card on the books listing — hover lift, no underline. */
.book.book-clickable {
  text-decoration: none;
  color: inherit;
  transition: transform 200ms var(--ease-out), box-shadow 200ms var(--ease);
}
.book.book-clickable:hover {
  text-decoration: none;
  color: inherit;
  transform: translateY(-2px);
}
.book.book-clickable:hover .book-info h3 { color: var(--brand); }

/* Book detail page header — small cover beside the title block. */
.book-detail-head {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 28px;
  align-items: start;
  margin: 8px 0 0;
}
.book-detail-cover {
  aspect-ratio: 2/3;
  border-radius: 10px;
  padding: 12px;
  display: flex; flex-direction: column;
  justify-content: space-between;
  color: white;
  font-family: var(--font-display);
  box-shadow: 0 10px 28px -10px rgba(20, 8, 40, 0.45);
}
.book-detail-cover .pub { font-size: 8.5px; letter-spacing: 0.16em; font-weight: 600; opacity: 0.75; text-transform: uppercase; }
.book-detail-cover .ttl { font-size: 13.5px; font-weight: 700; line-height: 1.15; }
.book-detail-cover .by  { font-size: 8.5px; letter-spacing: 0.12em; opacity: 0.85; }
.book-detail-info h1 { margin: 0 0 8px; line-height: 1.15; }
@media (max-width: 540px) {
  .book-detail-head { grid-template-columns: 1fr; gap: 16px; }
  .book-detail-cover { max-width: 140px; }
}

/* Project detail page — headline image banner. */
.proj-detail-image {
  margin: 18px 0 28px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-muted);
  box-shadow:
    0 1px 0 rgba(255,255,255,0.6) inset,
    0 12px 36px -12px rgba(20,8,40,0.18);
}
.proj-detail-image img {
  display: block;
  width: 100%;
  max-height: 380px;
  object-fit: cover;
  object-position: center;
}
:root[data-theme="dark"] .proj-detail-image {
  background: rgba(255,255,255,0.04);
  box-shadow:
    0 1px 0 rgba(255,255,255,0.06) inset,
    0 16px 44px -12px rgba(0,0,0,0.55);
}

/* Publication title links (in mobile cards + desktop list rows). */
.pub-title-link {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 140ms var(--ease), border-color 140ms var(--ease);
}
.pub-title-link:hover {
  color: var(--brand);
  border-bottom-color: var(--brand);
  text-decoration: none;
}

/* ================= Publication detail page ================= */
.pub-detail-title {
  font: 700 30px var(--font-display);
  letter-spacing: -0.01em;
  margin: 8px 0 12px;
  line-height: 1.2;
}
.pub-detail-authors {
  font: 400 15px var(--font-body);
  color: var(--fg);
  margin: 0 0 18px;
  line-height: 1.55;
}
.pub-detail-authors b { font-weight: 700; color: var(--brand); }
.pub-detail-meta {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px 24px;
  padding: 16px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin: 0 0 24px;
}
.pub-detail-meta dt {
  font: 700 10.5px var(--font-display);
  letter-spacing: 0.10em; text-transform: uppercase;
  color: var(--fg-muted); margin: 0 0 4px;
}
.pub-detail-meta dd { margin: 0; font-size: 14px; color: var(--fg); }
.pub-detail-actions {
  display: flex; gap: 8px; flex-wrap: wrap;
  margin: 0 0 32px;
}
.pub-detail-h3 {
  font: 700 11.5px var(--font-display);
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--fg-muted);
  margin: 28px 0 10px;
}
.pub-detail-abstract {
  font: 400 15.5px var(--font-body);
  line-height: 1.65;
  color: var(--fg);
  margin: 0 0 16px;
  text-wrap: pretty;
}

/* ================= Search modal (Cmd+K, search button) ================= */
.search-backdrop {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(20, 8, 40, 0.45);
  -webkit-backdrop-filter: blur(8px);
          backdrop-filter: blur(8px);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 96px 16px 16px;
  animation: themeMenuIn 160ms var(--ease-out);
}
.search-modal {
  width: 100%; max-width: 640px;
  background: rgba(255,255,255,0.96);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
          backdrop-filter: blur(28px) saturate(180%);
  border: 0.5px solid rgba(255,255,255,0.95);
  border-radius: 16px;
  box-shadow:
    0 1px 0 rgba(255,255,255,0.6) inset,
    0 0 0 0.5px rgba(60,60,67,0.14),
    0 24px 60px -12px rgba(20,8,40,0.40);
  overflow: hidden;
  display: flex; flex-direction: column;
  max-height: calc(100vh - 112px);
}
.search-input-row {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  border-bottom: 0.5px solid rgba(60,60,67,0.18);
}
.search-input-row > i { color: var(--fg-muted); font-size: 14px; }
.search-input-row input {
  flex: 1;
  background: transparent; border: 0; outline: none;
  font: 400 16px var(--font-body); color: var(--fg);
}
.search-kbd {
  font: 500 11px var(--font-mono); color: var(--fg-muted);
  background: rgba(60,60,67,0.08);
  padding: 3px 6px; border-radius: 4px;
  border: 0.5px solid rgba(60,60,67,0.14);
}
.search-results {
  overflow-y: auto;
  padding: 6px;
}
.search-hint {
  padding: 24px 16px;
  text-align: center;
  color: var(--fg-muted);
  font-size: 14px;
}
.search-result {
  display: flex; align-items: flex-start; gap: 12px;
  width: 100%; padding: 12px 14px;
  background: transparent; border: 0; cursor: pointer;
  text-align: left;
  border-radius: 10px;
  transition: background 100ms var(--ease);
}
.search-result.sel,
.search-result:hover { background: rgba(140,92,255,0.10); }
.search-result-type {
  font: 700 10px/1 var(--font-display);
  letter-spacing: 0.10em; text-transform: uppercase;
  color: var(--fg-muted);
  background: rgba(60,60,67,0.08);
  padding: 4px 8px; border-radius: 999px;
  flex: none; margin-top: 2px;
  min-width: 64px; text-align: center;
}
.search-result-type.t-publication { color: var(--brand); background: rgba(140,92,255,0.12); }
.search-result-type.t-project     { color: var(--info); background: rgba(30,42,120,0.10); }
.search-result-type.t-book        { color: #7C5BC9; background: rgba(191,160,255,0.18); }
.search-result-type.t-page        { color: var(--fg-muted); }
.search-result-body { min-width: 0; flex: 1; }
.search-result-title {
  font: 600 14.5px var(--font-display); color: var(--fg);
  margin-bottom: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.search-result-meta {
  font-size: 12.5px; color: var(--fg-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
:root[data-theme="dark"] .search-modal {
  background: rgba(27,20,50,0.92);
  border-color: rgba(255,255,255,0.10);
}
:root[data-theme="dark"] .search-input-row { border-bottom-color: rgba(255,255,255,0.10); }
:root[data-theme="dark"] .search-input-row input { color: var(--fg); }
:root[data-theme="dark"] .search-kbd { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.10); color: var(--fg-muted); }
:root[data-theme="dark"] .search-result.sel,
:root[data-theme="dark"] .search-result:hover { background: rgba(191,160,255,0.14); }
:root[data-theme="dark"] .search-result-title { color: var(--fg); }
:root[data-theme="dark"] .search-result-type { background: rgba(255,255,255,0.06); }
@media (max-width: 480px) {
  .search-backdrop { padding: 64px 8px 8px; }
  .search-result-meta { white-space: normal; }
  .search-result-title { white-space: normal; }
}

/* Search row inside the mobile sheet — same shape as a nav link, with
   a leading magnifier icon. Reset native button styling. */
.topnav-mobile-search {
  background: transparent; border: 0; cursor: pointer;
  font: inherit; text-align: left;
  display: inline-flex; align-items: center; gap: 10px;
  width: 100%;
}
.topnav-mobile-search i { width: 16px; color: var(--fg-muted); font-size: 14px; }
.topnav-mobile-search:hover i { color: var(--brand); }

/* Hero meta row (affiliation + location, separate from name row) */
.hero-unified-meta-row {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  margin: -2px 0 4px;
}

/* Three-line affiliation block sitting below the name */
.hero-unified-affiliation {
  display: flex; flex-direction: column;
  margin: 6px 0 10px;
  line-height: 1.4;
}
.hero-affiliation-line {
  font-size: 19px; color: var(--fg-muted);
}
.hero-affiliation-line:first-child {
  font-weight: 600; color: var(--fg); font-size: 20px;
}

/* ================= Buttons ================= */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-body); font-size: 14px; font-weight: 600;
  padding: 10px 18px; border-radius: var(--radius-pill);
  border: 0; cursor: pointer; text-decoration: none;
  transition: all 120ms var(--ease); line-height: 1;
}
.btn-sm { font-size: 12.5px; padding: 6px 12px; }
.btn-solid { background: var(--brand); color: white; }
.btn-solid:hover { background: var(--brand-hover); color: white; text-decoration: none; }
.btn-outline { background: white; color: var(--fg); border: 1px solid var(--border); }
.btn-outline:hover { border-color: var(--brand); color: var(--brand); text-decoration: none; }
/* Glass CTA pill — used in hero */
.btn-glass {
  background: rgba(255,255,255,0.72);
  color: var(--fg);
  border: 0.5px solid rgba(255,255,255,0.9);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
          backdrop-filter: blur(20px) saturate(180%);
  box-shadow:
    0 1px 0 rgba(255,255,255,0.6) inset,
    0 0 0 0.5px rgba(60,60,67,0.14),
    0 8px 22px -8px rgba(20,8,40,0.16);
}
.btn-glass:hover { background: rgba(255,255,255,0.95); color: var(--brand); text-decoration: none; }
.btn-glass.btn-glass-primary { background: var(--brand); color: white; border-color: rgba(140,92,255,0.6); box-shadow: 0 8px 22px -6px rgba(140,92,255,0.45); }
.btn-glass.btn-glass-primary:hover { background: var(--brand-hover); color: white; }

/* ================= Hero ================= */
.hero {
  position: relative;
  margin: 24px auto 0;
  max-width: 1240px;
  padding: 0 16px;
}

/* SPLIT hero — default. Portrait/info card on the LEFT, lilac plate with CTAs on the RIGHT. */
.hero-split {
  display: flex;
  border-radius: var(--radius-2xl);
  overflow: hidden;
  border: 1px solid var(--border);
  background: white;
}
.hero-split-left, .hero-split-right { flex: 1 1 50%; min-width: 0; }
.hero-split-left { order: 2; }
.hero-split-right { order: 1; }
.hero-split-left {
  padding: 56px 48px;
  background: linear-gradient(165deg, #FAF7FF 0%, #F4ECFF 70%, #E2D2FF 100%);
  position: relative;
  display: flex; flex-direction: column; justify-content: center;
}
.hero-split-left::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(80% 60% at 90% 100%, rgba(140,92,255,0.18), transparent 70%);
  pointer-events: none;
}
.hero-split-right {
  padding: 56px 48px;
  background: white;
  display: flex; align-items: center; gap: 32px;
}
.hero-portrait {
  width: 180px; height: 180px; border-radius: 50%;
  overflow: hidden; flex: none;
  border: 4px solid white;
  box-shadow: 0 12px 32px -8px rgba(20,8,40,0.20);
}
.hero-portrait img { width: 100%; height: 100%; object-fit: cover; }
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-display); font-size: 11.5px; font-weight: 700;
  letter-spacing: 0.10em; text-transform: uppercase;
  color: var(--brand);
  background: white;
  border: 0.5px solid rgba(140,92,255,0.30);
  padding: 6px 12px; border-radius: var(--radius-pill);
  margin-bottom: 22px;
  box-shadow: 0 4px 12px -4px rgba(20,8,40,0.10);
  position: relative; z-index: 1;
}
.hero-eyebrow .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--success);
  position: relative;
  flex: none;
  margin-right: 2px;
  animation: led-pulse-core 2s ease-in-out infinite;
}
.hero-eyebrow .dot::before {
  content: ""; position: absolute; inset: 0;
  border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(46, 125, 50, 0.45);
  animation: led-pulse-ring 2s ease-out infinite;
  pointer-events: none;
}
@keyframes led-pulse-core {
  0%, 100% { background: var(--success); box-shadow: 0 0 0 3px rgba(46,125,50,0.18); }
  50%      { background: #44A848;        box-shadow: 0 0 0 3px rgba(46,125,50,0.32); }
}
@keyframes led-pulse-ring {
  0%   { box-shadow: 0 0 0 0   rgba(46,125,50,0.55); }
  70%  { box-shadow: 0 0 0 9px rgba(46,125,50,0);    }
  100% { box-shadow: 0 0 0 0   rgba(46,125,50,0);    }
}
@media (prefers-reduced-motion: reduce) {
  .hero-eyebrow .dot,
  .hero-eyebrow .dot::before { animation: none; }
  .hero-eyebrow .dot { box-shadow: 0 0 0 3px rgba(46,125,50,0.18); }
}
.hero h1 {
  font-size: 44px; line-height: 1.05; letter-spacing: -0.02em;
  margin: 0 0 14px; color: var(--fg); font-weight: 700;
  position: relative; z-index: 1;
}
.hero h1 .hl { color: var(--brand); }
.hero .role {
  font-family: var(--font-body);
  font-size: 16.5px; color: var(--fg);
  margin: 0 0 24px; max-width: 460px; line-height: 1.55;
  position: relative; z-index: 1;
}
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; position: relative; z-index: 1; }
.hero-affiliation { font-size: 13px; color: var(--fg-muted); margin: 0 0 6px; font-weight: 500; }
.hero-name-row { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin-bottom: 12px; }
.hero-handle { font-family: var(--font-mono); font-size: 13px; color: var(--brand); padding: 4px 10px; background: white; border-radius: var(--radius-pill); border: 0.5px solid rgba(140,92,255,0.25); }
.hero-meta-row { display: flex; gap: 20px; font-size: 13px; color: var(--fg-muted); margin-top: 18px; }
.hero-meta-row > span { display: flex; align-items: center; gap: 6px; }
.hero-meta-row i { color: var(--brand); }

/* ============== UNIFIED HERO ============== */
.hero-unified {
  margin: 24px auto 0;
  max-width: 1240px;
  padding: 0 16px;
}
.hero-unified-inner {
  display: grid;
  /* Wide left column: portrait + name + affiliation get more room.
     7 social icons still fit easily (need 288px, have 380px). */
  grid-template-columns: 380px 1fr;
  gap: 48px;
  border-radius: var(--radius-2xl);
  border: 1px solid var(--border);
  background:
    radial-gradient(80% 60% at 100% 0%, rgba(140,92,255,0.12), transparent 60%),
    linear-gradient(165deg, #FAF7FF 0%, #FFFFFF 50%, #FFFFFF 100%);
  padding: 48px 56px;
  align-items: start;
}

/* LEFT: identity column */
.hero-unified-identity {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}
.hero-unified-portrait {
  width: 300px;
  aspect-ratio: 1;
  border-radius: var(--radius-2xl);
  overflow: hidden;
  border: 4px solid white;
  box-shadow: 0 24px 60px -12px rgba(20,8,40,0.25), 0 0 0 1px rgba(140,92,255,0.10);
  position: relative;
}
.hero-unified-portrait img {
  width: 100%; height: 100%; object-fit: cover;
}
.hero-unified-identity .hero-eyebrow { align-self: flex-start; margin: 4px 0 0; }
.hero-eyebrow-wide {
  display: flex; width: 100%;
  justify-content: flex-start;
  padding: 10px 18px;
  font-size: 12px;
  letter-spacing: 0.14em;
  border-radius: 999px;
  margin: 0 0 6px;
}
.hero-meta-inline {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 19px;
  color: var(--fg-muted);
  font-family: var(--font-body);
}
.hero-meta-inline i { color: var(--brand); font-size: 17px; }
.hero-unified-name-row {
  display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin: 0;
}
.hero-unified-name {
  font-family: var(--font-display);
  font-size: 34px; font-weight: 700;
  letter-spacing: -0.015em;
  margin: 0; color: var(--fg);
}
.hero-identity-socials {
  margin-top: 6px;
  gap: 6px;
}

/* "Research" + "Education" combined section — two equally-weighted
   columns sharing the same heading hierarchy. Education on the left
   with its compact timeline, focus cards stacked on the right. */
.research-edu-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: stretch;
  padding: 0 48px;
}
.research-edu-col {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.research-edu-col .section-title { text-align: left; margin: 0 0 6px; }
.research-edu-col .section-sub   { text-align: left; margin: 0 0 24px; max-width: none; }
.research-edu-col .eyebrow       { margin-bottom: 10px; }
.edu-list-compact li { padding: 10px 0; }
/* Right column's focus-card stack should fill the column height so
   we don't get an awkward empty patch below the last card when the
   Education timeline on the left is taller. */
.focus-grid.focus-grid-stack {
  display: flex; flex-direction: column; gap: 18px;
  grid-template-columns: none;
  flex: 1;
}
.focus-grid.focus-grid-stack .focus-card { flex: 1; }
@media (max-width: 880px) {
  .research-edu-grid { grid-template-columns: 1fr; gap: 40px; padding: 0; }
  .focus-grid.focus-grid-stack { flex: none; }
  .focus-grid.focus-grid-stack .focus-card { flex: none; }
}

/* RIGHT: pitch column */
.hero-unified-content {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
  padding-top: 0;
}
.hero-unified-h1 {
  font-size: 40px; line-height: 1.08; letter-spacing: -0.02em;
  margin: 0; color: var(--fg); font-weight: 700;
  max-width: 620px;
}
.hero-unified-h1 .hl { color: var(--brand); }
.hero-unified-content .role {
  font-family: var(--font-body);
  font-size: 18px; color: var(--fg);
  margin: 0; max-width: 620px; line-height: 1.6;
}
.hero-unified-content .hero-actions {
  margin-top: 6px;
  gap: 10px;
  flex-wrap: wrap;
}

/* Hero stacks to single column at a wider breakpoint than the rest of
   the site, because its two-column layout needs ~900px of horizontal
   room (380px identity column + 48px gap + ~360px content + 112px
   padding). Below that, the two columns get cramped and the bio text
   wraps to too-narrow lines. Above 960px we have the desktop hero;
   below, it stacks and centers. */
@media (max-width: 960px) {
  .hero-unified-inner { grid-template-columns: 1fr; padding: 36px 32px; gap: 32px; text-align: center; }
  .hero-unified-identity { align-items: center; }
  .hero-unified-content { align-items: center; }
  .hero-unified-portrait { width: 240px; aspect-ratio: 1; margin: 0 auto; }
  .hero-unified-name-row { justify-content: center; flex-wrap: wrap; }
  .hero-unified-affiliation { align-items: center; text-align: center; }
  .hero-unified-meta-row { justify-content: center; }
  .hero-identity-socials { justify-content: center; }
  .hero-actions { justify-content: center; }
  .hero-eyebrow-wide { align-self: center; justify-content: center; margin-left: auto; margin-right: auto; }
  .hero-unified-identity .hero-eyebrow { align-self: center; }
  .hero-unified-h1 { text-align: center; }
  /* The bio paragraph reads better as justified prose than centered. */
  .hero-unified-content .role { text-align: justify; text-justify: inter-word; hyphens: auto; }
}

@media (max-width: 720px) {
  /* Real phones: tighten padding and shrink the portrait so the stacked
     hero still fits in a 375px-wide viewport without horizontal scroll. */
  .hero-unified-inner { padding: 32px 24px; gap: 28px; }
  .hero-unified-portrait { width: 180px; }
  .hero-unified-h1 { font-size: 30px; }
}

/* CLEAN hero variant */
body[data-hero="clean"] .hero-split { display: block; border: 0; background: transparent; }
body[data-hero="clean"] .hero-split-left { display: none; }
body[data-hero="clean"] .hero-split-right {
  padding: 80px 0;
  background: transparent;
  flex-direction: row;
  gap: 56px;
  align-items: center;
}
body[data-hero="clean"] .hero-portrait { width: 220px; height: 220px; }

/* RADIAL hero variant — stacked, full-bleed lilac */
body[data-hero="radial"] .hero-split { display: block; border: 0; background: var(--lilac-radial); color: white; min-height: 460px; position: relative; }
body[data-hero="radial"] .hero-split-left { padding: 80px 64px 64px; background: transparent; }
body[data-hero="radial"] .hero-split-left::before { background: radial-gradient(60% 50% at 30% 30%, rgba(255,255,255,0.18), transparent 70%); }
body[data-hero="radial"] .hero-split-right { background: transparent; padding: 0 64px 64px; }
body[data-hero="radial"] .hero h1 { color: white; font-size: 52px; }
body[data-hero="radial"] .hero h1 .hl { color: var(--lilac-100); }
body[data-hero="radial"] .hero .role { color: rgba(255,255,255,0.88); }
body[data-hero="radial"] .hero-eyebrow {
  background: rgba(255,255,255,0.14); color: rgba(255,255,255,0.92);
  border-color: rgba(255,255,255,0.32);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
body[data-hero="radial"] .hero-eyebrow .dot { background: #74F2A6; box-shadow: 0 0 0 3px rgba(116,242,166,0.25); }
body[data-hero="radial"] .hero-affiliation { color: rgba(255,255,255,0.75); }
body[data-hero="radial"] .hero-meta-row { color: rgba(255,255,255,0.80); }
body[data-hero="radial"] .hero-meta-row i { color: var(--lilac-100); }
body[data-hero="radial"] .hero-handle { background: rgba(255,255,255,0.14); color: white; border-color: rgba(255,255,255,0.32); }
body[data-hero="radial"] .hero-portrait { border-color: rgba(255,255,255,0.30); box-shadow: 0 24px 60px -10px rgba(20,8,40,0.55); }
body[data-hero="radial"] .btn-glass { background: rgba(255,255,255,0.16); color: white; border-color: rgba(255,255,255,0.32); }
body[data-hero="radial"] .btn-glass:hover { background: rgba(255,255,255,0.28); color: white; }
body[data-hero="radial"] .btn-glass.btn-glass-primary { background: white; color: var(--lilac-900); border-color: white; }
body[data-hero="radial"] .btn-glass.btn-glass-primary:hover { background: var(--lilac-50); color: var(--lilac-900); }

/* ================= Three-column "What I work on" ================= */
.focus-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.focus-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 26px 26px 22px;
  transition: all 200ms var(--ease);
}
.focus-card:hover { border-color: rgba(140,92,255,0.35); box-shadow: var(--shadow-card-hover); transform: translateY(-2px); }
.focus-icon {
  width: 44px; height: 44px;
  border-radius: var(--radius-md);
  background: var(--brand-tint-bg);
  color: var(--brand);
  display: grid; place-items: center;
  font-size: 18px;
  margin-bottom: 18px;
}
.focus-card h3 { font-size: 17px; margin: 0 0 8px; font-weight: 700; }
.focus-card p { font-size: 14px; color: var(--fg); line-height: 1.55; margin: 0 0 14px; }
.focus-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.focus-tags span {
  font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.06em;
  padding: 3px 8px; border-radius: var(--radius-pill);
  background: var(--bg-alt); color: var(--fg-muted);
}

/* ================= Two-column section grid ================= */
.sec-grid { display: grid; grid-template-columns: 4fr 8fr; gap: 56px; }
.sec-heading h1 { margin: 0 0 6px; font-size: 26px; letter-spacing: -0.01em; font-weight: 700; }
.sec-heading p { color: var(--fg-muted); font-size: 14px; margin: 0; }
.sec-heading .sec-actions { margin-top: 18px; }
.sec-actions-after { margin-top: 20px; }

/* ================= Cards (publications, generic) ================= */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 22px 24px;
  transition: box-shadow 200ms var(--ease), border-color 200ms var(--ease);
}
.card + .card { margin-top: 12px; }
.card:hover { border-color: rgba(140,92,255,0.35); box-shadow: var(--shadow-card-hover); }
.card-meta { font-size: 13.5px; color: var(--fg); margin: 0 0 14px; }
.card-meta em { font-style: normal; color: var(--brand); font-weight: 500; }
.card-title { font-size: 16.5px; font-weight: 700; margin: 0 0 6px; font-family: var(--font-display); color: var(--fg); line-height: 1.35; }
.card-authors { font-family: var(--font-mono); font-size: 12px; color: var(--fg-muted); margin: 0 0 8px; }
.card-venue { color: var(--fg-muted); font-size: 13.5px; margin: 0; }
.card-venue em { font-style: normal; color: var(--brand); font-weight: 500; }
.card-actions { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.featured-pub-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.pub-card + .pub-card { margin-top: 12px; }

/* Featured publication "plate" — uses Liquid Glass over a soft lilac wash */
.featured-pub {
  position: relative;
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  margin-bottom: 16px;
  background:
    radial-gradient(120% 100% at 100% 0%, rgba(191,160,255,0.45), rgba(140,92,255,0.10) 40%, rgba(244,236,255,0.0) 70%),
    linear-gradient(180deg, #FAF7FF, #F4ECFF);
  border: 1px solid rgba(140,92,255,0.20);
  overflow: hidden;
}
.featured-pub::before {
  content: ""; position: absolute;
  inset: 8px;
  border-radius: calc(var(--radius-lg) - 8px);
  background: rgba(255,255,255,0.55);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
          backdrop-filter: blur(20px) saturate(180%);
  border: 0.5px solid rgba(255,255,255,0.7);
  box-shadow: 0 1px 0 rgba(255,255,255,0.6) inset, 0 0 0 0.5px rgba(60,60,67,0.10);
  z-index: 0;
}
.featured-pub > * { position: relative; z-index: 1; }
.featured-pub-eyebrow {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.10em; text-transform: uppercase;
  color: var(--brand); margin-bottom: 10px;
}
.featured-pub h3 { font-size: 19px; margin: 0 0 8px; font-family: var(--font-display); line-height: 1.25; }
.featured-pub-authors { font-family: var(--font-mono); font-size: 12px; color: var(--fg-muted); margin: 0 0 10px; }
.featured-pub-meta { font-size: 13.5px; color: var(--fg); margin: 0 0 16px; }
.featured-pub-meta em { font-style: normal; color: var(--brand); font-weight: 500; }

/* ================= Education list ================= */
.edu-list { list-style: none; padding: 0; margin: 0; }
.edu-list li {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 24px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}
.edu-list li:last-child { border-bottom: 0; }
.edu-list .when { font-family: var(--font-mono); font-size: 12.5px; color: var(--fg-muted); padding-top: 3px; }
.edu-list .what { font-family: var(--font-display); font-size: 15px; font-weight: 700; margin: 0 0 2px; }
.edu-list .where { font-size: 13.5px; color: var(--fg-muted); margin: 0; }
.edu-list .where.cornell { color: var(--cornell); font-weight: 500; }

/* ================= Projects ================= */
.proj-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.proj-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: all 200ms var(--ease);
  cursor: pointer;
  display: flex; flex-direction: column;
  text-decoration: none; color: inherit;
}
.proj-card:hover { border-color: rgba(140,92,255,0.40); box-shadow: var(--shadow-card-hover); text-decoration: none; color: inherit; }
.proj-thumb { aspect-ratio: 16/10; background: var(--bg-alt); position: relative; overflow: hidden; }
.proj-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 400ms var(--ease); }
.proj-card:hover .proj-thumb img { transform: scale(1.04); }
.proj-thumb.placeholder { background: linear-gradient(135deg, #5B2EC9 0%, #8C5CFF 60%, #BFA0FF 100%); }
.proj-thumb.placeholder::after {
  content: attr(data-glyph); position: absolute; inset: 0;
  display: grid; place-items: center;
  color: rgba(255,255,255,0.85); font-family: var(--font-display); font-weight: 700;
  font-size: 36px; letter-spacing: 0.05em;
  text-shadow: 0 2px 12px rgba(20,8,40,0.30);
}
.proj-body { padding: 16px 20px 20px; flex: 1; display: flex; flex-direction: column; }
.proj-title { font-size: 15.5px; font-weight: 700; margin: 0 0 4px; font-family: var(--font-display); }
.proj-meta { font-size: 11.5px; color: var(--fg-muted); text-transform: uppercase; letter-spacing: 0.08em; margin: 0 0 8px; font-weight: 600; }
.proj-desc { font-size: 13.5px; color: var(--fg); margin: 0; line-height: 1.5; flex: 1; }

/* ================= Books ================= */
.books-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 32px; }
.book {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 24px;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: all 200ms var(--ease);
}
.book:hover { border-color: rgba(140,92,255,0.35); box-shadow: var(--shadow-card-hover); }
.book-cover {
  aspect-ratio: 2/3;
  border-radius: var(--radius-sm);
  display: flex; flex-direction: column;
  justify-content: space-between;
  padding: 18px;
  color: white;
  font-family: var(--font-display);
  box-shadow: 0 8px 24px -6px rgba(20,8,40,0.25);
  position: relative; overflow: hidden;
}
.book-cover::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(70% 50% at 25% 20%, rgba(255,255,255,0.18), transparent 70%);
  pointer-events: none;
}
.book-cover .pub { font-size: 9.5px; letter-spacing: 0.18em; text-transform: uppercase; opacity: 0.7; font-weight: 600; }
.book-cover .yr  { font-family: var(--font-mono); font-size: 11px; opacity: 0.7; }
.book-cover .ttl { font-size: 17px; font-weight: 700; line-height: 1.15; letter-spacing: -0.01em; margin: 12px 0; }
.book-cover .by  { font-size: 10px; opacity: 0.85; letter-spacing: 0.06em; }
.book-info h3 { font-size: 17px; margin: 0 0 6px; font-weight: 700; line-height: 1.3; }
.book-info .meta { font-size: 12.5px; color: var(--fg-muted); margin: 0 0 10px; font-family: var(--font-mono); }
.book-info p { font-size: 14px; color: var(--fg); line-height: 1.55; margin: 0 0 14px; }

/* ================= Tags / chips ================= */
.tag {
  display: inline-flex; align-items: center;
  font-size: 11.5px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--brand);
  background: var(--brand-tint-bg);
  padding: 3px 8px; border-radius: var(--radius-pill);
}
.tag.muted { color: var(--fg-muted); background: var(--bg-alt); }
.tag.cornell { color: var(--cornell); background: var(--cornell-tint-bg); }

.chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  font-size: 12.5px; font-weight: 500;
  padding: 5px 11px; border-radius: var(--radius-pill);
  background: white; color: var(--fg);
  border: 1px solid var(--border);
}

/* ================= Filters ================= */
.filters { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 24px; }
.filter {
  font-family: var(--font-body); font-size: 13px; font-weight: 500;
  padding: 6px 14px; border-radius: var(--radius-pill);
  background: transparent; color: var(--fg-muted);
  border: 1px solid var(--border);
  cursor: pointer; transition: all 120ms var(--ease);
}
.filter:hover { border-color: var(--brand); color: var(--brand); }
.filter.active { background: var(--brand); color: white; border-color: var(--brand); }

/* ================= Social rail ================= */
.social-rail { display: flex; gap: 6px; flex-wrap: wrap; }
.social-rail a {
  width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center;
  color: var(--fg-muted); background: white;
  border: 1px solid var(--border);
  transition: all 120ms var(--ease); font-size: 14px;
}
.social-rail a:hover { color: var(--brand); border-color: var(--brand); background: var(--brand-tint-bg); text-decoration: none; }

/* ================= Footer ================= */
.site-footer {
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  padding: 48px 0 32px;
  margin-top: 0;
}
.footer-grid {
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px; margin-bottom: 36px;
}
.footer-brand { font-family: var(--font-display); font-weight: 700; font-size: 16px; margin: 0 0 8px; }
.footer-tag { font-size: 13.5px; color: var(--fg-muted); margin: 0 0 16px; max-width: 320px; line-height: 1.55; }
.footer-col h4 { font-family: var(--font-display); font-size: 12px; font-weight: 700; letter-spacing: 0.10em; text-transform: uppercase; color: var(--fg-muted); margin: 0 0 12px; }
.footer-col a { display: block; font-size: 13.5px; color: var(--fg); padding: 4px 0; text-decoration: none; }
.footer-col a:hover { color: var(--brand); }
.footer-bottom {
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px;
  padding-top: 24px; border-top: 1px solid var(--border);
  font-size: 12.5px; color: var(--fg-muted);
}
.footer-bottom .built { font-family: var(--font-mono); font-size: 11px; }

/* ================= Page picker (preview only) ================= */
.page-picker {
  position: fixed; bottom: 16px; left: 50%;
  transform: translateX(-50%); z-index: 60;
  background: rgba(20,8,40,0.85);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
          backdrop-filter: blur(20px) saturate(180%);
  border: 0.5px solid rgba(255,255,255,0.16);
  border-radius: var(--radius-pill);
  padding: 6px; display: flex; gap: 2px;
  box-shadow: 0 16px 40px rgba(20,8,40,0.40);
  max-width: calc(100vw - 32px);
  flex-wrap: wrap;
}
.page-picker button {
  font-family: var(--font-body); font-size: 12px; font-weight: 500;
  padding: 8px 14px; border-radius: var(--radius-pill);
  background: transparent; color: rgba(255,255,255,0.75);
  border: 0; cursor: pointer; transition: all 120ms var(--ease);
}
.page-picker button:hover { background: rgba(255,255,255,0.10); color: white; }
.page-picker button.active { background: white; color: var(--lilac-900); font-weight: 600; }
.page-picker-label {
  font-family: var(--font-mono); font-size: 10.5px;
  color: rgba(255,255,255,0.55); text-transform: uppercase;
  letter-spacing: 0.10em; padding: 0 12px 0 14px;
  display: flex; align-items: center;
  border-right: 0.5px solid rgba(255,255,255,0.16); margin-right: 4px;
}

/* ================= Publications — Cocoa window =================
   A macOS Finder/Mail-style three-pane window: sidebar with filters
   (years + tags), a list of publications in the middle, and a detail
   pane on the right. Lilac is the system accent. The window sits on
   a soft lilac-radial desktop tint so the vibrancy reads.            */
.pubs-stage {
  background:
    radial-gradient(70% 80% at 15% 10%, #E9DCFF 0%, transparent 55%),
    radial-gradient(60% 70% at 90% 100%, #FFD7E6 0%, transparent 55%),
    linear-gradient(135deg, #F4EEFF 0%, #FFFFFF 100%);
  padding: 56px 0 96px;
}
.pubs-stage .container { max-width: 1320px; }
.pubs-header { margin: 0 0 24px; }
.pubs-header .eyebrow { margin-bottom: 6px; }
.pubs-header h1 { font-size: 32px; letter-spacing: -0.01em; margin: 0 0 6px; font-weight: 700; }
.pubs-header p { color: var(--fg-muted); font-size: 14px; margin: 0; max-width: 560px; }

.pub-window {
  width: 100%;
  border-radius: 14px;
  overflow: hidden;
  background: #FFFFFF;
  display: grid;
  grid-template-columns: 240px minmax(0, 380px) 1fr;
  grid-template-rows: 52px 1fr 40px;
  min-height: 620px;
  box-shadow:
    0 0 0 0.5px rgba(0,0,0,0.10),
    0 30px 90px -10px rgba(40, 20, 80, 0.28);
  position: relative;
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}
.pw-traffic {
  position: absolute; left: 16px; top: 18px; z-index: 2;
  display: flex; gap: 8px;
}
.pw-traffic span {
  width: 12px; height: 12px; border-radius: 50%;
  box-shadow: inset 0 0 0 0.5px rgba(0,0,0,0.18);
}
.pw-traffic .r { background: #FF5F57; }
.pw-traffic .y { background: #FEBC2E; }
.pw-traffic .g { background: #28C840; }

/* Sidebar (full-height vibrancy) */
.pw-sidebar {
  grid-row: 1 / -1; grid-column: 1;
  background: rgba(245, 240, 252, 0.72);
  -webkit-backdrop-filter: blur(40px) saturate(180%);
          backdrop-filter: blur(40px) saturate(180%);
  padding: 44px 12px 14px;
  border-right: 0.5px solid rgba(60, 60, 67, 0.10);
  overflow-y: auto;
}
.pw-section {
  font: 600 11px/1 var(--font-display);
  color: rgba(60, 60, 67, 0.55);
  padding: 14px 12px 6px;
  letter-spacing: -0.005em;
}
.pw-row {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 12px;
  border-radius: 9px;
  font: 400 13px/1 var(--font-body);
  color: #1C1C1E;
  cursor: pointer;
  margin: 1px 0;
  background: transparent;
  border: 0;
  width: 100%;
  text-align: left;
  transition: background 100ms var(--ease);
}
.pw-row .sym {
  width: 22px; height: 22px;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; line-height: 1; color: rgba(60,60,67,0.70);
}
.pw-row .count {
  margin-left: auto;
  font: 400 11.5px var(--font-mono);
  color: rgba(60, 60, 67, 0.50);
}
.pw-row .dot {
  width: 9px; height: 9px; border-radius: 50%;
  flex: none;
}
.pw-row:hover:not(.on) { background: rgba(60, 60, 67, 0.06); }
.pw-row.on { background: rgba(60, 60, 67, 0.10); color: #1C1C1E; }
.pw-row.on .sym { color: var(--cocoa-accent); }

/* Titlebar (unified, no border) */
.pw-titlebar {
  grid-row: 1; grid-column: 2 / -1;
  display: flex; align-items: center; gap: 14px;
  padding: 0 16px 0 16px;
  background: rgba(255, 255, 255, 0.55);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
          backdrop-filter: blur(20px) saturate(160%);
  border-bottom: 0.5px solid rgba(60, 60, 67, 0.10);
}
.pw-tl-title {
  flex: 1;
  display: flex; flex-direction: column; gap: 2px;
}
.pw-tl-title .name {
  font: 600 15px/1 var(--font-display);
  color: #1C1C1E;
  letter-spacing: -0.015em;
}
.pw-tl-title .sub {
  font: 400 11.5px/1 var(--font-body);
  color: rgba(60, 60, 67, 0.55);
}
.pw-search {
  display: flex; align-items: center; gap: 6px;
  padding: 5px 10px;
  background: rgba(60, 60, 67, 0.08);
  border-radius: 6px;
  width: 200px;
}
.pw-search i { font-size: 11px; color: rgba(60,60,67,0.55); }
.pw-search input {
  border: 0; background: transparent; outline: none;
  font: 13px var(--font-body); color: #1C1C1E;
  width: 100%;
}
.pw-search input::placeholder { color: rgba(60,60,67,0.45); }
.pw-tl-actions { display: flex; gap: 4px; }
.pw-tl-icon {
  width: 28px; height: 28px;
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  color: rgba(28, 28, 30, 0.72);
  background: transparent; border: 0; cursor: pointer;
  font-size: 12px;
  transition: background 0.12s ease;
}
.pw-tl-icon:hover { background: rgba(60, 60, 67, 0.10); color: var(--cocoa-accent); }

/* List pane (middle column) */
.pw-list {
  grid-row: 2; grid-column: 2;
  background: rgba(252, 250, 255, 0.6);
  border-right: 0.5px solid rgba(60, 60, 67, 0.10);
  overflow-y: auto;
  padding: 8px 8px 16px;
}
.pw-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 12px;
  padding: 12px 14px;
  border-radius: 10px;
  margin: 2px 0;
  cursor: pointer;
  transition: background 100ms var(--ease);
  background: transparent;
  border: 0; width: 100%; text-align: left;
}
.pw-item .title {
  font: 500 13.5px/1.35 var(--font-body);
  color: #1C1C1E;
  letter-spacing: -0.005em;
}
.pw-item .meta {
  font: 11.5px/1.35 var(--font-mono);
  color: rgba(60, 60, 67, 0.62);
  margin-top: 4px;
}
.pw-item .when {
  font: 11px var(--font-mono);
  color: rgba(60, 60, 67, 0.50);
  white-space: nowrap;
}
.pw-item .tag {
  margin-top: 6px; display: inline-flex; align-items: center; gap: 6px;
  font: 500 10.5px/1 var(--font-body);
  color: rgba(60, 60, 67, 0.62);
  letter-spacing: 0.02em;
}
.pw-item .tag::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%;
  background: var(--c, #BFA0FF);
}
.pw-item:hover:not(.sel) { background: rgba(60, 60, 67, 0.04); }
.pw-item.sel {
  background: rgba(140, 92, 255, 0.14);
}
.pw-item.sel .title { color: var(--lilac-900); }

.pw-list-section {
  font: 600 10.5px/1 var(--font-display);
  color: rgba(60, 60, 67, 0.55);
  letter-spacing: 0.04em;
  padding: 14px 14px 6px;
  text-transform: uppercase;
}
.pw-list-section:first-child { padding-top: 6px; }

/* Detail pane (right column) */
.pw-detail {
  grid-row: 2; grid-column: 3;
  background: #FFFFFF;
  overflow-y: auto;
  padding: 28px 32px 32px;
}
.pw-detail .pub-tag {
  display: inline-flex; align-items: center; gap: 6px;
  font: 500 10.5px/1 var(--font-body);
  letter-spacing: 0.02em;
  color: rgba(60, 60, 67, 0.62);
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(60, 60, 67, 0.06);
  margin-bottom: 14px;
}
.pw-detail .pub-tag::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%;
  background: var(--c, #BFA0FF);
}
.pw-detail h2 {
  font: 700 22px/1.25 var(--font-display);
  color: #1C1C1E;
  margin: 0 0 12px;
  letter-spacing: -0.015em;
}
.pw-detail .authors {
  font: 12.5px/1.6 var(--font-mono);
  color: rgba(60, 60, 67, 0.75);
  margin: 0 0 16px;
}
.pw-detail .authors b { color: var(--lilac-900); font-weight: 700; }
.pw-detail .meta-row {
  display: flex; gap: 16px; flex-wrap: wrap;
  padding: 14px 0;
  border-top: 0.5px solid rgba(60, 60, 67, 0.12);
  border-bottom: 0.5px solid rgba(60, 60, 67, 0.12);
  margin: 0 0 18px;
}
.pw-detail .meta-row > div { display: flex; flex-direction: column; gap: 2px; min-width: 90px; }
.pw-detail .meta-row dt {
  font: 600 10px/1 var(--font-display);
  letter-spacing: 0.10em; text-transform: uppercase;
  color: rgba(60, 60, 67, 0.55);
}
.pw-detail .meta-row dd {
  font: 500 13px/1.4 var(--font-body);
  color: #1C1C1E;
  margin: 0;
}
.pw-detail .actions {
  display: flex; gap: 6px; flex-wrap: wrap;
  margin: 0 0 24px;
}
.pw-detail .ns-btn {
  font: 500 12.5px var(--font-body);
  padding: 6px 14px;
  border-radius: 6px;
  border: 0.5px solid rgba(60,60,67,0.20);
  background: linear-gradient(180deg, #FFFFFF 0%, #F6F6F6 100%);
  color: #1C1C1E;
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
  box-shadow: 0 0.5px 0 rgba(0,0,0,0.04);
  transition: all 80ms var(--ease);
}
.pw-detail .ns-btn:hover { background: linear-gradient(180deg, #FAFAFA 0%, #EFEFEF 100%); }
.pw-detail .ns-btn.primary {
  background: var(--cocoa-accent);
  color: white;
  border-color: rgba(140,92,255,0.6);
  box-shadow: 0 1px 0 rgba(140,92,255,0.35), inset 0 0.5px 0 rgba(255,255,255,0.3);
}
.pw-detail .ns-btn.primary:hover { background: var(--cocoa-accent-pressed); }
.pw-detail h3 {
  font: 600 11px/1 var(--font-display);
  letter-spacing: 0.10em; text-transform: uppercase;
  color: rgba(60, 60, 67, 0.55);
  margin: 22px 0 10px;
}
.pw-detail p.abstract {
  font: 14px/1.6 var(--font-body);
  color: var(--fg);
  margin: 0 0 18px;
}
.pw-detail .bibtex {
  font: 11.5px/1.55 var(--font-mono);
  background: #1A0F2E;
  color: #E2D2FF;
  padding: 14px 16px;
  border-radius: 8px;
  margin: 0;
  white-space: pre;
  overflow-x: auto;
}

/* Footbar */
.pw-foot {
  grid-row: 3; grid-column: 2 / -1;
  display: flex; align-items: center; gap: 12px;
  padding: 0 16px;
  background: rgba(252, 250, 255, 0.7);
  border-top: 0.5px solid rgba(60, 60, 67, 0.10);
  font: 11.5px var(--font-body);
  color: rgba(60, 60, 67, 0.62);
}
.pw-foot .grow { flex: 1; }
.pw-foot .pill {
  padding: 3px 9px; border-radius: 999px;
  background: rgba(60, 60, 67, 0.08);
  color: #1C1C1E;
  font: 500 11px var(--font-mono);
}

/* Publications: desktop shows the Cocoa window, mobile shows a card list. */
.pubs-mobile { display: none; }

.pubs-header-row {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
}
.pubs-header-row > div { min-width: 0; }

/* No-nonsense toggle — desktop only. On mobile the card view is always
   shown, so the toggle is hidden there to avoid a redundant control. */
.nn-toggle { display: inline-flex; }
@media (max-width: 760px) {
  .nn-toggle { display: none; }
}
/* Toggle override at desktop: swap window for card list. */
.pubs-stage[data-no-nonsense="on"] .pub-window { display: none; }
.pubs-stage[data-no-nonsense="on"] .pubs-mobile { display: block; }

.nn-toggle {
  align-items: center; gap: 10px;
  background: rgba(255,255,255,0.78);
  border: 0.5px solid rgba(60,60,67,0.18);
  border-radius: var(--radius-pill);
  padding: 8px 14px 8px 8px;
  cursor: pointer;
  font: 500 13px var(--font-body);
  color: var(--fg);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
          backdrop-filter: blur(20px) saturate(180%);
  box-shadow: 0 1px 0 rgba(255,255,255,0.6) inset, 0 8px 22px -12px rgba(20,8,40,0.15);
  transition: border-color 200ms var(--ease), color 200ms var(--ease);
}
.nn-toggle:hover { border-color: rgba(140,92,255,0.35); color: var(--brand); }
.nn-toggle-track {
  position: relative;
  width: 32px; height: 18px;
  border-radius: 999px;
  background: rgba(60,60,67,0.20);
  transition: background 220ms var(--ease);
  flex: none;
}
.nn-toggle-thumb {
  position: absolute; top: 2px; left: 2px;
  width: 14px; height: 14px; border-radius: 50%;
  background: white;
  box-shadow: 0 1px 3px rgba(0,0,0,0.18);
  transition: transform 240ms var(--ease-out);
}
.nn-toggle.on .nn-toggle-track { background: var(--brand); }
.nn-toggle.on .nn-toggle-thumb { transform: translateX(14px); }
.nn-toggle.on { color: var(--brand); border-color: rgba(140,92,255,0.35); }

/* Visibility-only toggle — at <=820px the mobile view replaces the
   desktop window. The data-no-nonsense override (above) re-uses the
   same display-swap on desktop. The visual styles for .pubs-mobile-*
   apply at all widths so the desktop "No-nonsense" view looks
   identical to the mobile presentation. */
@media (max-width: 760px) {
  .pub-window { display: none; }
  .pubs-mobile { display: block; }
  .pubs-stage { padding: 32px 0 64px; }
  .pubs-header h1 { font-size: 26px; }
  .pubs-header p { font-size: 13.5px; }
}

/* Constrain the no-nonsense desktop view to a readable single-column
   width so cards don't sprawl across 1100+px. */
@media (min-width: 761px) {
  .pubs-stage[data-no-nonsense="on"] .pubs-mobile {
    max-width: 720px;
    margin: 0 auto;
  }
}

/* ----- mobile/no-nonsense card list — visual styles (apply at all widths) ----- */

/* Search bar */
.pubs-mobile-search {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px;
  background: rgba(255,255,255,0.85);
  border: 0.5px solid rgba(60,60,67,0.18);
  border-radius: var(--radius-pill);
  box-shadow: 0 1px 0 rgba(255,255,255,0.6) inset, 0 8px 22px -12px rgba(20,8,40,0.15);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
          backdrop-filter: blur(20px) saturate(180%);
  margin: 0 0 14px;
}
.pubs-mobile-search i { font-size: 12px; color: var(--fg-muted); }
.pubs-mobile-search input {
  flex: 1; min-width: 0;
  border: 0; background: transparent; outline: none;
  font: 14px var(--font-body); color: var(--fg);
}
.pubs-mobile-search input::placeholder { color: var(--fg-muted); }

/* Filter chips — horizontal scroll */
.pubs-mobile-chips {
  display: flex; gap: 6px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 4px 0 12px;
  margin: 0 0 8px;
  scroll-snap-type: x proximity;
  flex-wrap: nowrap;
}
.pubs-mobile-chips::-webkit-scrollbar { display: none; }
.pubs-mobile-chip {
  display: inline-flex; align-items: center; gap: 6px;
  flex: none;
  font: 500 12.5px var(--font-body);
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  background: rgba(255,255,255,0.7);
  border: 0.5px solid rgba(60,60,67,0.16);
  color: var(--fg);
  cursor: pointer;
  white-space: nowrap;
  scroll-snap-align: start;
  transition: background 120ms var(--ease), border-color 120ms var(--ease), color 120ms var(--ease);
}
.pubs-mobile-chip .dot {
  width: 8px; height: 8px; border-radius: 50%; flex: none;
}
.pubs-mobile-chip .count {
  font: 500 11px var(--font-mono);
  color: var(--fg-muted);
  margin-left: 4px;
}
.pubs-mobile-chip:hover { border-color: rgba(140,92,255,0.35); }
.pubs-mobile-chip.on {
  background: var(--brand);
  color: white;
  border-color: var(--brand);
}
.pubs-mobile-chip.on .count { color: rgba(255,255,255,0.78); }

/* Year sections */
.pubs-mobile-year {
  font: 700 12px/1 var(--font-display);
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin: 24px 0 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.pubs-mobile-year:first-of-type { margin-top: 8px; }

/* Cards */
.pubs-mobile-card { padding: 18px 18px; }
.pubs-mobile-card + .pubs-mobile-card { margin-top: 10px; }
.pubs-mobile-card .card-title { font-size: 15.5px; }
.pubs-mobile-card.featured {
  border-color: rgba(140,92,255,0.30);
  box-shadow: 0 8px 24px -12px rgba(140,92,255,0.30);
}
.pubs-mobile-card-tag {
  display: inline-flex; align-items: center; gap: 6px;
  font: 600 10.5px/1 var(--font-body);
  letter-spacing: 0.04em;
  color: var(--fg-muted);
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: rgba(60,60,67,0.06);
  margin-bottom: 10px;
}
.pubs-mobile-card-tag::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%;
  background: var(--c, #BFA0FF);
}
.pubs-mobile-abstract {
  font-size: 13px; color: var(--fg-muted); line-height: 1.55;
  margin: 10px 0 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.pubs-mobile-card .card-actions { margin-top: 14px; }

.pubs-mobile-empty {
  padding: 32px 16px;
  text-align: center;
  color: var(--fg-muted);
  font-size: 13.5px;
}

@media (max-width: 480px) {
  .pubs-mobile-card .card-actions .btn { padding: 6px 10px; font-size: 12px; }
}

/* When the brand "Name · @handle" wraps onto two lines on narrow viewports,
   keep the two lines tight — the inherited body line-height (1.6) leaves
   an awkward vertical gap between name and handle. Has no effect when
   the text fits on one line. */
.topnav-brand span { line-height: 1.2; }
/* Keep the full name on a single line; the @handle can drop to the next
   line if space is tight. */
.topnav-brand .brand-name { white-space: nowrap; }
@media (max-width: 520px) {
  .topnav-brand { font-size: 13.5px; }
  .topnav-brand small { font-size: 11.5px; }
}

/* ================= CV page ================= */
.cv-header {
  display: grid; grid-template-columns: 1fr auto;
  gap: 24px; align-items: end;
  padding-bottom: 24px;
  border-bottom: 2px solid var(--fg);
  margin-bottom: 36px;
}
.cv-header h1 { font-size: 36px; margin: 0 0 4px; letter-spacing: -0.02em; }
.cv-header .role { font-size: 14.5px; color: var(--fg-muted); margin: 0; }
.cv-contact { font-size: 12px; color: var(--fg); text-align: right; line-height: 1.7; font-family: var(--font-mono); }
.cv-section { margin-bottom: 32px; }
.cv-section h2 {
  font-size: 12.5px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--fg-muted); margin: 0 0 16px; padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.cv-entry { display: grid; grid-template-columns: 130px 1fr; gap: 24px; padding: 12px 0; }
.cv-entry .when { font-family: var(--font-mono); font-size: 12px; color: var(--fg-muted); padding-top: 2px; }
.cv-entry .what strong { display: block; font-family: var(--font-display); font-size: 15px; font-weight: 700; }
.cv-entry .what em { font-style: normal; color: var(--brand); font-size: 13.5px; font-weight: 500; }
.cv-entry .what p { font-size: 13.5px; color: var(--fg-muted); margin: 4px 0 0; line-height: 1.55; }

/* ================= About page ================= */
.about-grid { display: grid; grid-template-columns: 280px 1fr; gap: 56px; align-items: start; }
.about-portrait img { border-radius: var(--radius-lg); aspect-ratio: 4/5; object-fit: cover; }
.about-portrait .caption { font-size: 12px; color: var(--fg-muted); margin-top: 10px; text-align: center; font-family: var(--font-mono); }
.about-bio p { font-size: 16px; line-height: 1.65; color: var(--fg); margin: 0 0 1em; }
.about-bio .name { font-family: var(--font-display); font-size: 36px; font-weight: 700; margin: 0 0 4px; letter-spacing: -0.02em; }
.about-bio .role-line { font-size: 16px; color: var(--brand); margin: 0 0 24px; font-weight: 500; }
.about-bio .switch-aside { font-style: italic; color: var(--fg-muted); }

/* ================= Project detail ================= */
.proj-detail-hero {
  background: var(--bg-alt);
  padding: 56px 0;
  margin-bottom: 48px;
  border-bottom: 1px solid var(--border);
}
.proj-detail-hero h1 { font-size: 36px; letter-spacing: -0.02em; margin: 0 0 12px; }
.proj-detail-hero .summary { font-size: 16.5px; color: var(--fg-muted); max-width: 640px; margin: 0 0 20px; line-height: 1.55; }
.proj-detail-meta { display: flex; flex-wrap: wrap; gap: 32px; padding-top: 18px; border-top: 1px solid var(--border); margin-top: 20px; }
.proj-detail-meta dt { font-size: 11px; font-weight: 700; letter-spacing: 0.10em; text-transform: uppercase; color: var(--fg-muted); margin: 0 0 3px; }
.proj-detail-meta dd { margin: 0; font-size: 14px; color: var(--fg); font-weight: 500; }

.prose { font-size: 16px; line-height: 1.7; color: var(--fg); }
.prose p { margin: 0 0 1.2em; }
.prose h2 { font-size: 22px; margin: 1.6em 0 0.5em; }
.prose h3 { font-size: 18px; margin: 1.4em 0 0.4em; }
.prose ul, .prose ol { padding-left: 1.4em; margin: 0 0 1.2em; }
.prose li { margin: 0.3em 0; }
.prose a { color: var(--brand); text-decoration: underline; text-decoration-color: rgba(140,92,255,0.35); text-underline-offset: 3px; }
.prose code { background: var(--bg-muted); padding: 0.15em 0.4em; border-radius: 4px; font-size: 0.92em; }

/* ================= 404 ================= */
.fourohfour { text-align: center; padding: 80px 0; }
.fourohfour img { max-width: 320px; margin: 0 auto 24px; filter: drop-shadow(0 8px 20px rgba(20,8,40,0.10)); }
.fourohfour .code { font-family: var(--font-mono); font-size: 12.5px; color: var(--brand); letter-spacing: 0.12em; text-transform: uppercase; font-weight: 600; }
.fourohfour h1 { font-size: 32px; letter-spacing: -0.02em; margin: 8px 0 12px; }
.fourohfour p { font-size: 16px; color: var(--fg-muted); max-width: 480px; margin: 0 auto 24px; line-height: 1.55; }

/* ================= Cite modal ================= */
.cite-backdrop {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(20,8,40,0.45);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  display: grid; place-items: center;
  padding: 24px;
}
.cite-modal {
  background: white; border-radius: var(--radius-lg);
  max-width: 640px; width: 100%;
  box-shadow: var(--shadow-modal);
  overflow: hidden;
}
.cite-head { padding: 20px 24px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.cite-head h3 { margin: 0; font-size: 16px; }
.cite-close { background: transparent; border: 0; font-size: 18px; color: var(--fg-muted); cursor: pointer; padding: 4px 8px; border-radius: 6px; }
.cite-close:hover { background: var(--bg-alt); color: var(--fg); }
.cite-body { padding: 0; }
.cite-bib {
  font-family: var(--font-mono); font-size: 12.5px;
  background: #1A0F2E; color: #E2D2FF;
  padding: 18px 22px; margin: 0;
  white-space: pre; overflow-x: auto;
  line-height: 1.55;
}
.cite-actions { padding: 16px 24px; display: flex; gap: 8px; justify-content: flex-end; border-top: 1px solid var(--border); background: var(--bg-alt); }

/* ================= Density modes ================= */
body[data-density="compact"] .section { padding: 56px 0; }
body[data-density="compact"] .hero-split-left,
body[data-density="compact"] .hero-split-right { padding: 44px 36px; }
body[data-density="compact"] .hero h1 { font-size: 36px; }
body[data-density="compact"] .card { padding: 18px 22px; }
body[data-density="compact"] .card + .card { margin-top: 8px; }
body[data-density="compact"] .focus-card { padding: 22px 22px 18px; }

/* ================= Lilac intensity ================= */
/* SUBTLE — default, mostly white, lilac on accents only. Already encoded above. */

body[data-lilac="medium"] .hero-split { border: 0; }
body[data-lilac="medium"] .hero-split-left {
  background: linear-gradient(160deg, #BFA0FF 0%, #8C5CFF 70%, #5B2EC9 100%);
  color: white;
}
body[data-lilac="medium"] .hero-split-left .hero-eyebrow {
  background: rgba(255,255,255,0.16); color: white; border-color: rgba(255,255,255,0.32);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
body[data-lilac="medium"] .hero-split-left h1 { color: white; }
body[data-lilac="medium"] .hero-split-left h1 .hl { color: var(--lilac-100); }
body[data-lilac="medium"] .hero-split-left .role { color: rgba(255,255,255,0.88); }
body[data-lilac="medium"] .hero-split-left .hero-affiliation { color: rgba(255,255,255,0.75); }
body[data-lilac="medium"] .hero-split-left .hero-handle { background: rgba(255,255,255,0.16); color: white; border-color: rgba(255,255,255,0.32); }
body[data-lilac="medium"] .hero-split-left .hero-meta-row { color: rgba(255,255,255,0.85); }
body[data-lilac="medium"] .hero-split-left .hero-meta-row i { color: var(--lilac-100); }
body[data-lilac="medium"] .hero-split-left::before { background: radial-gradient(60% 50% at 30% 30%, rgba(255,255,255,0.18), transparent 70%); }
body[data-lilac="medium"] .hero-split-left .btn-glass { background: rgba(255,255,255,0.16); color: white; border-color: rgba(255,255,255,0.32); }
body[data-lilac="medium"] .hero-split-left .btn-glass.btn-glass-primary { background: white; color: var(--lilac-900); border-color: white; }
body[data-lilac="medium"] .section.alt { background: linear-gradient(180deg, var(--lilac-50) 0%, var(--bg-alt) 100%); }

body[data-lilac="bold"] .hero-split { border: 0; background: var(--lilac-radial); }
body[data-lilac="bold"] .hero-split-left,
body[data-lilac="bold"] .hero-split-right { background: transparent; color: white; }
body[data-lilac="bold"] .hero-split-left::before { background: radial-gradient(60% 50% at 30% 30%, rgba(255,255,255,0.18), transparent 70%); }
body[data-lilac="bold"] .hero h1 { color: white; }
body[data-lilac="bold"] .hero h1 .hl { color: var(--lilac-100); }
body[data-lilac="bold"] .hero .role { color: rgba(255,255,255,0.88); }
body[data-lilac="bold"] .hero-eyebrow { background: rgba(255,255,255,0.14); color: rgba(255,255,255,0.92); border-color: rgba(255,255,255,0.32); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
body[data-lilac="bold"] .hero-affiliation { color: rgba(255,255,255,0.75); }
body[data-lilac="bold"] .hero-handle { background: rgba(255,255,255,0.16); color: white; border-color: rgba(255,255,255,0.32); }
body[data-lilac="bold"] .hero-meta-row { color: rgba(255,255,255,0.85); }
body[data-lilac="bold"] .hero-meta-row i { color: var(--lilac-100); }
body[data-lilac="bold"] .btn-glass { background: rgba(255,255,255,0.16); color: white; border-color: rgba(255,255,255,0.32); }
body[data-lilac="bold"] .btn-glass.btn-glass-primary { background: white; color: var(--lilac-900); border-color: white; }
body[data-lilac="bold"] .section.alt { background: linear-gradient(180deg, var(--lilac-50) 0%, #ECDDFF 100%); }
body[data-lilac="bold"] .focus-card { border-color: rgba(140,92,255,0.20); }
body[data-lilac="bold"] .focus-icon { background: var(--brand); color: white; }

/* ================= Dark theme tweaks ================= */
:root[data-theme="dark"] body { background: var(--bg); color: var(--fg); }
:root[data-theme="dark"] .topnav-inner {
  background: rgba(36,28,62,0.62);
  border-color: rgba(255,255,255,0.10);
  box-shadow:
    0 1px 0 rgba(255,255,255,0.08) inset,
    0 0 0 0.5px rgba(255,255,255,0.10),
    0 16px 40px -10px rgba(0,0,0,0.55);
}
:root[data-theme="dark"] .topnav-inner.liquid-glass::after {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.16) 0%, rgba(255,255,255,0) 35%),
    linear-gradient(0deg,   rgba(255,255,255,0.06) 0%, rgba(255,255,255,0) 30%);
}
:root[data-theme="dark"] .topnav-inner:hover {
  background: rgba(48,36,84,0.78);
  border-color: rgba(191,160,255,0.30);
  box-shadow:
    0 1px 0 rgba(255,255,255,0.10) inset,
    0 0 0 0.5px rgba(191,160,255,0.30),
    0 22px 50px -14px rgba(0,0,0,0.70),
    0 0 60px -10px rgba(140,92,255,0.30);
}
:root[data-theme="dark"] .topnav-tools { border-left-color: rgba(255,255,255,0.18); }
:root[data-theme="dark"] .topnav-brand small { color: var(--fg-muted); }
:root[data-theme="dark"] .topnav-link { color: var(--fg); }
:root[data-theme="dark"] .topnav-link .topnav-link-shine {
  background:
    radial-gradient(120% 200% at 50% -40%, rgba(255,255,255,0.20) 0%, rgba(255,255,255,0.0) 60%),
    linear-gradient(180deg, rgba(191,160,255,0.22), rgba(191,160,255,0.08));
  box-shadow: inset 0 0.5px 0 rgba(255,255,255,0.18), 0 4px 14px -4px rgba(140,92,255,0.55);
}
:root[data-theme="dark"] .topnav-link.active { color: white; }
:root[data-theme="dark"] .topnav-icon { color: var(--fg); }
:root[data-theme="dark"] .topnav-icon:hover { color: var(--brand-hover); }
:root[data-theme="dark"] .topnav-burger span { background: var(--fg); }
:root[data-theme="dark"] .topnav-icon::before {
  background: radial-gradient(80% 100% at 50% 0%, rgba(255,255,255,0.12), rgba(255,255,255,0) 70%),
              linear-gradient(180deg, rgba(191,160,255,0.22), rgba(191,160,255,0.06));
}
:root[data-theme="dark"] .theme-menu {
  background: rgba(28,20,50,0.85);
  border-color: rgba(255,255,255,0.10);
  box-shadow:
    0 1px 0 rgba(255,255,255,0.08) inset,
    0 0 0 0.5px rgba(255,255,255,0.10),
    0 20px 50px -10px rgba(0,0,0,0.70);
}
:root[data-theme="dark"] .theme-menu-item { color: var(--fg); }
:root[data-theme="dark"] .theme-menu-item:hover { background: rgba(191,160,255,0.14); color: var(--brand); }
:root[data-theme="dark"] .theme-menu-item i:first-child { color: var(--fg-muted); }
:root[data-theme="dark"] .hero-split { background: var(--surface); border-color: var(--border); }
:root[data-theme="dark"] .hero-split-right { background: var(--surface); }
:root[data-theme="dark"] .hero-split-left {
  background: linear-gradient(165deg, #1F1638 0%, #2A1B55 60%, #3D2580 100%);
}
:root[data-theme="dark"] .hero h1 { color: var(--fg); }
:root[data-theme="dark"] .hero .role { color: var(--fg); }
:root[data-theme="dark"] .hero-handle { background: rgba(191,160,255,0.12); border-color: rgba(191,160,255,0.30); color: var(--brand); }
:root[data-theme="dark"] .hero-eyebrow {
  background: rgba(191,160,255,0.10);
  border-color: rgba(191,160,255,0.30);
  color: var(--brand);
}
:root[data-theme="dark"] .hero-meta-inline { color: var(--fg-muted); }
:root[data-theme="dark"] .hero-unified-inner {
  border-color: var(--border);
  background:
    radial-gradient(80% 60% at 100% 0%, rgba(140,92,255,0.20), transparent 60%),
    linear-gradient(165deg, #1A1130 0%, #14102A 50%, var(--bg) 100%);
}
:root[data-theme="dark"] .hero-unified-portrait { border-color: rgba(255,255,255,0.10); box-shadow: 0 24px 60px -12px rgba(0,0,0,0.7), 0 0 0 1px rgba(191,160,255,0.18); }
:root[data-theme="dark"] .hero-unified-name { color: var(--fg); }
:root[data-theme="dark"] .hero-unified-h1 { color: var(--fg); }
:root[data-theme="dark"] .focus-card { background: var(--surface); border-color: var(--border); }
:root[data-theme="dark"] .focus-card p { color: var(--fg); }
:root[data-theme="dark"] .focus-icon { background: rgba(191,160,255,0.12); color: var(--brand); }
:root[data-theme="dark"] .focus-tags span { background: var(--bg-muted); color: var(--fg-muted); }
:root[data-theme="dark"] .card { background: var(--surface); border-color: var(--border); color: var(--fg); }
:root[data-theme="dark"] .card-title { color: var(--fg); }
:root[data-theme="dark"] .featured-pub {
  /* Toned-down lilac wash — the bright halo at the top edge was reading
     too punchy against the dark background. Halved alpha values + smaller
     radius keep the "featured" hint without dominating the section. */
  background:
    radial-gradient(80% 80% at 100% 0%, rgba(191,160,255,0.15), rgba(140,92,255,0.05) 40%, transparent 70%),
    linear-gradient(180deg, #1F1638, #18112B);
  border-color: rgba(191,160,255,0.14);
}
:root[data-theme="dark"] .featured-pub::before {
  background: rgba(28,20,52,0.55);
  border-color: rgba(255,255,255,0.04);
  /* Drop the inner glass-edge highlight entirely — the 0.6-alpha white
     top-edge inset from the light-mode rule was the "white border"
     reading too bright against the dark plate. */
  box-shadow: none;
}
:root[data-theme="dark"] .featured-pub h3 { color: var(--fg); }
:root[data-theme="dark"] .featured-pub-meta { color: var(--fg); }
:root[data-theme="dark"] .btn-outline { background: transparent; color: var(--fg); border-color: var(--border-strong); }
:root[data-theme="dark"] .btn-outline:hover { color: var(--brand); border-color: var(--brand); }
:root[data-theme="dark"] .btn-glass {
  background: rgba(40,28,72,0.55);
  border-color: rgba(255,255,255,0.12);
  color: var(--fg);
  box-shadow:
    0 1px 0 rgba(255,255,255,0.06) inset,
    0 0 0 0.5px rgba(255,255,255,0.08),
    0 8px 22px -8px rgba(0,0,0,0.55);
}
:root[data-theme="dark"] .btn-glass:hover { background: rgba(60,42,108,0.85); color: var(--brand); }
:root[data-theme="dark"] .social-rail a { background: var(--surface); border-color: var(--border); color: var(--fg-muted); }
:root[data-theme="dark"] .social-rail a:hover { background: rgba(191,160,255,0.14); border-color: var(--brand); color: var(--brand); }
:root[data-theme="dark"] .site-footer { background: var(--bg-alt); border-top-color: var(--border); }
:root[data-theme="dark"] .footer-col a { color: var(--fg); }
:root[data-theme="dark"] .footer-bottom { border-top-color: var(--border); color: var(--fg-muted); }
/* Project / projects-page filter chips: in dark mode use the bright
   foreground color (matching the publications-page chips) so the labels
   are properly readable instead of dim-gray-on-dark. */
:root[data-theme="dark"] .filter { color: var(--fg); border-color: var(--border-strong); }
:root[data-theme="dark"] .chip { background: var(--surface); border-color: var(--border); color: var(--fg); }
:root[data-theme="dark"] .edu-list li { border-bottom-color: var(--border); }
:root[data-theme="dark"] .proj-card { background: var(--surface); border-color: var(--border); color: var(--fg); }
:root[data-theme="dark"] .proj-thumb { background: var(--bg-muted); }
/* On the publications and publication-detail pages the body paints
   the lilac "desktop" gradient — fixed to the viewport so it slides
   under the topnav and stays put on scroll. Suppress .pubs-stage's
   own copy of the gradient there so we don't double-paint two
   gradients with mismatched scroll/attachment behavior (which made
   the transition under the nav look wrong). */
body[data-page="publications"],
body[data-page="publication"] {
  background:
    radial-gradient(70% 80% at 15% 10%, #F8F0FF 0%, transparent 55%),
    radial-gradient(60% 70% at 90% 100%, #FFF0F6 0%, transparent 55%),
    linear-gradient(135deg, #F4EEFF 0%, #FFFFFF 100%);
  background-attachment: fixed;
}
body[data-page="publications"] .pubs-stage,
body[data-page="publication"] .pubs-stage { background: transparent; }
:root[data-theme="dark"] body[data-page="publications"],
:root[data-theme="dark"] body[data-page="publication"] {
  background:
    radial-gradient(70% 80% at 15% 10%, #2A1B55 0%, transparent 55%),
    radial-gradient(60% 70% at 90% 100%, #3A1B45 0%, transparent 55%),
    linear-gradient(135deg, #14102A 0%, var(--bg) 100%);
  background-attachment: fixed;
}
:root[data-theme="dark"] body[data-page="publications"] .pubs-stage,
:root[data-theme="dark"] body[data-page="publication"] .pubs-stage { background: transparent; }

:root[data-theme="dark"] .pubs-stage {
  background:
    radial-gradient(70% 80% at 15% 10%, #2A1B55 0%, transparent 55%),
    radial-gradient(60% 70% at 90% 100%, #3A1B45 0%, transparent 55%),
    linear-gradient(135deg, #14102A 0%, var(--bg) 100%);
}
:root[data-theme="dark"] .pub-window { background: var(--cocoa-content); box-shadow: 0 0 0 0.5px rgba(255,255,255,0.10), 0 30px 90px -10px rgba(0,0,0,0.70); }
:root[data-theme="dark"] .pw-sidebar { background: rgba(36,24,60,0.72); border-right-color: rgba(255,255,255,0.06); }
:root[data-theme="dark"] .pw-row { color: var(--fg); }
:root[data-theme="dark"] .pw-row:hover:not(.on) { background: rgba(255,255,255,0.06); }
:root[data-theme="dark"] .pw-row.on { background: rgba(191,160,255,0.14); }
:root[data-theme="dark"] .pw-titlebar { background: rgba(36,24,60,0.55); border-bottom-color: rgba(255,255,255,0.06); }
:root[data-theme="dark"] .pw-tl-title .name { color: var(--fg); }
:root[data-theme="dark"] .pw-tl-title .sub { color: var(--fg-muted); }
:root[data-theme="dark"] .pw-search { background: rgba(255,255,255,0.06); }
:root[data-theme="dark"] .pw-search input { color: var(--fg); }
:root[data-theme="dark"] .pw-list { background: rgba(28,20,50,0.55); border-right-color: rgba(255,255,255,0.06); }
:root[data-theme="dark"] .pw-item .title { color: var(--fg); }
:root[data-theme="dark"] .pw-item.sel { background: rgba(191,160,255,0.14); }
:root[data-theme="dark"] .pw-detail { background: var(--cocoa-content); color: var(--fg); }
:root[data-theme="dark"] .pw-detail h2 { color: var(--fg); }
:root[data-theme="dark"] .pw-foot { background: rgba(36,24,60,0.55); border-top-color: rgba(255,255,255,0.06); color: var(--fg-muted); }
:root[data-theme="dark"] .book { background: var(--surface); border-color: var(--border); }
:root[data-theme="dark"] .about-bio .name { color: var(--fg); }
:root[data-theme="dark"] .cv-header { border-bottom-color: var(--fg); }
:root[data-theme="dark"] .cv-section h2 { border-bottom-color: var(--border); }
:root[data-theme="dark"] .cv-entry .what strong { color: var(--fg); }
:root[data-theme="dark"] .proj-detail-hero { background: var(--bg-alt); border-bottom-color: var(--border); }
:root[data-theme="dark"] .cite-modal { background: var(--surface); }
:root[data-theme="dark"] .cite-head { border-bottom-color: var(--border); }
:root[data-theme="dark"] .cite-actions { background: var(--bg-alt); border-top-color: var(--border); }

/* Dark — hamburger + mobile sheet */
:root[data-theme="dark"] .topnav-burger span { background: var(--fg); }
:root[data-theme="dark"] .topnav-burger:hover { background: rgba(191,160,255,0.14); }
:root[data-theme="dark"] .topnav-mobile-sheet {
  background: rgba(36,24,60,0.92);
  border-color: rgba(255,255,255,0.10);
  box-shadow:
    0 1px 0 rgba(255,255,255,0.06) inset,
    0 0 0 0.5px rgba(255,255,255,0.06),
    0 16px 40px -10px rgba(0,0,0,0.65);
}
:root[data-theme="dark"] .topnav-mobile-link { color: var(--fg); }
:root[data-theme="dark"] .topnav-mobile-link:hover { background: rgba(191,160,255,0.14); color: var(--brand); }
:root[data-theme="dark"] .topnav-mobile-link.active { background: rgba(191,160,255,0.18); color: var(--brand); }

/* Dark — no-nonsense toggle */
:root[data-theme="dark"] .nn-toggle {
  background: rgba(40,28,72,0.55);
  border-color: rgba(255,255,255,0.12);
  color: var(--fg);
  box-shadow:
    0 1px 0 rgba(255,255,255,0.06) inset,
    0 8px 22px -12px rgba(0,0,0,0.55);
}
:root[data-theme="dark"] .nn-toggle:hover { border-color: rgba(191,160,255,0.40); color: var(--brand); }
:root[data-theme="dark"] .nn-toggle-track { background: rgba(255,255,255,0.18); }
:root[data-theme="dark"] .nn-toggle-thumb { background: #E8DEF8; }
:root[data-theme="dark"] .nn-toggle.on .nn-toggle-track { background: var(--brand); }
:root[data-theme="dark"] .nn-toggle.on { color: var(--brand); border-color: rgba(191,160,255,0.40); }

/* Dark — pubs mobile (search, chips, cards) */
:root[data-theme="dark"] .pubs-mobile-search {
  background: rgba(40,28,72,0.55);
  border-color: rgba(255,255,255,0.12);
  box-shadow:
    0 1px 0 rgba(255,255,255,0.06) inset,
    0 8px 22px -12px rgba(0,0,0,0.55);
}
:root[data-theme="dark"] .pubs-mobile-search input { color: var(--fg); }
:root[data-theme="dark"] .pubs-mobile-search input::placeholder { color: var(--fg-muted); }
:root[data-theme="dark"] .pubs-mobile-chip {
  background: rgba(40,28,72,0.55);
  border-color: rgba(255,255,255,0.12);
  color: var(--fg);
}
:root[data-theme="dark"] .pubs-mobile-chip:hover { border-color: rgba(191,160,255,0.40); }
:root[data-theme="dark"] .pubs-mobile-chip .count { color: var(--fg-muted); }
:root[data-theme="dark"] .pubs-mobile-chip.on { background: var(--brand); color: white; border-color: var(--brand); }
:root[data-theme="dark"] .pubs-mobile-chip.on .count { color: rgba(255,255,255,0.78); }
:root[data-theme="dark"] .pubs-mobile-year { color: var(--fg-muted); border-bottom-color: var(--border); }
:root[data-theme="dark"] .pubs-mobile-card.featured {
  border-color: rgba(191,160,255,0.35);
  box-shadow: 0 8px 24px -10px rgba(140,92,255,0.40);
}
:root[data-theme="dark"] .pubs-mobile-card-tag {
  background: rgba(255,255,255,0.06);
  color: var(--fg-muted);
}
:root[data-theme="dark"] .pubs-mobile-abstract { color: var(--fg-muted); }
:root[data-theme="dark"] .pubs-mobile-empty { color: var(--fg-muted); }

/* Desktop publications "Cocoa window" — dark-mode contrast fixes.
   Many of the original rules use rgba(60,60,67,...) (Cocoa secondary
   text on white) which becomes invisible on a dark surface. Replace
   with the dark-theme typography tokens. */
:root[data-theme="dark"] .pw-section,
:root[data-theme="dark"] .pw-list-section { color: var(--fg-muted); }
:root[data-theme="dark"] .pw-row { color: var(--fg); }
:root[data-theme="dark"] .pw-row .sym { color: var(--fg-muted); }
:root[data-theme="dark"] .pw-row .count { color: var(--fg-subtle); }
:root[data-theme="dark"] .pw-row:hover:not(.on) { background: rgba(255, 255, 255, 0.05); }
:root[data-theme="dark"] .pw-row.on { background: rgba(191, 160, 255, 0.18); color: var(--fg); }
:root[data-theme="dark"] .pw-row.on .sym,
:root[data-theme="dark"] .pw-row.on .count { color: var(--fg); }
:root[data-theme="dark"] .pw-item { color: var(--fg); }
:root[data-theme="dark"] .pw-item .meta,
:root[data-theme="dark"] .pw-item .when,
:root[data-theme="dark"] .pw-item .tag { color: var(--fg-muted); }
:root[data-theme="dark"] .pw-item:hover:not(.sel) { background: rgba(255, 255, 255, 0.04); }
:root[data-theme="dark"] .pw-item.sel { background: rgba(191, 160, 255, 0.18); color: var(--fg); }
:root[data-theme="dark"] .pw-item.sel .title { color: var(--fg); }
:root[data-theme="dark"] .pw-item.sel .meta,
:root[data-theme="dark"] .pw-item.sel .when,
:root[data-theme="dark"] .pw-item.sel .tag { color: var(--fg); }
:root[data-theme="dark"] .pw-detail h2 { color: var(--fg); }
:root[data-theme="dark"] .pw-detail .authors { color: var(--fg); }
:root[data-theme="dark"] .pw-detail .authors b { color: var(--lilac-300); }
:root[data-theme="dark"] .pw-detail .meta-row dt { color: var(--fg-muted); }
:root[data-theme="dark"] .pw-detail .meta-row dd { color: var(--fg); }
:root[data-theme="dark"] .pw-detail .abstract { color: var(--fg); }
:root[data-theme="dark"] .pw-search { background: rgba(255, 255, 255, 0.06); border-color: rgba(255, 255, 255, 0.10); }
:root[data-theme="dark"] .pw-search i { color: var(--fg-muted); }
:root[data-theme="dark"] .pw-search input { color: var(--fg); }
:root[data-theme="dark"] .pw-search input::placeholder { color: var(--fg-subtle); }
:root[data-theme="dark"] .pw-tl-icon { color: var(--fg-muted); }
:root[data-theme="dark"] .pw-tl-icon:hover { background: rgba(191, 160, 255, 0.14); color: var(--brand); }
:root[data-theme="dark"] .pw-empty,
:root[data-theme="dark"] [data-pw-detail-empty] { color: var(--fg-muted) !important; }
:root[data-theme="dark"] .ns-btn { background: rgba(255, 255, 255, 0.06); border-color: rgba(255, 255, 255, 0.10); color: var(--fg); }
:root[data-theme="dark"] .ns-btn:hover { background: rgba(191, 160, 255, 0.14); border-color: rgba(191, 160, 255, 0.40); color: var(--brand); }
:root[data-theme="dark"] .ns-btn.primary { background: var(--brand); border-color: var(--brand); color: white; }
:root[data-theme="dark"] .ns-btn.primary:hover { background: var(--lilac-300); color: var(--lilac-ink); }
:root[data-theme="dark"] .pw-detail .pub-tag {
  background: rgba(255, 255, 255, 0.06);
  color: var(--fg);
}
:root[data-theme="dark"] .pw-detail h3 { color: var(--fg-muted); }
:root[data-theme="dark"] .pw-detail pre.bibtex,
:root[data-theme="dark"] pre.bibtex {
  background: rgba(255, 255, 255, 0.04);
  border: 0.5px solid rgba(255, 255, 255, 0.08);
  color: var(--fg);
}

/* ================= Glass off ================= */
body[data-glass="off"] .topnav-inner {
  background: white;
  -webkit-backdrop-filter: none;
          backdrop-filter: none;
}
body[data-glass="off"] .btn-glass {
  background: white; -webkit-backdrop-filter: none; backdrop-filter: none;
  border: 1px solid var(--border);
}
body[data-glass="off"] .featured-pub::before {
  background: white; -webkit-backdrop-filter: none; backdrop-filter: none;
}

/* ================= Responsive ================= */
@media (max-width: 720px) {
  .hero-split { flex-direction: column; }
  .hero-split-left, .hero-split-right { padding: 40px 28px; }
  .hero-split-left { order: 2; }
  .hero-split-right { order: 1; }
  .hero-split-right { flex-direction: column; gap: 24px; }
  .hero-portrait { width: 160px; height: 160px; }
  .hero h1 { font-size: 34px; }
  .sec-grid { grid-template-columns: 1fr; gap: 24px; }
  .focus-grid { grid-template-columns: 1fr; }
  .proj-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .topnav-links { display: none; }
  .topnav-tools .topnav-cta { display: none; }
  .topnav-tools { padding-left: 0; border-left: 0; margin-left: 0; }
  .topnav-burger { display: inline-flex; }
  .about-grid { grid-template-columns: 1fr; }
  .cv-entry { grid-template-columns: 1fr; gap: 4px; }
  .cv-header { grid-template-columns: 1fr; align-items: start; }
  .cv-contact { text-align: left; }
  .books-grid { grid-template-columns: 1fr; }
  .book { grid-template-columns: 140px 1fr; gap: 20px; padding: 18px; }
}

/* ================= Print (CV) ================= */
@media print {
  .topnav, .site-footer, .page-picker, .tweaks-host, button { display: none !important; }
  body { background: white; }
  .section { padding: 0; }
  .container-narrow { max-width: none; }
  .cv-header { page-break-after: avoid; }
  .cv-entry { page-break-inside: avoid; }
  a { color: inherit; text-decoration: none; }
}
