/* Layout concept: a quiet scholarly page; serif for the human voice, Plex for the machine voice.
   One bold moment: the Create / Discover / Connect hero set large beside a lab photograph. */
:root {
  --paper: #ffffff;
  --ink: #16233b;
  --muted: #4c5a73;
  --blue: #2a64c4;
  --blue-deep: #1b4a96;
  --tint: #eef3fb;
  --rule: #d6dfee;
  --serif: "Spectral", Georgia, "Times New Roman", serif;
  --sans: "IBM Plex Sans", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --wrap: 72rem;
  --step--1: 0.875rem;
  --step-0: 1.0625rem;
  --step-1: 1.3rem;
  --step-2: 1.75rem;
  --step-3: 2.4rem;
  --step-4: clamp(2.6rem, 6vw, 4.4rem);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0e1626; --ink: #e5ebf5; --muted: #a6b3c9; --blue: #86b0f2;
    --blue-deep: #b3cdf7; --tint: #16223a; --rule: #2a3954; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0e1626; --ink: #e5ebf5; --muted: #a6b3c9; --blue: #86b0f2;
  --blue-deep: #b3cdf7; --tint: #16223a; --rule: #2a3954; color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--sans); font-size: var(--step-0); line-height: 1.6;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--blue); text-underline-offset: 0.18em; }
a:hover { color: var(--blue-deep); }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; border-radius: 2px; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.15; text-wrap: balance; margin: 0; }

.wrap {
  max-width: var(--wrap); margin-inline: auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 16px; background: var(--paper); padding: 8px 12px; z-index: 10; }

/* Header */
.site-header { border-bottom: 1px solid var(--rule); background: var(--paper); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; padding-block: 0.9rem; }
.brand img { height: 52px; width: auto; }
.nav { display: flex; gap: 0.25rem; align-items: center; list-style: none; margin: 0; padding: 0; }
.nav > li { position: relative; }
.nav a, .nav summary {
  display: block; padding: 0.5rem 0.7rem; color: var(--ink); text-decoration: none;
  font-size: 0.95rem; font-weight: 500; border-radius: 4px; cursor: pointer;
}
.nav a:hover, .nav summary:hover { color: var(--blue); }
.nav a[aria-current="page"] { color: var(--blue); box-shadow: inset 0 -2px 0 var(--blue); border-radius: 0; }
.nav summary { list-style: none; }
.nav summary::-webkit-details-marker { display: none; }
.nav summary::after { content: ""; display: inline-block; margin-left: 0.4em; border: 0.3em solid transparent; border-top-color: currentColor; transform: translateY(0.15em); }
.nav .sub { list-style: none; margin: 0; padding: 0.4rem; position: absolute; top: 100%; left: 0; min-width: 17rem;
  background: var(--paper); border: 1px solid var(--rule); border-radius: 6px; z-index: 5; }
.menu-toggle { display: none; }

@media (max-width: 960px) {
  .site-header .wrap { flex-wrap: wrap; }
  .menu-toggle { display: block; }
  .menu-toggle summary { list-style: none; padding: 0.5rem 0.8rem; border: 1px solid var(--rule); border-radius: 4px; cursor: pointer; font-weight: 500; }
  .menu-toggle summary::-webkit-details-marker { display: none; }
  .menu-toggle:not([open]) + .nav { display: none; }
  .nav { flex-basis: 100%; flex-direction: column; align-items: stretch; }
  .nav .sub { position: static; border: 0; padding: 0 0 0 1rem; min-width: 0; }
}

/* Hero */
.hero .wrap { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: clamp(1.5rem, 4vw, 4rem); align-items: center; padding-block: clamp(2.5rem, 6vw, 5rem); }
.hero .lab-name { font-family: var(--sans); font-size: var(--step-1); font-weight: 500; color: var(--muted); margin: 0 0 1rem; text-wrap: balance; }
.motto { font-family: var(--serif); font-weight: 500; font-size: var(--step-4); line-height: 1.02; margin: 0 0 1.5rem; }
.motto span { display: block; }
.motto span:nth-child(2) { padding-left: 0.6em; }
.motto span:nth-child(3) { padding-left: 1.2em; color: var(--blue); }
.hero p { max-width: 34rem; color: var(--muted); margin: 0 0 1.75rem; }
.hero figure { margin: 0; }
.hero figure img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 6px; }
.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.btn { display: inline-block; padding: 0.7rem 1.15rem; border-radius: 4px; font-weight: 600; text-decoration: none; border: 2px solid var(--blue); }
.btn-primary { background: var(--blue); color: var(--paper); }
.btn-primary:hover { background: var(--blue-deep); border-color: var(--blue-deep); color: var(--paper); }
.btn-plain { color: var(--blue); }
@media (max-width: 760px) {
  .hero .wrap { grid-template-columns: minmax(0, 1fr); }
  .hero figure img { aspect-ratio: 4 / 3; }
}

