/* ---------- tokens ---------- */
:root {
  --paper: #ffffff;
  --paper-2: #f2f2f0;
  --ink: #111111;
  --ink-2: #262626;
  --muted: #555555;
  --rule: #d9d9d6;
  --accent: #075c55;
  --accent-ink: #ffffff;
  --accent-soft: #e3efec;
  --shadow: 0 1px 2px rgba(27, 26, 23, .05), 0 8px 24px -12px rgba(27, 26, 23, .18);
  --display: 'Manrope', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; /* headings */
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --wrap: 1100px;
  --radius: 10px;
  color-scheme: light;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 17px/1.65 var(--sans);
  font-feature-settings: 'ss01', 'cv11';
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
h1, h2, h3 { font-family: var(--display); font-weight: 500; line-height: 1.15; letter-spacing: -.015em; margin: 0; }
p { margin: 0 0 1em; }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding-inline: 24px; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 12px; z-index: 100; background: var(--ink); color: var(--paper); padding: 8px 12px; border-radius: 6px; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--paper) 85%, transparent);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
}
.site-header.scrolled { border-bottom-color: var(--rule); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 68px; }
.brand { font-family: var(--display); font-size: 19px; font-weight: 600; color: var(--ink); text-decoration: none; letter-spacing: -.01em; white-space: nowrap; }
.brand:hover { color: var(--accent); }
.nav { display: flex; gap: 4px; }
.nav a {
  color: var(--ink-2); text-decoration: none; font-size: 14.5px; font-weight: 500;
  padding: 7px 12px; border-radius: 999px; transition: background .15s, color .15s;
}
.nav a:hover { background: var(--paper-2); color: var(--ink); }
.nav a[aria-current] { color: var(--ink); background: var(--paper-2); }
.menu-btn { display: none; background: none; border: 0; padding: 8px; margin-right: -8px; color: var(--ink); cursor: pointer; }
.menu-btn svg { display: block; }

@media (max-width: 760px) {
  .menu-btn { display: block; }
  .nav {
    position: absolute; left: 0; right: 0; top: 68px;
    flex-direction: column; gap: 0; padding: 8px 16px 16px;
    background: var(--paper); border-bottom: 1px solid var(--rule);
    display: none;
  }
  .nav.open { display: flex; }
  .nav a { padding: 12px 8px; border-radius: 8px; font-size: 16px; }
}

/* ---------- shared bits ---------- */
main { padding-bottom: 96px; }
.section { padding-top: 72px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 28px; padding-bottom: 14px; border-bottom: 1px solid var(--rule); }
.section-head h2 { font-size: clamp(28px, 3.4vw, 36px); }
.section-head .aside { color: var(--muted); font-size: 14px; }
.eyebrow { font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); margin: 0 0 14px; }
.lede { font-size: 19px; color: var(--ink-2); max-width: 62ch; }

.btn {
  display: inline-flex; align-items: center; gap: 7px;
  font: 500 14px/1 var(--sans); text-decoration: none;
  padding: 10px 15px; border-radius: 999px;
  border: 1px solid var(--rule); color: var(--ink); background: var(--paper);
  transition: border-color .15s, background .15s, color .15s, transform .15s;
}
.btn:hover { border-color: var(--ink-2); text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.08); }
.btn svg { width: 15px; height: 15px; flex: none; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }

.chip { display: inline-block; font-size: 12.5px; color: var(--ink-2); background: var(--paper-2); border-radius: 999px; padding: 3px 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---------- hero ---------- */
.hero { padding-top: 64px; display: grid; grid-template-columns: 1.15fr 1fr; gap: 56px; align-items: center; }
.hero h1 { font-size: clamp(42px, 6vw, 70px); font-weight: 500; letter-spacing: -.035em; margin-bottom: 22px; }
.hero .lede { margin-bottom: 30px; }
.hero-photo { position: relative; }
.hero-photo img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; object-position: 66% 50%; border-radius: 16px; box-shadow: var(--shadow); }
.hero-photo figcaption { margin-top: 10px; font-size: 13px; color: var(--muted); }
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; gap: 36px; padding-top: 40px; }
  .hero-photo { order: -1; }
  .hero-photo img { aspect-ratio: 3 / 2; object-position: 50% 50%; }
}

