/* ==========================================================================
   Editorial theme: off-white, ink and blue
   ========================================================================== */

:root {
  --paper: #FAFAFA;
  --paper-2: #F2F2F2;
  --ink: #141414;
  --ink-2: #4D4D4D;
  --ink-3: #8C8C8C;
  --rule: rgba(0, 0, 0, 0.1);
  --accent: #2456A6;
  --accent-ink: #1D4A8F;
  --on-accent: #FFFFFF;
  --logo-bg: #FFFFFF;
  --footer-bg: #F2F2F2;
  --footer-ink: #141414;

  --display: "Source Serif 4", "Times New Roman", Georgia, serif;
  --sans: "Hanken Grotesk", "Helvetica Neue", Arial, sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --wrap: 1200px;
  --gutter: clamp(16px, 5vw, 56px);
  --ease: cubic-bezier(0.2, 0.7, 0.1, 1);
  color-scheme: light;
}

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

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  transition: background-color 0.4s var(--ease), color 0.4s var(--ease);
}


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

a {
  color: inherit;
  text-decoration: none;
}

p a, .news a, .page-note a, .theme-refs a, .entry-detail a {
  color: var(--accent-ink);
  background: linear-gradient(currentColor, currentColor) 0 100% / 100% 1px no-repeat;
  transition: background-size 0.3s var(--ease);
}
p a:hover, .news a:hover, .page-note a:hover, .theme-refs a:hover, .entry-detail a:hover {
  background-size: 100% 2px;
}

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

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

.wrap {
  width: 100%;
  max-width: calc(var(--wrap) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.skip {
  position: absolute;
  left: -999px;
  top: 8px;
  z-index: 200;
  background: var(--ink);
  color: var(--paper);
  padding: 8px 14px;
}
.skip:focus { left: 8px; }

.kicker, .section-no, .section-note, .pub-venue, .pub-links, .news time,
.entry-period, .chip, .year, .footer-kicker,
.footer-row, .footer-updated, .page-note {
  font-family: var(--mono);
  font-feature-settings: "ss01";
}

.kicker {
  margin: 0 0 28px;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.dot { color: var(--accent); font-style: normal; }

/* ---------- Nav ---------- */

.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s var(--ease), background-color 0.4s var(--ease);
}
.nav.scrolled { border-bottom-color: var(--rule); }

.nav-inner {
  max-width: calc(var(--wrap) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 0 var(--gutter);
  height: 64px;
  display: flex;
  align-items: center;
  gap: 24px;
}

.nav-mark {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.45rem;
  letter-spacing: -0.02em;
  flex-shrink: 0;
}
.nav-mark span { color: var(--accent); }

.nav-links {
  margin-left: auto;
  display: flex;
  gap: 26px;
  overflow-x: auto;
  scrollbar-width: none;
}
.nav-links::-webkit-scrollbar { display: none; }

.nav-links a {
  position: relative;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ink-2);
  white-space: nowrap;
  padding: 4px 0;
  transition: color 0.2s;
}
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1.5px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.35s var(--ease);
}
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--ink); }
.nav-links a:hover::after, .nav-links a[aria-current="page"]::after {
  transform: scaleX(1);
  transform-origin: left;
}


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

.hero {
  position: relative;
  padding-top: clamp(104px, 14vh, 140px);
  padding-bottom: clamp(24px, 4vh, 48px);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: clamp(32px, 6vw, 96px);
  align-items: end;
  margin-top: 28px;
  padding-top: 28px;
  border-top: 1px solid var(--rule);
}

.hero-name {
  margin: 0;
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(2.5rem, 4.6vw, 3.6rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  font-optical-sizing: auto;
}

.hero-lede {
  margin: 0;
  max-width: 36ch;
  font-size: clamp(1.1rem, 1.5vw, 1.28rem);
  line-height: 1.5;
  color: var(--ink);
}
.hero-lede mark {
  color: inherit;
  background: none;
}

.hero-now {
  margin: 14px 0 0;
  max-width: 46ch;
  color: var(--ink-2);
  font-size: 0.98rem;
}

.hero-sub {
  margin: 0 0 28px;
  max-width: 46ch;
  color: var(--ink-2);
  font-size: 0.98rem;
}

.actions { display: flex; flex-wrap: wrap; gap: 10px; }

.btn {
  display: inline-flex;
  align-items: center;
  padding: 11px 20px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  font-size: 0.92rem;
  font-weight: 500;
  line-height: 1;
  transition: background-color 0.25s var(--ease), color 0.25s var(--ease), border-color 0.25s, transform 0.25s var(--ease);
}
.btn:hover { background: var(--ink); color: var(--paper); transform: translateY(-2px); }
.btn-solid { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn-solid:hover { background: var(--ink); border-color: var(--ink); }

/* portrait */
.portrait {
  position: relative;
  margin: 0 12px 0 0;
  width: clamp(180px, 17vw, 230px);
  flex-shrink: 0;
}
.portrait::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  aspect-ratio: 4 / 5;
  border: 1px solid var(--ink);
  transform: translate(10px, 10px);
  opacity: 0;
  animation: fade-in 0.8s var(--ease) 1s forwards;
}
.portrait-frame {
  position: relative;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: var(--accent);
  clip-path: inset(100% 0 0 0);
  animation: wipe 1.2s var(--ease) 0.25s forwards;
}
.portrait-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 44% 50%;
  transform: scale(1.12);
  animation: settle 1.8s var(--ease) 0.25s forwards;
}
@keyframes wipe { to { clip-path: inset(0 0 0 0); } }
@keyframes settle { to { transform: scale(1); } }
@keyframes fade-in { to { opacity: 1; } }


.cv-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 40px;
}


/* entrance */
.rise {
  opacity: 0;
  transform: translateY(24px);
  animation: rise 0.9s var(--ease) forwards;
  animation-delay: calc(var(--d, 0) * 90ms + 100ms);
}
@keyframes rise { to { opacity: 1; transform: none; } }

.js .reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
  transition-delay: var(--stagger, 0ms);
}
.js .reveal.in { opacity: 1; transform: none; }

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

.section { padding-top: clamp(64px, 8vw, 104px); }

.section-head {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px 22px;
  margin-bottom: clamp(24px, 3.5vw, 40px);
  padding-top: 16px;
  border-top: 1px solid var(--ink);
}
.section-no {
  font-size: 0.8rem;
  color: var(--accent-ink);
  letter-spacing: 0.1em;
}
.section-head h2 {
  margin: 0;
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(1.7rem, 2.8vw, 2.2rem);
  line-height: 1.1;
  letter-spacing: -0.015em;
}
.section-note {
  margin: 0 0 0 auto;
  font-size: 0.74rem;
  color: var(--ink-3);
  letter-spacing: 0.04em;
}

/* research themes */
.themes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-bottom: 1px solid var(--rule);
}
.theme {
  position: relative;
  padding: 8px clamp(20px, 3vw, 40px) 36px;
  border-left: 1px solid var(--rule);
}
.theme:first-child { border-left: 0; padding-left: 0; }
.theme:last-child { padding-right: 0; }
.theme-no {
  display: block;
  font-family: var(--display);
  font-size: 1.5rem;
  line-height: 1;
  color: var(--accent);
  margin-bottom: 16px;
}
.theme h3 {
  margin: 0 0 12px;
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.3rem;
  line-height: 1.2;
  letter-spacing: -0.01em;
}
.theme p { margin: 0 0 18px; color: var(--ink-2); font-size: 0.98rem; }
.theme .theme-refs { margin: 0; font-family: var(--mono); font-size: 0.75rem; color: var(--ink-3); }
.theme-refs a { color: var(--ink); }

/* news */
.news { list-style: none; margin: 0; padding: 0; }
.news li {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 24px;
  padding: 18px 0;
  border-bottom: 1px solid var(--rule);
}
.news li:first-child { padding-top: 0; }
.news time {
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
  padding-top: 0.3em;
}
.news li:first-child time { color: var(--accent-ink); }
.news p { margin: 0; font-size: 1.05rem; }
.news strong { font-weight: 600; }
.news a { color: var(--ink); background-image: linear-gradient(var(--rule), var(--rule)); }
.news em { font-style: normal; }

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

.pub {
  position: relative;
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  gap: 24px;
  padding: 26px 0 26px;
  border-bottom: 1px solid var(--rule);
}
.pub::before {
  content: "";
  position: absolute;
  left: 0; top: -1px;
  width: 0; height: 2px;
  background: var(--accent);
  transition: width 0.5s var(--ease);
}
.pub:hover::before { width: 100%; }

.pub-num { color: var(--ink-3); letter-spacing: 0.04em; }
.pub-venue {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent-ink);
  padding-top: 0.35em;
}
.pub-badge {
  font-style: normal;
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
}
.pub-title {
  margin: 0 0 8px;
  font-family: var(--display);
  font-weight: 560;
  font-size: clamp(1.1rem, 1.5vw, 1.28rem);
  line-height: 1.25;
  letter-spacing: -0.012em;
}
.pub-title a { transition: color 0.2s; }
.pub-title a:hover { color: var(--accent-ink); }
.pub-authors { margin: 0 0 10px; font-size: 0.93rem; color: var(--ink-2); line-height: 1.55; }
.pub-authors .me {
  color: var(--ink);
  font-weight: 650;
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}
.pub-links { margin: 0; display: flex; gap: 18px; font-size: 0.76rem; letter-spacing: 0.04em; }
.pub-links a { color: var(--ink-3); background: none; transition: color 0.2s; }
.pub-links a:hover { color: var(--accent-ink); }

.more {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 20px;
  padding: 18px 0;
  border-bottom: 1px solid var(--ink);
  font-family: var(--display);
  font-size: clamp(1.15rem, 1.6vw, 1.35rem);
  letter-spacing: -0.01em;
}
.more-arrow {
  font-style: normal;
  font-family: var(--sans);
  transition: transform 0.4s var(--ease);
}
.more:hover { color: var(--accent-ink); }
.more:hover .more-arrow { transform: translateX(10px); }