/* Sections */
.section { padding-block: clamp(2.5rem, 5vw, 4rem); }
.section.tinted { background: var(--tint); }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.75rem; }
.section-head h2 { font-size: var(--step-3); }
.section-head a { font-weight: 600; }

.areas { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 1.75rem 2.5rem; list-style: none; margin: 0; padding: 0; }
.areas li { border-top: 2px solid var(--blue); padding-top: 0.9rem; }
.areas h3 { font-size: var(--step-1); margin-bottom: 0.35rem; }
.areas p { margin: 0; color: var(--muted); }

.news { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.news li { display: grid; grid-template-columns: 7.5rem minmax(0, 1fr); gap: 1.25rem; padding-block: 1.25rem; border-bottom: 1px solid var(--rule); }
.news li:first-child { padding-top: 0; }
.news img { width: 7.5rem; aspect-ratio: 1; object-fit: cover; border-radius: 4px; background: var(--tint); }
.news h3 { font-size: var(--step-1); margin-bottom: 0.3rem; }
.news p { margin: 0 0 0.4rem; max-width: 42rem; }
.news .links { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; font-weight: 600; font-size: 0.95rem; }
@media (max-width: 520px) { .news li { grid-template-columns: 4.5rem minmax(0, 1fr); gap: 1rem; } .news img { width: 4.5rem; } }

.pubs { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.25rem; }
.pubs li { max-width: 52rem; padding-left: 1.25rem; border-left: 3px solid var(--rule); }
.pubs .title { font-family: var(--serif); font-size: var(--step-1); font-weight: 600; display: block; margin-block: 0.15rem; }
.pubs .venue { font-style: italic; color: var(--muted); }

.strip { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 0.6rem; }
.strip img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 4px; background: var(--tint); }
@media (max-width: 760px) { .strip { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* Page header */
.page-head { background: var(--tint); }
.page-head .wrap { padding-block: clamp(2rem, 5vw, 3.5rem); }
.page-head .crumb { font-size: var(--step--1); color: var(--muted); margin: 0 0 0.5rem; }
.page-head .crumb a { color: var(--muted); }
.page-head h1 { font-size: var(--step-3); margin-bottom: 0.8rem; }
.page-head p { max-width: 42rem; margin: 0; color: var(--muted); font-size: var(--step-1); line-height: 1.5; }

/* People */
.people { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(12.5rem, 1fr)); gap: 2.25rem 1.75rem; }
.people img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 6px; background: var(--tint); margin-bottom: 0.9rem; }
.people h2 { font-size: var(--step-1); margin-bottom: 0.2rem; }
.people p { margin: 0; color: var(--muted); font-size: 0.97rem; }

/* Footer */
.site-footer { border-top: 1px solid var(--rule); margin-top: 0; }
.site-footer .wrap { display: grid; grid-template-columns: minmax(0, 1.4fr) repeat(2, minmax(0, 1fr)); gap: 2rem; padding-block: 3rem 2rem; }
.site-footer h2 { font-family: var(--sans); font-size: 1rem; font-weight: 600; margin-bottom: 0.75rem; }
.site-footer p, .site-footer ul { margin: 0; font-size: 0.95rem; color: var(--muted); }
.site-footer ul { list-style: none; padding: 0; display: grid; gap: 0.35rem; }
.site-footer .social { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 1rem; }
.site-footer .legal { grid-column: 1 / -1; border-top: 1px solid var(--rule); padding-top: 1.25rem; font-size: var(--step--1); }
@media (max-width: 760px) { .site-footer .wrap { grid-template-columns: minmax(0, 1fr); } }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* Utilities */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.cite { color: var(--muted); font-size: 0.95rem; }
.lede { max-width: 44rem; margin: -0.75rem 0 2rem; color: var(--muted); }
.prose { max-width: 44rem; }
.prose h2 { font-size: var(--step-3); margin-bottom: 1rem; }
.prose p { margin: 0 0 1rem; }
.page-head p + p { margin-top: 0.8rem; }

