:root {
  --ink: rgb(46, 45, 41);
  --grey: rgb(90, 90, 90);
  --blue: #022851;
  --line: #ddd;
  --width: 960px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  max-width: var(--width);
  margin: 0 auto;
  padding: 3.6rem 1.35rem 5rem;
  font-family: "Source Sans 3", "Source Sans Pro", sans-serif;
  font-weight: 400;
  font-size: 17px;
  line-height: 1.45;
  letter-spacing: 0.2px;
  color: var(--grey);
  background: #fff;
}

h1, h2, h3, h4 {
  color: var(--ink);
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.15;
}

h1 {
  font-size: 50px;
  font-weight: 700;
  line-height: 1;
  margin: 0 0 0.7rem;
}

h2 {
  font-size: 1.45rem;
  margin: 2.4rem 0 0.7rem;
}

h3 {
  font-size: 1.05rem;
  margin: 1.4rem 0 0.35rem;
}

p { margin: 0 0 0.85rem; }

a {
  color: var(--ink);
  text-decoration: none;
}

a:hover { text-decoration: underline; }

.prose a,
.pubs a,
.grant-title a {
  color: var(--blue);
}

img { max-width: 100%; height: auto; }

#header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

#header .bar {
  max-width: var(--width);
  margin: 0 auto;
  padding: 0.65rem 1.35rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

#header nav {
  display: flex;
  gap: 1.7rem;
  width: min(28rem, 100%);
  justify-content: space-between;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: none;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  border-radius: 999px;
  padding: 5px 12px 5px 8px;
  font-family: inherit;
  font-size: 14px;
  cursor: pointer;
}

.theme-toggle .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #f6c445;
  box-shadow: 0 0 0 3px rgba(246, 196, 69, 0.28);
}

#header a {
  color: var(--grey);
  transition: color 0.2s ease;
}

#header a:hover,
#header a.current {
  color: var(--ink);
  text-decoration: none;
}

#header a.current { font-weight: 600; }

body.home {
  overflow-x: clip;
}

.hero {
  display: flex;
  align-items: flex-start;
  overflow: visible;
  position: relative;
  padding-top: 5.6rem;
  margin-bottom: 3em;
  min-height: 18rem;
}

.hero-copy {
  width: 58%;
  position: relative;
  z-index: 2;
}

.hero-copy p { max-width: 36rem; }

.accent { color: var(--blue); font-weight: 600; }

.hero-links {
  display: flex;
  gap: 1.6rem;
  margin-top: 2em;
  font-weight: 600;
  width: 60%;
  justify-content: space-between;
}

.hero-links a { color: var(--ink); }

.hero-media {
  width: 42%;
  position: relative;
  min-height: 16rem;
}

.hero-media video {
  position: absolute;
  top: -40px;
  left: 40px;
  width: 300px;
  max-width: none;
  height: auto;
  z-index: 1;
  clip-path: inset(1px);
  pointer-events: none;
}

.slideshow-container {
  position: relative;
  width: 100%;
  margin: 1.4rem 0 0.4rem;
  overflow: hidden;
  background: #111;
}

.mySlides {
  display: none;
}

.mySlides img {
  width: 100%;
  height: min(62vh, 520px);
  object-fit: cover;
  display: block;
}

.fade {
  animation: fade 1.2s ease;
}

@keyframes fade {
  from { opacity: 0.35; }
  to { opacity: 1; }
}

.occ {
  display: block;
  color: var(--grey);
  font-size: 0.95rem;
  margin-top: 0.08rem;
}

.robots {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(10.5rem, 1fr));
  gap: 1rem 0.85rem;
  margin: 0.6rem 0 0.4rem;
}

.robot {
  display: block;
  color: inherit;
  text-decoration: none;
}

.robot:hover { text-decoration: none; }

.robot img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
  background: #f3f3f3;
}

.robot-name {
  display: block;
  margin-top: 0.4rem;
  color: var(--ink);
  font-weight: 600;
}

.robot-role {
  display: block;
  font-size: 0.92rem;
  color: var(--grey);
  line-height: 1.25;
}

.faculty {
  display: flex;
  gap: 1.6rem;
  align-items: flex-start;
  margin-top: 1.6rem;
}

.faculty img {
  width: 168px;
  height: auto;
  flex: none;
}

.role {
  color: var(--ink);
  margin-bottom: 0.7rem;
}

.contact {
  margin: 0.2rem 0 0;
  padding: 0;
  list-style: none;
}

.contact li { margin: 0.1rem 0; }

.contact-block {
  list-style: none;
  margin: 0.4rem 0 1.2rem;
  padding: 0;
}

.contact-block li {
  margin: 0.55rem 0;
  line-height: 1.35;
}

.contact-block .label {
  display: inline-block;
  min-width: 9.5rem;
  color: var(--ink);
  font-weight: 600;
}

.people {
  list-style: none;
  margin: 0.2rem 0 0.4rem;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem 1.25rem;
}

.people li,
.person {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  margin: 0;
  line-height: 1.3;
  min-width: 0;
}

.person-photo,
.person-placeholder {
  width: 64px;
  height: 64px;
  flex: none;
  border-radius: 50%;
  object-fit: cover;
  object-position: center top;
  background: #e8e8e6;
}

