
/* ── Reset & base ─────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, sans-serif;
  font-size: 16px; line-height: 1.65;
  color: #1a1a1a; background: #fff;
}
a { color: #FF6C0C; text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; display: block; }

/* ── Layout ───────────────────────────────────────────────────────────── */
.container { max-width: 1140px; margin: 0 auto; padding: 0 1.5rem; }
.section    { padding: 3.5rem 0; }
.section + .section { border-top: 1px solid #eee; }

/* ── Top bar: Caltech logo strip ──────────────────────────────────────── */
.topbar {
  background: #fff; border-bottom: 1px solid #e0e0e0;
  padding: .65rem 0;
}
.topbar .container {
  display: flex; align-items: center; gap: 1.5rem;
}
.topbar-logo { flex-shrink: 0; }
.topbar-logo img { height: 34px; width: auto; max-width: none; flex-shrink: 0; }
.topbar-divider {
  width: 1px; height: 28px; background: #ccc; flex-shrink: 0;
}
.topbar-group {
  font-size: 1.25rem; font-weight: 500; color: #555;
  letter-spacing: .01em; min-width: 0;   /* allow it to wrap on narrow screens */
}

/* ── Nav ──────────────────────────────────────────────────────────────── */
nav {
  background: #1a1a1a;
  position: sticky; top: 0; z-index: 100;
}
nav .container {
  display: flex; align-items: center;
  justify-content: flex-end;
  height: 48px;
}
.nav-links { display: flex; gap: 0; list-style: none; }
.nav-links a {
  color: #ccc; font-size: .88rem; padding: .55rem .85rem;
  display: block; letter-spacing: .03em; transition: color .15s;
}
.nav-links a:hover, .nav-links a.active { color: #fff; text-decoration: none; }
.nav-links a.active { border-bottom: 2px solid #FF6C0C; }

/* ── Flow image banner ────────────────────────────────────────────────── */
.banner {
  background: #fec91e;   /* matches left edge of flow_header.png */
  height: 81px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: flex-end;   /* image hugs the right */
}
.banner img {
  height: 81px;
  width: auto;          /* natural aspect ratio, no upscaling */
  display: block;
  flex-shrink: 0;
}

/* ── Hero (PI card) ───────────────────────────────────────────────────── */
.hero {
  background: #f4f4f4;
  border-bottom: 1px solid #e4e4e4;
  padding: 1.6rem 0;
}
.hero-inner {
  display: flex; gap: 2rem; align-items: flex-start;
}
.hero-photo-col {        /* photo with the contact buttons centered beneath */
  flex-shrink: 0;
  display: flex; flex-direction: column; align-items: center;
}
.hero-photo {
  width: 130px; min-width: 130px; border-radius: 6px;
  box-shadow: 0 2px 12px rgba(0,0,0,.15);
}
.hero-photo-placeholder {
  width: 130px; min-width: 130px; height: 163px;
  background: #ddd; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  color: #999; font-size: .8rem; text-align: center;
}
.hero-text h1 { font-size: 1.25rem; font-weight: 500; margin-bottom: .25rem; color: #555; }
.hero-text .subtitle {
  color: #555; font-size: .95rem; font-weight: 600; font-style: italic; margin-bottom: .15rem;
}
.hero-text .institution { color: #777; font-size: .88rem; margin-bottom: 1rem; }
.hero-text p { color: #333; font-size: .93rem; margin-bottom: .8rem; }
.inline-rainbow { display: inline-block; height: 1.15em; width: auto; vertical-align: -0.2em; margin-left: .25em; }
.hero-links { display: flex; gap: .45rem; flex-wrap: wrap; margin-top: .85rem; }
.hero-links .chip {
  background: #fff; border: 1px solid #ccc; border-radius: 5px;
  height: 40px; padding: 0 .55rem;
  display: inline-flex; align-items: center; justify-content: center;
  color: #4285F4; font-weight: 600; font-size: .92rem;
  transition: border-color .15s;
}
.hero-links .chip:hover { border-color: #4285F4; text-decoration: none; }
.hero-links .chip svg { width: 24px; height: 24px; fill: currentColor; display: block; }
.hero-links .chip img { width: 28px; height: 28px; display: block; }
.btn {
  padding: .42rem 1.1rem; border-radius: 4px; font-size: .87rem;
  font-weight: 600; display: inline-block; transition: opacity .15s;
}
.btn:hover { opacity: .85; text-decoration: none; }
.btn-primary { background: #FF6C0C; color: #fff; }
.btn-outline { border: 1px solid #bbb; color: #444; background: transparent; }

/* ── Section headings ─────────────────────────────────────────────────── */
h2 {
  font-size: 1.45rem; font-weight: 700; margin-bottom: 1.5rem;
  padding-bottom: .5rem; border-bottom: 2px solid #FF6C0C; display: inline-block;
}
h3 { font-size: 1.1rem; font-weight: 700; margin-bottom: .4rem; }

/* ── Cards ────────────────────────────────────────────────────────────── */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.5rem; margin-top: 1rem;
}
.card {
  border: 1px solid #e8e8e8; border-radius: 8px;
  padding: 1.4rem; background: #fafafa;
  transition: box-shadow .15s;
}
.card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.08); }
.card h3 { color: #1a1a1a; margin-bottom: .25rem; }
.card .meta { color: #888; font-size: .83rem; margin-bottom: .7rem; }
.card p { font-size: .9rem; color: #444; }

/* ── People grid ──────────────────────────────────────────────────────── */
.people-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1.5rem; margin-top: 1rem;
}
.person-card { text-align: center; }
.person-photo {
  width: 100%; aspect-ratio: 3/4; object-fit: cover;
  border-radius: 6px; margin-bottom: .6rem;
  background: #eee;
}
.person-photo-placeholder {
  width: 100%; aspect-ratio: 3/4;
  background: linear-gradient(135deg, #e8e8e8, #d0d0d0);
  border-radius: 6px; margin-bottom: .6rem;
  display: flex; align-items: center; justify-content: center;
  color: #aaa; font-size: 2rem;
}
.person-name { font-weight: 600; font-size: .9rem; margin-bottom: .15rem; }
.person-role { color: #888; font-size: .8rem; }

/* ── Alumni table ─────────────────────────────────────────────────────── */
.alumni-list { width: 100%; border-collapse: collapse; margin-top: 1rem; font-size: .9rem; }
.alumni-list th {
  text-align: left; padding: .4rem .75rem;
  border-bottom: 2px solid #eee; color: #888; font-size: .8rem;
  font-weight: 600; letter-spacing: .03em;
}
.alumni-list td { padding: .45rem .75rem; border-bottom: 1px solid #f0f0f0; }
.alumni-list tr:last-child td { border-bottom: none; }
.alumni-list .alum-year { color: #888; white-space: nowrap; }
.alumni-list .alum-thesis { color: #555; font-style: italic; font-size: .85rem; }
.alumni-list .alum-position { color: #444; font-size: .85rem; }

/* ── Research areas ───────────────────────────────────────────────────── */
.research-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem; margin-top: 1rem;
}
.research-card {
  position: relative;
  border: 1px solid #e8e8e8; border-radius: 8px; overflow: hidden;
  background: #fafafa; transition: box-shadow .15s;
}
.research-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.08); }
.research-card:focus { outline: 2px solid #FF6C0C; outline-offset: 2px; }
.rc-img { width: 100%; height: 230px; object-fit: contain; display: block; background: #fff;
  transition: filter .18s ease; }
.rc-img-placeholder {
  width: 100%; height: 230px;
  background: linear-gradient(135deg, #e8eff8, #c8d8e8);
  display: flex; align-items: center; justify-content: center;
  color: #8a9bb0; font-size: .82rem; text-align: center; padding: 1rem;
  transition: filter .18s ease;
}
.rc-body { padding: .85rem 1.2rem; }
.rc-body h3 { font-size: 1.05rem; margin-bottom: 0; }
.rc-more { display: inline-block; margin-top: .55rem; font-size: .82rem; font-weight: 600; }
/* Mouse devices: hover greys/dims the figure and reveals the blurb over it */
.research-card:hover .rc-img,  .research-card:focus-within .rc-img,
.research-card:hover .rc-img-placeholder, .research-card:focus-within .rc-img-placeholder {
  filter: grayscale(100%) brightness(.45);
}
.rc-blurb {
  position: absolute; top: 0; left: 0; right: 0; height: 230px; margin: 0;
  color: #fff; background: rgba(0,0,0,.25); text-shadow: 0 1px 3px rgba(0,0,0,.7);
  font-size: .8rem; line-height: 1.45; padding: .9rem 1.2rem; overflow: hidden;
  display: flex; flex-direction: column; justify-content: center;
  opacity: 0; transition: opacity .18s ease;
}
.rc-blurb p { margin-bottom: .5rem; }
.rc-blurb p:last-child { margin-bottom: 0; }
.research-card:hover .rc-blurb, .research-card:focus-within .rc-blurb { opacity: 1; }
/* Touch devices (no hover): show the blurb inline below the title, always visible */
@media (hover: none) {
  .rc-blurb {
    position: static; height: auto; opacity: 1; display: block;
    color: #444; background: none; text-shadow: none;
    padding: 0; margin-top: .5rem; font-size: .88rem;
  }
  .research-card:hover .rc-img, .research-card:focus-within .rc-img,
  .research-card:hover .rc-img-placeholder, .research-card:focus-within .rc-img-placeholder {
    filter: none;
  }
}

/* ── Software cards ───────────────────────────────────────────────────── */
.software-card {
  border: 1px solid #e8e8e8; border-radius: 8px;
  padding: 1.8rem; background: #fafafa;
  margin-bottom: 1.5rem;
  transition: box-shadow .15s;
}
.software-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.08); }
.software-card h3 { font-size: 1.2rem; color: #1a1a1a; margin-bottom: .3rem; }
.software-card .sw-tagline {
  color: #FF6C0C; font-size: .9rem; font-weight: 600; margin-bottom: .75rem;
}
.software-card p { font-size: .93rem; color: #444; margin-bottom: .7rem; max-width: 680px; }
.software-links { display: flex; gap: .75rem; flex-wrap: wrap; margin-top: 1rem; }

/* ── Publications ─────────────────────────────────────────────────────── */
.pub-filter {
  display: flex; gap: .75rem; margin-bottom: 1.5rem; flex-wrap: wrap;
  align-items: center;
}
.pub-filter input {
  padding: .4rem .75rem; border: 1px solid #ccc; border-radius: 4px;
  font-size: .9rem; flex: 1; min-width: 200px;
}
.pub-chips { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.1rem; }
.pub-chip {
  border: 1px solid #ddd; background: #fff; color: #555;
  font-size: .8rem; padding: .32rem .85rem; border-radius: 999px;
  cursor: pointer; transition: background .15s, border-color .15s, color .15s;
}
.pub-chip:hover { border-color: #FF6C0C; color: #FF6C0C; }
.pub-chip.active { background: #FF6C0C; border-color: #FF6C0C; color: #fff; }
.pub-year-hdr { font-size: 1.1rem; font-weight: 700; color: #888;
  margin: 1.5rem 0 .6rem; border-bottom: 1px solid #eee; padding-bottom: .3rem; }
.pub-entry { padding: .6rem 0; border-bottom: 1px solid #f0f0f0; }
.pub-entry:last-child { border-bottom: none; }
.pub-title { font-weight: 600; font-size: .93rem; }
.pub-authors { color: #555; font-size: .85rem; margin: .15rem 0; }
.pub-venue { color: #777; font-size: .85rem; font-style: italic; }
.pub-links { margin-top: .25rem; font-size: .82rem; }
.pub-links a { color: #b1540a; margin-right: .75rem; }

/* ── Footer ───────────────────────────────────────────────────────────── */
footer {
  background: #1a1a1a; color: #888; font-size: .82rem;
  padding: 2rem 0; margin-top: 4rem;
}
footer .container { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
footer a { color: #aaa; }

/* ── Responsive ───────────────────────────────────────────────────────── */
@media (max-width: 680px) {
  .hero-inner { flex-direction: column; }
  .hero-photo, .hero-photo-placeholder { width: 120px; min-width: 120px; }
  .nav-links a { padding: .55rem .5rem; font-size: .8rem; }
  .topbar-group { font-size: 1.05rem; line-height: 1.25; }
  .banner { height: 56px; }
  .banner img { height: 75px; }
  .alumni-list th:nth-child(3), .alumni-list td:nth-child(3) { display: none; }
}