/* People extras */
.people img { object-position: center 25%; }
.people .role { color: var(--blue); font-weight: 600; font-size: 0.9rem; }
.people .bio { margin-top: 0.35rem; font-size: 0.93rem; font-weight: 600; }
.groups { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); gap: 1.25rem; }
.groups li { border: 1px solid var(--rule); border-radius: 6px; padding: 1.25rem; }
.groups a { text-decoration: none; }
.groups h2 { font-size: var(--step-2); color: var(--blue); }
.groups a:hover h2 { text-decoration: underline; }
.groups p { margin: 0.25rem 0 0.9rem; color: var(--muted); }
.faces { display: flex; flex-wrap: wrap; }
.faces img { width: 3rem; height: 3rem; object-fit: cover; border-radius: 50%; border: 2px solid var(--paper); margin-right: -0.5rem; background: var(--tint); }

/* About */
.area-cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: 2rem 1.75rem; }
.area-cards img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 6px; margin-bottom: 0.9rem; background: var(--paper); }
.area-cards h3 { font-size: var(--step-1); margin-bottom: 0.3rem; }
.area-cards p { margin: 0; color: var(--muted); }
.faq { max-width: 48rem; border-top: 1px solid var(--rule); }
.faq details { border-bottom: 1px solid var(--rule); }
.faq summary { cursor: pointer; padding: 1rem 0; font-family: var(--serif); font-size: var(--step-1); font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 1rem; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-family: var(--sans); color: var(--blue); font-weight: 400; }
.faq details[open] summary::after { content: "\2212"; }
.faq details p { margin: 0 0 1.2rem; max-width: 42rem; }
.contact { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: clamp(1.5rem, 4vw, 4rem); }
.contact h2 { font-size: var(--step-3); margin-bottom: 1rem; }
.contact p { max-width: 30rem; }
.contacts { list-style: none; padding: 0; margin: 1.25rem 0; display: grid; gap: 0.6rem; }
.contacts span { display: block; color: var(--muted); font-size: 0.93rem; }
.form { display: grid; gap: 1rem; background: var(--paper); padding: clamp(1.25rem, 3vw, 2rem); border-radius: 6px; border: 1px solid var(--rule); }
.form .row { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: 1rem; }
.form label { display: grid; gap: 0.35rem; font-weight: 500; font-size: 0.95rem; }
.form input, .form textarea { font: inherit; color: var(--ink); background: var(--paper); border: 1px solid var(--rule); border-radius: 4px; padding: 0.6rem 0.7rem; width: 100%; }
.form input:focus, .form textarea:focus { border-color: var(--blue); outline: 2px solid var(--blue); outline-offset: 0; }
.form button { justify-self: start; cursor: pointer; font: inherit; font-weight: 600; }
.hp { position: absolute; left: -9999px; }
@media (max-width: 760px) { .contact { grid-template-columns: minmax(0, 1fr); } }