/* ---------- about ---------- */
.about { display: grid; grid-template-columns: 1.35fr 1fr; gap: 56px; }
.about .bio p { font-size: 17px; color: var(--ink-2); }
.about .bio p:first-child { font-size: 19px; color: var(--ink); }
.facts { list-style: none; margin: 0; padding: 0; }
.facts li { padding: 14px 0; border-top: 1px solid var(--rule); }
.facts li:first-child { border-top: 0; padding-top: 0; }
.facts .k { display: block; font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 2px; }
.facts .v { font-family: var(--display); font-size: 19px; line-height: 1.3; }
.facts .n { display: block; font-size: 14px; color: var(--muted); }
@media (max-width: 860px) { .about { grid-template-columns: 1fr; gap: 32px; } }

/* ---------- featured research ---------- */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px 24px; }
.card { display: block; color: inherit; text-decoration: none; }
.card .thumb { overflow: hidden; border-radius: var(--radius); background: var(--paper-2); aspect-ratio: 3 / 2; }
.card .thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s cubic-bezier(.2, .7, .2, 1); }
.card:hover .thumb img { transform: scale(1.04); }
/* Show the whole image, like the Publications list */
.cards.fit .thumb { background: #fff; border: 1px solid var(--rule); }
.cards.fit .thumb img { object-fit: contain; padding: 10px; }
.card h3 { font-size: 20px; margin: 14px 0 4px; transition: color .15s; }
.card:hover h3 { color: var(--accent); }
.card p { color: var(--ink-2); font-size: 15px; margin: 0 0 6px; }
.card .venue { font-size: 13px; color: var(--muted); }
@media (max-width: 900px) { .cards { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .cards { grid-template-columns: 1fr; } }

/* ---------- publications ---------- */
.year-group { display: grid; grid-template-columns: 88px 1fr; gap: 0 24px; }
.year-group + .year-group { margin-top: 8px; }
.year { font-family: var(--display); font-weight: 400; font-size: 22px; color: var(--muted); padding-top: 22px; position: sticky; top: 76px; align-self: start; }
.pubs { list-style: none; margin: 0; padding: 0; }
.pub { display: grid; grid-template-columns: 168px 1fr; gap: 24px; padding: 22px 0; border-top: 1px solid var(--rule); }
.year-group:first-child .pub:first-child { border-top: 0; }
.pub .pthumb { border-radius: 8px; overflow: hidden; background: #fff; aspect-ratio: 4 / 3; border: 1px solid var(--rule); }
.pub .pthumb img { width: 100%; height: 100%; object-fit: contain; }
.pub .pthumb.empty { display: grid; place-items: center; color: var(--muted); font-family: var(--display); font-size: 15px; background: var(--paper-2); }
.pub h3 { font-size: 19px; line-height: 1.25; margin-bottom: 6px; }
.pub h3 a { color: var(--ink); text-decoration: none; }
.pub h3 a:hover { color: var(--accent); }
.pub .authors { font-size: 14.5px; color: var(--ink-2); margin: 0 0 4px; }
.pub .authors b { color: var(--ink); font-weight: 600; }
.pub .where { font-size: 14px; color: var(--muted); margin: 0 0 12px; }
.pub .where .badge { color: var(--accent); font-weight: 600; margin-right: 6px; }
.pub .btn { padding: 7px 12px; font-size: 13px; }
.pub .credit { font-size: 11.5px; color: var(--muted); margin-top: 6px; display: inline-block; }
@media (max-width: 760px) {
  .year-group { grid-template-columns: 1fr; }
  .year { position: static; padding-top: 18px; font-size: 20px; }
  .pub { grid-template-columns: 96px 1fr; gap: 16px; }
  .pub h3 { font-size: 17px; }
}


/* ---------- page header ---------- */
.page-head { padding-top: 56px; padding-bottom: 8px; }
.page-head h1 { font-size: clamp(40px, 5.6vw, 64px); font-weight: 500; letter-spacing: -.035em; margin-bottom: 16px; }
.crumb { font-size: 14px; margin-bottom: 18px; display: inline-flex; align-items: center; gap: 6px; text-decoration: none; color: var(--muted); }
.crumb:hover { color: var(--accent); }

/* ---------- project page ---------- */
.project-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-bottom: 8px; color: var(--muted); font-size: 15px; }
.project-meta .venue { color: var(--accent); font-weight: 600; }
.media { margin-top: 36px; display: grid; gap: 20px; }
.media.two { grid-template-columns: 1fr 1fr; }
@media (max-width: 760px) { .media.two { grid-template-columns: 1fr; } }
.video { position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; background: #000; box-shadow: var(--shadow); }
.video iframe, .video img { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; object-fit: cover; }
.video button { all: unset; position: absolute; inset: 0; cursor: pointer; display: grid; place-items: center; }
.video button::after {
  content: ''; width: 72px; height: 72px; border-radius: 50%;
  background: rgba(0, 0, 0, .62) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M8 5v14l11-7z'/%3E%3C/svg%3E") 55% 50% / 30px no-repeat;
  backdrop-filter: blur(4px); transition: transform .2s, background-color .2s;
}
.video button:hover::after { transform: scale(1.08); background-color: var(--accent); }
.video img { transition: opacity .2s; transform: scale(1.04); }
.video button:hover img { opacity: .9; }

.project-body { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 64px; margin-top: 48px; }
.prose { font-size: 17.5px; color: var(--ink-2); max-width: 68ch; }
.prose strong { color: var(--ink); font-weight: 600; }
.side { font-size: 15px; }
.side h4 { font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 0 0 8px; }
.side > div + div { margin-top: 24px; padding-top: 24px; border-top: 1px solid var(--rule); }
.side .paper-title { font-family: var(--display); font-size: 18px; line-height: 1.3; color: var(--ink); margin: 0 0 4px; }
.side .paper-venue { color: var(--muted); font-size: 14px; margin: 0 0 12px; }
.side .btn { padding: 7px 12px; font-size: 13px; }
@media (max-width: 900px) { .project-body { grid-template-columns: 1fr; gap: 36px; } }

.timeline { list-style: none; margin: 32px 0 0; padding: 0; border-left: 2px solid var(--rule); }
.timeline li { position: relative; padding: 0 0 26px 24px; }
.timeline li::before { content: ''; position: absolute; left: -7px; top: 7px; width: 12px; height: 12px; border-radius: 50%; background: var(--paper); border: 2px solid var(--accent); }
.timeline .when { font-size: 13px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }
.timeline .what { font-family: var(--display); font-size: 20px; color: var(--ink); margin: 2px 0 4px; }
.timeline p { margin: 0; font-size: 16px; }

.gallery { margin-top: 56px; columns: 3 260px; column-gap: 16px; }
.gallery figure { margin: 0 0 20px; break-inside: avoid; }
.gallery a { display: block; border-radius: 8px; overflow: hidden; background: var(--paper-2); }
/* Captioned galleries: even grid of identical tiles */
.gallery.grid { columns: auto; display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px 24px; }
.gallery.grid figure { margin: 0; }
.gallery.grid .ph { position: relative; aspect-ratio: 4 / 3; background: #fff; border: 1px solid var(--rule); }
.gallery.grid .ph img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; padding: 12px; }
.gallery.grid a:hover img { transform: scale(1.02); }
.gallery.grid figcaption { font-size: 14px; margin-top: 12px; }
@media (max-width: 900px) { .gallery.grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .gallery.grid { grid-template-columns: 1fr; } }
.gallery figcaption { margin-top: 8px; font-size: 13.5px; line-height: 1.5; color: var(--ink-2); }
.gallery img { width: 100%; transition: transform .5s cubic-bezier(.2, .7, .2, 1), opacity .2s; }
.gallery a:hover img { transform: scale(1.03); }

.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 72px; padding-top: 28px; border-top: 1px solid var(--rule); }
.pager a { text-decoration: none; color: var(--ink); padding: 4px 0; }
.pager a span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 2px; }
.pager a strong { font-family: var(--display); font-size: 22px; font-weight: 500; }
.pager a:hover strong { color: var(--accent); }
.pager .next { text-align: right; grid-column: 2; }

/* ---------- CV ---------- */
.cv-rows { display: grid; }
.cv-row { display: grid; grid-template-columns: 190px 1fr; gap: 4px 28px; padding: 14px 0; border-top: 1px solid var(--rule); }
.cv-row:first-child { border-top: 0; padding-top: 0; }
.cv-row .when { color: var(--muted); font-size: 14.5px; padding-top: 2px; font-variant-numeric: tabular-nums; }
.cv-row .title { font-family: var(--display); font-size: 20px; line-height: 1.3; color: var(--ink); }
.cv-row .title span { color: var(--ink-2); }
.cv-row p { margin: 4px 0 0; color: var(--ink-2); font-size: 15.5px; }
.cv-row .what { font-weight: 600; color: var(--ink); }
.cv-row .where { color: var(--ink-2); }
.cv-row .where::before { content: ', '; }
@media (max-width: 640px) { .cv-row { grid-template-columns: 1fr; } }
.cv-pubs { padding-left: 1.3em; margin: 0; }
.cv-pubs li { margin-bottom: 12px; color: var(--ink-2); font-size: 15.5px; }
.cv-pubs li b { color: var(--ink); font-weight: 600; }
.cv-pubs .t { color: var(--ink); }
/* Compact lists: Awards, Service, Teaching, Mentoring, Press, Patents */
.section.tight { padding-top: 48px; }
.section.tight .section-head { margin-bottom: 14px; padding-bottom: 10px; }
.section.tight .section-head h2 { font-size: 26px; }
.section.tight { padding-top: 40px; }
.cv-rows.compact .cv-row { grid-template-columns: 120px 1fr; gap: 2px 20px; padding: 5px 0; border-top: 0; font-size: 15px; line-height: 1.5; }
.cv-rows.compact .cv-row .when { font-size: 14px; padding-top: 0; }
.cv-pubs.compact li { margin-bottom: 5px; font-size: 15px; }
@media (max-width: 640px) { .cv-rows.compact .cv-row { grid-template-columns: 1fr; gap: 0; padding: 6px 0; } }
.pub .pnote { color: var(--muted); font-style: italic; margin-left: 6px; }

/* ---------- contact ---------- */
.contact { display: grid; grid-template-columns: 1fr 1.1fr; gap: 64px; align-items: start; }
@media (max-width: 860px) { .contact { grid-template-columns: 1fr; gap: 40px; } }
.link-list { list-style: none; padding: 0; margin: 24px 0 0; }
.link-list a { display: flex; justify-content: space-between; align-items: center; padding: 16px 0; border-top: 1px solid var(--rule); color: var(--ink); text-decoration: none; font-size: 17px; }
.link-list li:last-child a { border-bottom: 1px solid var(--rule); }
.link-list a:hover { color: var(--accent); }
.link-list .lbl { display: inline-flex; align-items: center; gap: 12px; }
.link-list .si { width: 20px; height: 20px; flex: none; color: var(--ink-2); }
.link-list a:hover .si { color: var(--accent); }
.link-list a span { color: var(--muted); transition: transform .2s; }
.link-list a:hover span { transform: translateX(4px); color: var(--accent); }
form.contact-form { display: grid; gap: 14px; padding: 28px; border: 1px solid var(--rule); border-radius: 14px; background: var(--paper); box-shadow: var(--shadow); }
.contact-form label { display: grid; gap: 6px; font-size: 14px; font-weight: 500; color: var(--ink-2); }
.contact-form input, .contact-form textarea {
  font: inherit; font-size: 16px; color: var(--ink); background: var(--paper-2);
  border: 1px solid transparent; border-radius: 8px; padding: 12px 14px; width: 100%;
  transition: border-color .15s, background .15s;
}
.contact-form input:focus, .contact-form textarea:focus { outline: none; border-color: var(--accent); background: var(--paper); }
.contact-form textarea { min-height: 150px; resize: vertical; }
.contact-form .row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.contact-form .status { font-size: 14px; color: var(--muted); }
.contact-form button { cursor: pointer; font-size: 15px; padding: 12px 20px; }
.contact-form button[disabled] { opacity: .6; cursor: wait; }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--rule); padding: 32px 0 40px; color: var(--muted); font-size: 14px; }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 18px; }
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--accent); }

