/* Personal academic website — dark, typography-first, and mobile-responsive. */
:root {
  color-scheme: dark;
  --background: #0e0e0e;
  --surface: #171717;
  --text: #ededed;
  --muted: #b4b4b4;
  --subtle: #919191;
  --hairline: #323232;
  --focus: #e6d5ae;
  --content-width: 1040px;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  min-height: 100vh;
  margin: 0;
  background: var(--background);
  color: var(--text);
  font-family: "Avenir Next", Avenir, "Helvetica Neue", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  font-size: 16px;
  line-height: 1.82;
}
a { color: inherit; text-decoration-color: #8b8b8b; text-decoration-thickness: 1px; text-underline-offset: 4px; }
a:hover { color: #fff; text-decoration-color: #fff; }
a:focus-visible { outline: 2px solid var(--focus); outline-offset: 5px; border-radius: 2px; }
.skip-link { position: absolute; top: -5rem; left: 1rem; z-index: 5; background: #fff; color: #000; padding: .4rem .7rem; }
.skip-link:focus { top: .4rem; }
.site-shell { min-height: 100vh; max-width: calc(var(--content-width) + 100px); margin: auto; padding: 0 50px; display: flex; flex-direction: column; }
.site-header {
  min-height: 132px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 35px;
}
.site-brand {
  text-decoration: none;
  font-size: 21px;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: .035em;
  white-space: nowrap;
  text-transform: uppercase;
}
.site-nav { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 30px; }
.site-nav a {
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
  color: #bebebe;
  letter-spacing: .12em;
  text-transform: uppercase;
  transition: color 150ms ease;
}
.site-nav a:hover, .site-nav a[aria-current="page"] { color: white; }
.site-nav a[aria-current="page"] { text-decoration: underline; text-underline-offset: 8px; text-decoration-thickness: 1px; }
.main-content { flex: 1; width: 100%; padding: 46px 0 100px; }
.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 14px 22px;
  border-top: 1px solid var(--hairline);
  padding: 17px 0 24px;
  font-size: 11px;
  line-height: 1.6;
  color: #9a9a9a;
  letter-spacing: .06em;
}
.footer-right { display: flex; align-items: center; gap: 24px; margin-left: auto; }
.footer-university { white-space: nowrap; }
.prose { max-width: 850px; }
.prose p { margin: 0 0 1.45rem; }
.prose p:last-child { margin-bottom: 0; }
.prose h1, .prose h2, .prose h3 { margin-top: 2.6rem; margin-bottom: 1.45rem; font-size: 18px; letter-spacing: .02em; font-weight: 600; line-height: 1.4; }
.prose h1:first-child, .prose h2:first-child { margin-top: 0; }
.prose h2:not(:first-child) { border-top: 1px solid var(--hairline); padding-top: 2rem; }
.prose strong { font-weight: 550; }
.prose ul { margin: -1rem 0 1.95rem; padding-left: 22px; font-size: 14px; color: #bfbfbf; }
.prose li { padding-left: 3px; margin-bottom: .15rem; }
.prose li::marker { color: #8c8c8c; }
.prose em { color: #d0d0d0; }
/* Home */
.page-home .main-content { padding-top: 63px; }
.home-grid { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1fr); gap: clamp(35px, 6vw, 80px); align-items: start; }
.home-portrait { margin: 2px 0 0; }
.home-portrait img { width: 100%; height: auto; max-height: 430px; display: block; object-fit: cover; object-position: center; background: var(--surface); }
.home-bio { padding-top: 2px; font-size: 16px; line-height: 1.9; }
.home-bio p { margin-bottom: 1.75rem; }
.home-bio p:last-child { margin-top: 2rem; font-size: 15px; }
/* Research */
.page-research .prose { max-width: 900px; }
.page-research .prose p { margin-bottom: 1.4rem; }
.page-research .prose ul { margin-top: -.9rem; margin-bottom: 2rem; }
/* Research section titles: editorial scale, clearly distinct from article titles. */
.page-research .prose h2 {
  margin-top: 3.5rem;
  margin-bottom: 1.75rem;
  font-size: 27px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -.025em;
  color: #fff;
}
.page-research .prose h2:first-child { margin-top: 0; }
/* Teaching */
.page-teaching .prose h2 { margin-top: 3rem; margin-bottom: 1.5rem; }
.page-teaching .prose h2:first-child { margin-top: 0; }
.page-teaching .prose p { margin-bottom: .7rem; }
.page-teaching .prose h2:not(:first-child) { margin-top: 3.4rem; }
.not-found { min-height: 45vh; }
@media (max-width: 740px) {
  .site-shell { padding: 0 25px; }
  .site-header { flex-direction: column; align-items: flex-start; justify-content: center; gap: 15px; min-height: 132px; padding: 26px 0; }
  .site-brand { white-space: normal; font-size: 18px; }
  .site-nav { justify-content: flex-start; gap: 28px; }
  .main-content, .page-home .main-content { padding-top: 27px; padding-bottom: 62px; }
  .home-grid { grid-template-columns: minmax(0, 1fr); gap: 29px; }
  .home-portrait { max-width: 480px; }
  .home-bio { font-size: 15px; }
  .prose h2 { font-size: 17px; }
  .page-research .prose h2 { font-size: 23px; }
  .prose ul { font-size: 13px; }
  .site-footer { flex-direction: column; align-items: stretch; padding-top: 16px; }
  .footer-right { gap: 15px; justify-content: flex-end; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .site-nav a { transition: none; } }


/* Option A: transparent outlined cats; independent name tooltip + click hint below */
.cat-widget {
  position: relative;
  z-index: 2;
  flex: 0 0 auto;
}
.cat-frame {
  position: relative;
  width: 78px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}
.cat-frame img { display: block; width: 100%; height: auto; }
.cat-hotspot {
  display: block;
  position: absolute;
  top: 5%;
  height: 91%;
  width: 46%;
  border-radius: 35%;
  z-index: 1;
  cursor: pointer;
  text-decoration: none;
}
.cat-hotspot-left { left: 1%; }
.cat-hotspot-right { right: 1%; }
.cat-hotspot:focus-visible { outline: 2px solid #e6d5ae; outline-offset: 1px; }
/* Small individual name pill above the corresponding cat. */
.cat-tooltip {
  position: absolute;
  z-index: 3;
  bottom: calc(100% + 7px);
  width: max-content;
  padding: 4px 9px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  line-height: 1.4;
  letter-spacing: 0;
  color: #141414;
  background: rgba(255,255,255,.95);
  box-shadow: 0 5px 18px rgba(0,0,0,.18);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(4px);
  transition: opacity 140ms ease, transform 140ms ease, visibility 140ms ease;
}
.cat-tooltip-left { left: 0; }
.cat-tooltip-right { right: 0; }
@media (hover: hover) and (pointer: fine) {
  .cat-hotspot-left:hover ~ .cat-tooltip-left,
  .cat-hotspot-left:focus-visible ~ .cat-tooltip-left,
  .cat-hotspot-right:hover ~ .cat-tooltip-right,
  .cat-hotspot-right:focus-visible ~ .cat-tooltip-right {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }
}
/* Separate, subtle caption underneath the image, no popup background. */
.cat-caption {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: 162px;
  max-width: calc(100vw - 42px);
  font-size: 10px;
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: .015em;
  text-align: right;
  color: #adadad;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-3px);
  transition: opacity 140ms ease, transform 140ms ease, visibility 140ms ease;
}
.cat-caption-friends { display: block; }
@media (hover: hover) and (pointer: fine) {
  .cat-widget:has(.cat-hotspot:hover) .cat-caption,
  .cat-widget:focus-within .cat-caption {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }
}
/* Leave breathing room for the caption without moving the cat itself. */
.site-footer { padding-bottom: 43px; }
@media (max-width: 740px) {
  .cat-frame { width: 68px; }
  .footer-university { white-space: normal; text-align: right; }
  .cat-caption { width: 150px; font-size: 9.5px; }
}
@media (prefers-reduced-motion: reduce) {
  .cat-tooltip, .cat-caption { transition: none; }
}

/* Touch devices: state, not sticky :hover/:focus, determines exactly one name. */
@media (hover: none), (pointer: coarse) {
  .cat-widget .cat-tooltip,
  .cat-widget .cat-caption {
    opacity: 0;
    visibility: hidden;
    transform: translateY(4px);
  }
  .cat-widget[data-selected-cat="left"] .cat-tooltip-left,
  .cat-widget[data-selected-cat="right"] .cat-tooltip-right,
  .cat-widget[data-selected-cat] .cat-caption {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }
}