/* experience */
.cols {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(32px, 6vw, 88px);
}
.col-title {
  margin: 0 0 8px;
  font-family: var(--mono);
  font-weight: 400;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.entries { list-style: none; margin: 0; padding: 0; }
.entry {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  gap: 18px;
  align-items: start;
  padding: 20px 0;
  border-bottom: 1px solid var(--rule);
}
.entry-logo {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: var(--logo-bg);
  border: 1px solid var(--rule);
  display: grid;
  place-items: center;
  overflow: hidden;
}
.entry-logo img {
  width: 88%; height: 88%;
  object-fit: contain;
}
.entry-body p { margin: 0; }
.entry-org {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.18rem;
  line-height: 1.25;
}
.entry-role { color: var(--ink-2); font-size: 0.95rem; }
.entry-detail { color: var(--ink-3); font-size: 0.88rem; margin-top: 4px !important; }
.entry-period {
  font-size: 0.74rem;
  color: var(--ink-3);
  white-space: nowrap;
  padding-top: 0.45em;
}


/* ---------- Inner pages ---------- */

.page-head { padding-top: clamp(104px, 14vh, 140px); padding-bottom: 16px; }
.page-title {
  margin: 0 0 24px;
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(2.5rem, 4.6vw, 3.6rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
}
.page-note { margin: 0 0 36px; font-size: 0.8rem; color: var(--ink-3); letter-spacing: 0.02em; }

.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 8px 15px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: transparent;
  color: var(--ink-2);
  font-size: 0.76rem;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: all 0.25s var(--ease);
}
.chip:hover { border-color: var(--ink); color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.chip-me[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }

.pub-years { padding-top: 40px; }
.year-group {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 24px;
  border-top: 1px solid var(--ink);
  margin-bottom: 56px;
}
.year-group[hidden] { display: none; }
.year {
  position: sticky;
  top: 84px;
  align-self: start;
  margin: 0;
  padding-top: 18px;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(1.6rem, 2.4vw, 2rem);
  letter-spacing: -0.015em;
  line-height: 1;
  color: var(--accent);
}
.pub-years .pub { grid-template-columns: 150px minmax(0, 1fr); }
.pub[hidden] { display: none; }
.empty { color: var(--ink-3); font-family: var(--mono); font-size: 0.85rem; }

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

.footer {
  margin-top: clamp(80px, 10vw, 128px);
  padding: clamp(48px, 6vw, 72px) 0 32px;
  background: var(--footer-bg);
  color: var(--footer-ink);
  border-top: 1px solid var(--rule);
}
.footer-kicker {
  margin: 0 0 12px;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.6;
}
.footer-mail {
  display: inline-block;
  font-family: var(--display);
  font-size: clamp(1.35rem, 2.6vw, 2rem);
  line-height: 1.2;
  letter-spacing: -0.01em;
  word-break: break-all;
  background: linear-gradient(var(--accent), var(--accent)) 0 100% / 0% 3px no-repeat;
  transition: background-size 0.6s var(--ease), color 0.3s;
}
.footer-mail:hover { background-size: 100% 3px; color: var(--accent); }
.footer-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px 24px;
  margin-top: clamp(36px, 5vw, 56px);
  padding-top: 20px;
  border-top: 1px solid color-mix(in srgb, var(--footer-ink) 20%, transparent);
  font-size: 0.76rem;
  opacity: 0.75;
}
.footer-links { display: flex; gap: 22px; }
.footer-links a:hover { color: var(--accent); }
.footer-updated { margin: 10px 0 0; font-size: 0.7rem; opacity: 0.45; }

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

@media (max-width: 960px) {
  .hero-grid { grid-template-columns: 1fr; align-items: start; }
  .cv-head { flex-direction: column-reverse; align-items: flex-start; }
  .portrait { width: 160px; margin: 0; }
  .themes { grid-template-columns: 1fr; border-bottom: 0; }
  .theme, .theme:first-child, .theme:last-child {
    border-left: 0;
    border-bottom: 1px solid var(--rule);
    padding: 24px 0 28px;
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr);
    column-gap: 8px;
  }
  .theme-no { grid-row: span 3; margin: 0; font-size: 1.3rem; }
  .cols { grid-template-columns: 1fr; }
  .year-group { grid-template-columns: 1fr; gap: 0; }
  .year { position: static; padding-bottom: 8px; }
}

@media (max-width: 640px) {
  body { font-size: 16px; }
  .nav-inner { gap: 16px; }
  .nav-links { gap: 18px; }
  .nav-links a { font-size: 0.84rem; }
  .portrait { width: 130px; }
  .nav-anchor { display: none; }
  .news li { grid-template-columns: 1fr; gap: 4px; }
  .pub, .pub-years .pub { grid-template-columns: 1fr; gap: 8px; padding: 22px 0; }
  .pub-venue { flex-direction: row; align-items: center; gap: 10px; }
  .entry { grid-template-columns: 40px minmax(0, 1fr); }
  .entry-logo { width: 40px; height: 40px; }
  .entry-period { grid-column: 2; padding-top: 0; }
  .section-note { margin-left: 0; width: 100%; }
}

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