/* Mapping & Motion Lab. Colours come from the lab logo and U-M blue and maize. */
:root {
  --blue: #00274c;
  --blue-2: #0c3a63;
  --maize: #ffcb05;
  --sky: #2b9cc4;
  --mist: #e9f1f6;
  --ink: #12263a;
  --ink-soft: #4a5f73;
  --rule: #cfdde7;
  --display: "Bricolage Grotesque", "Segoe UI", sans-serif;
  --body: "Atkinson Hyperlegible", "Segoe UI", sans-serif;
  --rail: 11rem;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 4.5rem; }
body { margin: 0; color: var(--ink); background: #fff; font: 400 1.0625rem/1.6 var(--body); }
img, video { display: block; max-width: 100%; height: auto; }
a { color: #0a5c86; text-underline-offset: 0.15em; }
a:hover { color: var(--blue); }
:focus-visible { outline: 3px solid var(--sky); outline-offset: 2px; }
h1, h2, h3, h4 { font-family: var(--display); color: var(--blue); line-height: 1.12; margin: 0; }
p { margin: 0 0 0.8rem; }

/* Top bar */
.bar { position: sticky; top: 0; z-index: 5; background: var(--blue); color: #fff; }
.bar-in { max-width: 76rem; margin: 0 auto; padding: 0.6rem 1.5rem; display: flex; gap: 1.5rem; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.bar a { color: #fff; text-decoration: none; }
.bar a:hover { color: var(--maize); }
.brand { font: 700 1.05rem var(--display); }
.bar nav { display: flex; gap: 1.25rem; flex-wrap: wrap; }

/* Hero: lab name over the live manifold in deep space */
.hero { position: relative; overflow: hidden; color: #fff; background: radial-gradient(60rem 34rem at 72% 45%, #0b2a63 0%, #04173a 48%, #020d24 100%); }
.manifold { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-in { position: relative; max-width: 76rem; margin: 0 auto; padding: 6.5rem 1.5rem 7rem; min-height: 37rem; pointer-events: none; }
.hero-in a { pointer-events: auto; }
.hero h1 { max-width: 7.2em; color: #fff; font-size: clamp(2.9rem, 6.4vw, 5.2rem); font-weight: 800; letter-spacing: -0.02em; line-height: 0.98; }
.hero p { max-width: 26rem; margin-top: 1.25rem; font-size: 1.15rem; }
.hero .where { color: var(--maize); font-weight: 700; margin-top: 1rem; }
.hero a { color: #fff; }

/* Sections: heading in a left rail, content to the right */
.sec { max-width: 76rem; margin: 0 auto; padding: 3.5rem 1.5rem; display: grid; grid-template-columns: var(--rail) minmax(0, 1fr); gap: 2.5rem; border-top: 1px solid var(--rule); }
.sec:first-of-type { border-top: 0; }
.sec > h2 { font-size: 1.7rem; font-weight: 700; position: sticky; top: 4.5rem; align-self: start; }
.lede { max-width: 46rem; color: var(--ink-soft); }

/* View toggle for the research list */
.view-bar { margin-bottom: 0.75rem; padding: 0.4rem 0; background: #fff; }
.views { display: inline-flex; flex-wrap: wrap; border: 2px solid var(--blue); background: #fff; }
.views button { padding: 0.5rem 1.1rem; border: 0; background: #fff; color: var(--blue); font: 700 1rem var(--body); cursor: pointer; }
.views button + button { border-left: 2px solid var(--blue); }
.views button:hover { background: var(--mist); }
.views button[aria-pressed="true"] { background: var(--blue); color: #fff; }
.area-tabs { display: flex; flex-wrap: wrap; gap: 0.25rem 1.5rem; margin-top: 0.6rem; }
.area-tabs button { padding: 0.25rem 0; border: 0; border-bottom: 3px solid transparent; background: none; color: #0a5c86; font: 700 1rem var(--body); cursor: pointer; }
.area-tabs button:hover { color: var(--blue); border-bottom-color: var(--rule); }
.area-tabs button[aria-pressed="true"] { color: var(--blue); border-bottom-color: var(--maize); }
.view-note { max-width: 46rem; color: var(--ink-soft); }
.view-note:empty { display: none; }

/* Paper rows */
.work { list-style: none; margin: 0; padding: 0; }
.work li { display: grid; grid-template-columns: 15rem minmax(0, 1fr); gap: 1.75rem; padding: 1.5rem 0; border-top: 1px solid var(--rule); }
.work li:first-child { border-top: 0; padding-top: 0; }
.work .thumb { background: #fff; align-self: start; }
.work .thumb img { width: 100%; max-height: 10.5rem; object-fit: contain; }
.area + .area { margin-top: 3rem; }
.area > h3 { font-size: 1.45rem; font-weight: 700; margin-bottom: 1.25rem; padding-bottom: 0.4rem; border-bottom: 3px solid var(--maize); }
.work h4 { font-size: 1.3rem; font-weight: 600; line-height: 1.12; margin: 0 0 0.3rem; }
.work h4 a { color: inherit; text-decoration: none; }
.work h4 a:hover { text-decoration: underline; }
.status { display: inline-block; margin-bottom: 0.45rem; padding: 0.05rem 0.5rem; font-size: 0.875rem; font-weight: 700; color: var(--blue); background: var(--mist); }
.status.ws { background: var(--maize); }
.status.pub { background: var(--blue); color: #fff; }
.by { color: var(--ink-soft); font-size: 0.97rem; margin-bottom: 0.45rem; }
.links { display: flex; flex-wrap: wrap; gap: 0.2rem 1rem; font-weight: 700; margin: 0; }

/* Software */
.soft { width: 100%; border-collapse: collapse; }
.soft th, .soft td { text-align: left; vertical-align: top; padding: 0.9rem 1.25rem 0.9rem 0; border-top: 1px solid var(--rule); }
.soft tr:first-child th, .soft tr:first-child td { border-top: 0; }
.soft th { font: 600 1.2rem var(--display); color: var(--blue); white-space: nowrap; }
.soft td:last-child { white-space: nowrap; padding-right: 0; font-weight: 700; }
.soft td:last-child a + a { margin-left: 0.8rem; }

/* People */
.lead-person { display: grid; grid-template-columns: 13rem minmax(0, 1fr); gap: 1.75rem; margin-bottom: 2.5rem; }
.lead-person img { width: 100%; aspect-ratio: 1; object-fit: cover; object-position: 50% 20%; }
.people h3 { font-size: 1.3rem; font-weight: 600; margin-bottom: 1rem; }
.people .group { margin-top: 2.5rem; }
.grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(11.5rem, 1fr)); gap: 1.75rem 1.5rem; }
.grid img { width: 100%; aspect-ratio: 1; object-fit: cover; object-position: 50% 25%; margin-bottom: 0.55rem; }
.grid strong { display: block; font: 600 1.08rem var(--display); color: var(--blue); }
.grid span { display: block; font-size: 0.93rem; color: var(--ink-soft); line-height: 1.4; }
.grid .links { font-size: 0.93rem; margin-top: 0.3rem; gap: 0 0.7rem; }
.narrow { max-width: 13.5rem; }

/* Supporters */
.sponsors { list-style: none; margin: 1.5rem 0 0; padding: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 1.75rem 2.5rem; }
.sponsors li { display: flex; align-items: center; gap: 0.6rem; }
.sponsors img { height: 3.1rem; width: auto; max-width: 9.5rem; object-fit: contain; }
.sponsors small { font-size: 0.95rem; color: var(--ink-soft); }

/* Contact */
.contact { background: var(--maize); }
.contact .sec { border-top: 0; }
.contact .sec > h2 { position: static; }
.contact p { max-width: 42rem; }
.button { display: inline-block; margin-top: 0.5rem; padding: 0.7rem 1.4rem; background: var(--blue); color: #fff; font: 700 1.1rem var(--body); text-decoration: none; }
.button:hover { background: var(--blue-2); color: var(--maize); }

footer { background: var(--blue); color: #c9dbe8; font-size: 0.95rem; }
footer div { max-width: 76rem; margin: 0 auto; padding: 1.5rem; }
footer a { color: #fff; }

/* Project pages */
.proj-head { background: var(--blue); color: #fff; }
.proj-head div { max-width: 58rem; margin: 0 auto; padding: 2.75rem 1.5rem 2.5rem; }
.proj-head h1 { color: #fff; font-size: clamp(2.2rem, 5vw, 3.6rem); font-weight: 800; letter-spacing: -0.015em; line-height: 1.04; }
.proj-head p { margin: 1rem 0 0; color: #dbe7f0; }
.proj-head a { color: #fff; }
.proj { max-width: 58rem; margin: 0 auto; padding: 2.5rem 1.5rem 4rem; }
.proj h2 { font-size: 2rem; font-weight: 700; margin: 3.25rem 0 1rem; padding-top: 1.75rem; border-top: 3px solid var(--maize); }
.proj > h2:first-child { margin-top: 0; }
.proj h3 { font-size: 1.3rem; font-weight: 600; margin: 2rem 0 0.6rem; }
.proj p, .proj li { max-width: 46rem; }
.proj figure { margin: 1.25rem 0; }
.proj figcaption { font-size: 0.93rem; color: var(--ink-soft); margin-top: 0.45rem; max-width: 46rem; }
.trio { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.9rem; }
.duo { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.9rem 1.1rem; }
.duo figure, .trio figure { margin: 0; }
.embed { width: 100%; aspect-ratio: 16 / 9; border: 0; background: var(--mist); }
.score { border-collapse: collapse; margin: 1rem 0; }
.score th, .score td { text-align: right; padding: 0.35rem 1.1rem; border-bottom: 1px solid var(--rule); }
.score th:first-child, .score td:first-child { text-align: left; padding-left: 0; }
.score tr.us td { font-weight: 700; color: var(--blue); }
details { margin-top: 0.6rem; }
summary { cursor: pointer; font-weight: 700; color: #0a5c86; }
pre { background: var(--mist); padding: 0.9rem 1rem; overflow-x: auto; font-size: 0.875rem; line-height: 1.45; }

@media (min-width: 60.01rem) {
  .view-bar { position: sticky; top: 2.9rem; z-index: 3; }
}
@media (max-width: 60rem) {
  .hero-in { padding: 2.5rem 1.5rem 21rem; min-height: 0; }
  .sec { grid-template-columns: 1fr; gap: 1.25rem; padding: 2.5rem 1.5rem; }
  .sec > h2 { position: static; }
}
@media (max-width: 40rem) {
  .work li, .lead-person { grid-template-columns: 1fr; gap: 0.8rem; }
  .lead-person img { max-width: 13rem; }
  .work .thumb img { max-height: 12rem; object-position: left; }
  .soft, .soft tbody, .soft tr, .soft th, .soft td { display: block; }
  .soft th { padding-bottom: 0; }
  .soft td { border-top: 0; padding: 0.15rem 0; white-space: normal !important; }
  .soft tr { border-top: 1px solid var(--rule); padding: 0.7rem 0; }
  .soft tr:first-child { border-top: 0; }
  .soft tr th, .soft tr td { border-top: 0; }
  .trio, .duo { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
[hidden] { display: none !important; }