/* Feature rows (robots, partners) */
.features { list-style: none; margin: 0; padding: 0; display: grid; gap: 2.5rem; }
.features li { display: grid; grid-template-columns: 14rem minmax(0, 1fr); gap: 2rem; align-items: start; padding-bottom: 2.5rem; border-bottom: 1px solid var(--rule); }
.features li:last-child { border-bottom: 0; padding-bottom: 0; }
.features img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 6px; background: var(--tint); }
.features img.logo { aspect-ratio: 3 / 2; object-fit: contain; background: #ffffff; padding: 0.75rem; border: 1px solid var(--rule); }
.features h2 { font-size: var(--step-2); margin-bottom: 0.5rem; }
.features p { margin: 0 0 0.6rem; max-width: 42rem; }
@media (max-width: 620px) { .features li { grid-template-columns: minmax(0, 1fr); gap: 1rem; } .features img { max-width: 14rem; } }

/* Publications */
.pub-layout { display: grid; grid-template-columns: 15rem minmax(0, 1fr); gap: 3rem; align-items: start; }
.pub-tools { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 1rem); display: grid; gap: 0.5rem; }
.pub-tools label { font-weight: 600; font-size: 0.95rem; }
.pub-tools input { font: inherit; color: var(--ink); background: var(--paper); border: 1px solid var(--rule); border-radius: 4px; padding: 0.6rem 0.7rem; width: 100%; }
.pub-tools input:focus { border-color: var(--blue); outline: 2px solid var(--blue); outline-offset: 0; }
.pub-tools p { margin: 0; font-size: 0.9rem; min-height: 1.3em; }
.years { display: flex; flex-wrap: wrap; gap: 0.3rem 0.9rem; margin-top: 0.5rem; font-variant-numeric: tabular-nums; }
.pub-year { scroll-margin-top: 1rem; }
.pub-year + .pub-year { margin-top: 2.5rem; }
.pub-year h2 { font-size: var(--step-3); color: var(--blue); border-bottom: 1px solid var(--rule); padding-bottom: 0.4rem; margin-bottom: 1rem; font-variant-numeric: tabular-nums; }
.pub-year ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.9rem; }
.pub-year li { padding-left: 1.5rem; text-indent: -1.5rem; max-width: 50rem; overflow-wrap: anywhere; }
.pub-year a { overflow-wrap: anywhere; }
@media (max-width: 820px) { .pub-layout { grid-template-columns: minmax(0, 1fr); gap: 1.5rem; } .pub-tools { position: static; } }

/* Gallery */
.gallery { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 0.75rem; }
.gallery button { display: block; width: 100%; padding: 0; border: 0; background: var(--tint); border-radius: 6px; overflow: hidden; cursor: zoom-in; }
.gallery img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
dialog#viewer { border: 0; padding: 1rem; border-radius: 8px; background: var(--paper); color: var(--ink); max-width: min(92vw, 70rem); }
dialog#viewer::backdrop { background: rgba(10, 18, 32, 0.8); }
dialog#viewer img { max-height: 78vh; width: auto; margin: 0 auto 1rem; border-radius: 4px; }
dialog#viewer form { text-align: center; }
dialog#viewer button { font: inherit; font-weight: 600; cursor: pointer; }

/* Measures */
.measure { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(1.5rem, 4vw, 3.5rem); align-items: start; }
.measure h2 { font-size: var(--step-3); margin-bottom: 1rem; }
.measure .cite { overflow-wrap: anywhere; }
.measure figure { margin: 0; background: #ffffff; border: 1px solid var(--rule); border-radius: 6px; padding: 1rem; }
.scales { margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 1.75rem 2.5rem; }
.scales div { border-top: 2px solid var(--blue); padding-top: 0.9rem; }
.scales dt { font-family: var(--serif); font-size: var(--step-1); font-weight: 600; margin-bottom: 0.3rem; }
.scales dd { margin: 0; color: var(--muted); }
.boxes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(1.25rem, 3vw, 2rem); align-items: stretch; }
.box { border: 1px solid var(--rule); border-radius: 8px; padding: clamp(1.25rem, 3vw, 2rem); background: var(--paper); }
.box-label { margin: 0 0 0.5rem; font-size: 0.8rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--blue); }
.box h2 { font-size: var(--step-2); margin-bottom: 0.9rem; }
.box p { margin: 0 0 1rem; }
.box .cite { overflow-wrap: anywhere; }
.box h3 { font-size: var(--step-0); margin: 1.4rem 0 0.6rem; }
.box figure { margin: 1rem 0 0; background: #ffffff; border: 1px solid var(--rule); border-radius: 6px; padding: 0.75rem; }
.box figure img { width: 100%; height: auto; }
.readings { margin: 0; padding-left: 1.2rem; display: grid; gap: 0.6rem; }
.readings li { overflow-wrap: anywhere; }
@media (max-width: 860px) { .boxes { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 760px) { .measure { grid-template-columns: minmax(0, 1fr); } }

/* Phone refinements */
@media (max-width: 560px) {
  .brand img { height: 34px; }
  .site-header .wrap { flex-wrap: wrap; row-gap: 0.75rem; }
  .people { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem 1rem; }
  .people h2 { font-size: 1.05rem; }
  .people p { font-size: 0.9rem; }
}