.person-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--grey);
  letter-spacing: 0.02em;
}

.person-info {
  min-width: 0;
}

.person-info a {
  font-weight: 600;
  color: var(--ink);
}

.courses {
  list-style: none;
  margin: 0.2rem 0 0.6rem;
  padding: 0;
}

.courses li { margin: 0.45rem 0; }

.courses b { color: var(--ink); font-weight: 600; }

.project {
  display: flex;
  gap: 1.3rem;
  align-items: flex-start;
  margin: 0 0 1.5rem;
  padding-top: 1.15rem;
  border-top: 1px solid var(--line);
}

.project h3 {
  margin: 0 0 0.25rem;
  font-weight: 600;
  font-size: 1.05rem;
}

.project h3 a { color: var(--ink); }

.project p { margin: 0; }

.thumb {
  width: 9.2rem;
  height: 9.2rem;
  flex: none;
  overflow: hidden;
  background: #f3f3f3;
}

.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.meta {
  color: var(--grey);
  font-size: 0.95rem;
  margin: 0.15rem 0 0.45rem;
}

.figure {
  margin: 0.4rem 0 1.1rem;
}

.figure img { display: block; }

.figure figcaption {
  margin-top: 0.35rem;
  font-size: 0.92rem;
}

.video {
  position: relative;
  width: 100%;
  max-width: 720px;
  padding-top: 40.5%;
  margin: 0.4rem 0 1.1rem;
}

.video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.gallery {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
  margin-top: 0.6rem;
}

.gallery img {
  width: 100%;
  display: block;
  background: #f6f6f6;
}

.grants {
  list-style: none;
  margin: 0.3rem 0 0.8rem;
  padding: 0;
}

.grants li {
  margin: 0 0 0.75rem;
}

.grant-title {
  display: block;
  color: var(--ink);
}

.grant-meta { font-size: 0.95rem; }

.jump {
  display: flex;
  gap: 1.2rem;
  margin: 0.4rem 0 0.2rem;
  font-weight: 600;
}

.pubs {
  list-style: decimal;
  margin: 0.4rem 0 0;
  padding-left: 1.35rem;
}

.pubs li {
  margin: 0 0 0.7rem;
  padding-left: 0;
}

.lede {
  max-width: 42rem;
}

@media (max-width: 760px) {
  body { padding-top: 4.6rem; }

  h1 { font-size: 38px; }

  #header nav {
    width: 100%;
    gap: 0.8rem;
    flex-wrap: wrap;
  }

  .hero,
  .faculty {
    flex-direction: column;
  }

  .hero {
    padding-top: 1.2rem;
    margin-bottom: 1.5rem;
    min-height: 0;
    flex-direction: column;
  }

  .hero-copy,
  .hero-media { width: 100%; }

  .hero-links {
    width: 100%;
    flex-wrap: wrap;
    gap: 1rem 1.4rem;
    justify-content: flex-start;
  }

  .hero-media {
    min-height: 0;
    margin-top: 1.4rem;
  }

  .hero-media video {
    position: relative;
    top: 0;
    left: 0;
    width: min(300px, 70vw);
    z-index: 0;
  }

  .mySlides img { height: min(42vh, 280px); }

  .robots {
    grid-template-columns: repeat(2, 1fr);
  }

  .project { flex-direction: column; }

  .thumb {
    width: 100%;
    height: 180px;
  }

  .people {
    grid-template-columns: 1fr;
  }

  .faculty {
    flex-direction: column;
  }

  .faculty img {
    width: 140px;
  }

  .gallery { grid-template-columns: 1fr; }

  .video { padding-top: 56.25%; }

  .theme-toggle {
    padding: 7px;
  }

  .theme-label { display: none; }
}

html.night body {
  background: #0f1218;
  color: #b8c0c8;
}

html.night {
  color-scheme: dark;
}

html.night h1,
html.night h2,
html.night h3,
html.night h4,
html.night .role,
html.night .accent,
html.night .robot-name,
html.night .grant-title,
html.night .person-info a,
html.night .project h3 a,
html.night .courses b,
html.night .contact-block .label,
html.night .hero-links a {
  color: #e8eef4;
}

html.night a { color: #e8eef4; }

html.night .prose a,
html.night .pubs a,
html.night .grant-title a {
  color: #9db7ff;
}

html.night #header {
  background: rgba(15, 18, 24, 0.82);
  border-bottom-color: #2a3340;
}

html.night #header a { color: #9aa5b0; }

html.night #header a:hover,
html.night #header a.current {
  color: #e8eef4;
}

html.night .theme-toggle {
  border-color: #3a4554;
  color: #e8eef4;
}

html.night .theme-toggle .dot {
  background: #d5e4ff;
  box-shadow: 0 0 0 3px rgba(213, 228, 255, 0.22);
}

html.night .meta,
html.night .occ,
html.night .robot-role,
html.night .grant-meta {
  color: #9aa5b0;
}

html.night .person-placeholder {
  background: #1c2430;
  color: #9aa5b0;
}

html.night .project,
html.night .slideshow-container {
  border-color: #2a3340;
}

html.night .robot:hover .robot-name {
  color: #9db7ff;
}