/* ---------- lightbox ---------- */
.lightbox { position: fixed; inset: 0; z-index: 100; background: rgba(12, 12, 11, .94); display: grid; place-items: center; padding: 56px 64px 120px; opacity: 0; pointer-events: none; transition: opacity .2s; }
.lightbox.open { opacity: 1; pointer-events: auto; }
.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 6px; }
.lightbox button { position: absolute; background: rgba(255, 255, 255, .1); color: #fff; border: 0; border-radius: 50%; width: 46px; height: 46px; font-size: 22px; line-height: 46px; text-align: center; cursor: pointer; transition: background .15s; }
.lightbox button:hover { background: rgba(255, 255, 255, .22); }
.lightbox .close { top: 16px; right: 16px; }
.lightbox .prev { left: 12px; top: 50%; transform: translateY(-50%); }
.lightbox .next { right: 12px; top: 50%; transform: translateY(-50%); }
.lightbox .cap { position: absolute; bottom: 44px; left: 50%; transform: translateX(-50%); width: min(760px, 90vw); text-align: center; color: #fff; font-size: 15px; line-height: 1.5; }
.lightbox .count { position: absolute; bottom: 18px; left: 0; right: 0; text-align: center; color: rgba(255, 255, 255, .7); font-size: 13px; }
@media (max-width: 600px) { .lightbox { padding: 64px 8px; } .lightbox .prev, .lightbox .next { top: auto; bottom: 8px; transform: none; } }

/* ---------- motion ---------- */
@media (prefers-reduced-motion: no-preference) {
  .reveal { animation: rise .7s cubic-bezier(.2, .7, .2, 1) both; }
  .reveal.d1 { animation-delay: .08s; }
  .reveal.d2 { animation-delay: .16s; }
  @keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }
