/* =========================================================================
   AIM Lab — site styles
   Single stylesheet. Two modes: Science (default, light) and Art (dark).
   Palette: Black + White (primary), Blue + Amber (accents).
   Blue is the Science accent; Amber is the Art accent. Do not add new colors.
   ========================================================================= */

:root {
  /* Four-color palette */
  --black: #161A1D;
  --white: #FFFFFF;
  --blue:   #3B82F6;   /* THE blue — every Science accent */
  --orange: #E0760F;   /* THE orange — every Art accent */

  /* Derived neutrals (tints of black, kept disciplined) */
  --rule:        rgba(22, 26, 29, 0.18);
  --rule-strong: rgba(22, 26, 29, 0.28);
  --muted:       rgba(22, 26, 29, 0.55);
  --muted-2:     rgba(22, 26, 29, 0.35);

  /* Mode-aware tokens — overridden when [data-mode="gallery"] (Art) */
  --bg:     var(--white);
  --fg:     var(--black);
  --accent: var(--blue);

  /* Logo fills (Science: dark disc, white letters — disc contrasts the white page) */
  --logo-mark: var(--white);
  --logo-bg:   var(--black);

  /* Knockout color for icons with cut-out detail (e.g. ORCID "iD") */
  --icon-knockout: var(--bg);

  /* Type scale */
  --font-sans: Arial, "Helvetica Neue", Helvetica, sans-serif;

  /* Layout */
  --max-width: 1100px;
  --gutter: 32px;
}

[data-mode="gallery"] {
  --bg:     var(--black);
  --fg:     var(--white);
  --accent: var(--orange);
  --logo-mark: var(--black);
  --logo-bg:   var(--white);
  --rule:        rgba(255, 255, 255, 0.18);
  --rule-strong: rgba(255, 255, 255, 0.32);
  --muted:       rgba(255, 255, 255, 0.65);
  --muted-2:     rgba(255, 255, 255, 0.4);
}

* { box-sizing: border-box; }
body, button, input, select, textarea { font-family: Arial, "Helvetica Neue", Helvetica, sans-serif; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color 0.18s ease, color 0.18s ease;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ---------- Header ------------------------------------------------------ */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  padding: 14px 0 0;
  /* Frosted banner. Chrome color/accent are tokens set per context below, so
     the same rules render correctly on dark and light banners.
     Science (default): dark-grey frost, white chrome, vivid-blue links. */
  --hdr-fg: var(--white);
  --hdr-fg-inv: var(--black);
  --hdr-shadow: 0 1px 8px rgba(0, 0, 0, 0.4);
  background: rgba(0, 0, 0, 0.85);
  -webkit-backdrop-filter: saturate(1.3) blur(12px);
  backdrop-filter: saturate(1.3) blur(12px);
  transition: padding 0.2s ease;
}
/* Art: white frost, black chrome, vivid-orange links */
[data-mode="gallery"] .site-header {
  background: rgba(255, 255, 255, 0.85);
}
[data-mode="gallery"] body:not(.is-deck) .site-header {
  --hdr-fg: var(--black);
  --hdr-fg-inv: var(--white);
  --hdr-shadow: none;
}
/* Front page over a light panel -> black chrome (Science and Art both flip) */
body.is-deck .site-header--on-light {
  --hdr-fg: var(--black);
  --hdr-fg-inv: var(--white);
  --hdr-shadow: none;
}

/* Elaborate divider — faded gradient line with a centered accent diamond.
   Constrained to the content column so nothing bleeds to the viewport edge. */
.rule {
  max-width: var(--max-width);
  margin: 18px auto 0;
  padding: 0 var(--gutter);
  position: relative;
  height: 1px;
}
.rule::before {
  content: "";
  position: absolute;
  left: var(--gutter);
  right: var(--gutter);
  top: 50%;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--rule-strong) 18%, var(--rule-strong) 82%, transparent);
}
.rule::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 6px;
  height: 6px;
  background: var(--accent);
  transform: translate(-50%, -50%) rotate(45deg);
}
/* Utility column — Science/Art toggle, with the hamburger centered below it.
   Equal vertical space above the toggle, between toggle and hamburger, and
   below the hamburger (to the rule). */
.site-header__utility {
  margin: 16px auto 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.site-header .rule { margin-top: 16px; }
.site-menu.is-open ~ .rule { margin-top: 8px; }  /* + menu padding-bottom 8px = 16px gap */

/* Wordmark + logo — centered column */
.wordmark {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: var(--fg);
  text-align: center;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 4px var(--gutter) 0;
}
.wordmark:hover { text-decoration: none; }
.wordmark__logo {
  width: 96px;
  height: 96px;
  display: block;
  flex-shrink: 0;
}
.wordmark__logo svg {
  width: 100%;
  height: 100%;
  display: block;
}

.wordmark__name {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--fg);
}
/* Mode-specific suffix: "Laboratory" (blue) in Science, "Studio" (orange) in Art */
.wordmark__suffix--lab { color: var(--blue); }
.wordmark__suffix--studio { color: var(--orange); }
[data-mode="research"] .wordmark__suffix--studio { display: none; }
[data-mode="gallery"]  .wordmark__suffix--lab { display: none; }

/* Homepage tagline — its own centered space below the header rule */
.home-tagline {
  max-width: calc(var(--max-width) * 0.75);
  margin: 20px auto 0;
  padding: 0 var(--gutter);
  text-align: center;
  font-family: Georgia, "Times New Roman", Times, serif;
  font-style: italic;
  font-size: 19px;
  line-height: 1.55;
  color: var(--fg);
}

/* Mode toggle (stays visible) */
.mode-toggle {
  display: inline-flex;
  border: 1px solid var(--fg);
  border-radius: 5px;
  padding: 2px;
  font-size: 12px;
  background: var(--bg);
}
.mode-toggle__btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: #161A1D;
  padding: 4px 14px;
  border-radius: 5px;
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 700;
  transition: background-color 0.15s ease, color 0.15s ease;
}
[data-mode="gallery"] .mode-toggle__btn { color: #FFFFFF; }
.mode-toggle__btn[aria-selected="true"] {
  background: #161A1D;
  color: #FFFFFF;
}
[data-mode="gallery"] .mode-toggle__btn[aria-selected="true"] {
  background: #FFFFFF;
  color: #161A1D;
}

/* Hamburger button */
.menu-btn {
  appearance: none;
  background: transparent;
  border: 0;
  cursor: pointer;
  padding: 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  width: 34px;
}
.menu-btn__bar {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--accent);
  transition: transform 0.2s ease, opacity 0.2s ease;
}
/* Animate into an X when open */
.menu-btn.is-open .menu-btn__bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-btn.is-open .menu-btn__bar:nth-child(2) { opacity: 0; }
.menu-btn.is-open .menu-btn__bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Sliding menu panel. Narrow windows: hidden behind the hamburger, opens as a
   vertical list. Wide windows (media query below): always visible, one row. */
.site-menu {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--gutter);
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height 0.28s ease, opacity 0.2s ease, padding 0.28s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
/* Each menu only exists in its own mode */
[data-mode="research"] .site-menu--gallery { display: none; }
[data-mode="gallery"]  .site-menu--research { display: none; }
.site-menu.is-open {
  max-height: 60vh;
  opacity: 1;
  padding-top: 10px;     /* + link padding 6px = 16px visible gap above the menu */
  padding-bottom: 2px;   /* + link 6px + rule margin 8px = 16px gap below the menu */
}
.site-menu__link {
  font-size: 16px;
  font-weight: 700;
  color: var(--fg);
  padding: 6px 0;
  letter-spacing: -0.01em;
}
.site-menu__link:hover { color: var(--accent); text-decoration: none; }
.site-menu__link.is-active { color: var(--accent); }

/* Wide windows: the full menu is always visible in a row, no hamburger */
@media (min-width: 880px) {
  .menu-btn { display: none; }
  .site-menu,
  .site-menu.is-open {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 24px;
    max-height: none;
    opacity: 1;
    overflow: visible;
    transition: none;
    padding-top: 10px;
    padding-bottom: 2px;
  }
  /* Equal visible gaps around the inline menu: 10+6 above = 6+2+8 below */
  .site-header .rule { margin-top: 8px; }
}

/* ---------- Art mode ---------------------------------------------------- */
/* The top row (logo, wordmark, toggle, hamburger) is shared with Science.
   Only the page body differs: Science shows bands, Art shows the gallery. */


/* ---------- Mode panes -------------------------------------------------- */
/* The homepage has two panes — one shown per mode. (Interior pages have no
   panes; their content shows in both modes.) Note: internally the modes are
   coded "research"/"gallery"; the UI labels them Science/Art. */

.mode-pane { display: none; }
[data-mode="research"] .mode-pane--research,
[data-mode="gallery"]  .mode-pane--gallery {
  display: block;
}

/* ---------- Home (Science mode) ----------------------------------------- */

.eyebrow {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 14px;
}

/* ---------- Banded homepage + sticky side menu -------------------------- */

.home {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.band {
  padding: 22px 0;
}
/* Centered title (News/Research/Join) with the "All …" link pinned right */
.band__head {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 16px;
  text-align: center;
}
/* Centered "All …" link under a band's content */
.band__more { text-align: center; font-size: 14px; margin: 10px 0 0; }
.band__more a { color: var(--accent); }

/* Two-column band on the homepage: news left (60%), join right (40%) */
.home-cols {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 48px;
  align-items: start;
}
/* Section heading — plain black text, no background */
.band .eyebrow {
  display: inline-block;
  text-align: center;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-transform: none;
  color: var(--black);
  margin-bottom: 0;
}
.news-list {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 14px;
  line-height: 1.65;
}
.news-list__item {
  padding: 7px 0;
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 14px;
  align-items: baseline;
  text-align: left;
}
.news-list__date {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
/* Match the research band's top gap to the news list, whose first item adds 7px top padding */
.band .research-grid { margin-top: 7px; }

/* Homepage research strip: all projects in one horizontally scrollable row.
   A partially visible card at the right edge is the scroll affordance. */
.research-scroller {
  display: flex;
  gap: 20px;
  margin-top: 7px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;   /* always settles with one card centered */
  scrollbar-width: none;       /* no visible bar; the strip scrolls by trackpad, swipe, or arrow keys */
  padding-bottom: 6px;
  /* Fade the strip out at both edges (the loop has no real start or end) */
  -webkit-mask-image: linear-gradient(to right, transparent, #000 56px, #000 calc(100% - 56px), transparent);
  mask-image: linear-gradient(to right, transparent, #000 56px, #000 calc(100% - 56px), transparent);
}
.research-scroller::-webkit-scrollbar { display: none; }
.research-scroller .research-card,
.research-scroller .art-card {
  flex: 0 0 450px;
  scroll-snap-align: center;
}
/* Too few items to loop: no scroll, just a centered row */
.research-scroller--static {
  justify-content: center;
  overflow-x: visible;
  scroll-snap-type: none;
  -webkit-mask-image: none;
  mask-image: none;
}

/* News page — grouped by year (mirrors the publications page) */
.news-year { margin-bottom: 28px; padding-bottom: 28px; border-bottom: 0.5px solid var(--rule); }
.news-year:last-child { border-bottom: 0; }
.news-year__heading {
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--black);
  font-weight: 700;
  margin: 0 0 12px;
  text-align: center;
}

/* Research band: floating grid of cards — image rectangle, text below */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 28px;
}
.filter-btn {
  appearance: none;
  border: 1px solid var(--rule-strong);
  background: transparent;
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: 13px;
  padding: 6px 14px;
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.filter-btn:hover { border-color: var(--fg); }
.filter-btn.is-active {
  background: var(--fg);
  color: var(--bg);
  border-color: var(--fg);
}

/* Per-theme pastel colors. Faded outline by default, solid outline on hover,
   filled when active. The "All" button keeps the neutral dark style above. */
.filter-btn[data-filter="Shape transformation"] { --tag: #d98b86; }
.filter-btn[data-filter="Fabrication"]          { --tag: #d9a679; }
.filter-btn[data-filter="Architected materials"]{ --tag: #c9b072; }
.filter-btn[data-filter="Soft matter"]          { --tag: #86b87f; }
.filter-btn[data-filter="Textiles"]             { --tag: #6fb6ab; }
.filter-btn[data-filter="Algorithm"]            { --tag: #7f9fd9; }
.filter-btn[data-filter="Functional materials"]{ --tag: #a98bd1; }
.filter-btn[data-filter="3D printing"]          { --tag: #d585b0; }
/* Art-side themes (the Art gallery filter; independent of research themes) */
.filter-btn[data-filter="Surfaces"]             { --tag: #6fb6ab; }

.filter-btn[data-filter]:not([data-filter="all"]) {
  color: var(--fg);
  border-color: color-mix(in srgb, var(--tag) 45%, transparent);
}
.filter-btn[data-filter]:not([data-filter="all"]):hover {
  border-color: var(--tag);
}
.filter-btn[data-filter]:not([data-filter="all"]).is-active {
  background: var(--tag);
  border-color: var(--tag);
  color: var(--black);
}
.research-card[hidden], .art-card[hidden] { display: none; }

.research-grid, .art-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 28px;
}
.research-card, .art-card { color: var(--fg); display: block; }
.research-card:hover, .art-card:hover { text-decoration: none; }
.research-card:hover .research-card__title,
.art-card:hover .art-card__title { color: var(--accent); }
.research-card__img, .art-card__img {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 5px;
  background: var(--rule);
  margin-bottom: 10px;
}
.research-card__img img, .art-card__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
/* Research thumbnails are grayscale and reveal color on hover; art thumbnails stay full color. */
.research-card__img img { filter: grayscale(1); transition: filter 0.3s ease; }
.research-card:hover .research-card__img img { filter: grayscale(0); }
.research-card__title, .art-card__title { font-size: 14px; font-weight: 700; line-height: 1.3; }
.research-card__subtitle, .art-card__subtitle { font-size: 13px; color: var(--muted); line-height: 1.4; margin-top: 2px; }

.join-nudge { font-size: 14px; line-height: 1.6; margin: 0; text-align: left; }
.join-nudge + .join-nudge { margin-top: 10px; }

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  max-width: 720px;
}
.contact-block p { font-size: 15px; line-height: 1.6; margin: 0 0 12px; }
.contact-block .ext { color: var(--accent); }

.prose-page { max-width: none; }
.prose-page p { font-size: 16px; line-height: 1.7; margin: 0 0 18px; }

/* ---------- Page (generic) ---------------------------------------------- */

.page { padding-top: 32px; padding-bottom: 56px; }
.page__title {
  margin: 0 0 12px;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.1;
  text-align: center;
  color: var(--fg);
}
.page__lede {
  font-size: 14px;
  line-height: 1.6;
  color: var(--muted);
  margin: 0 0 28px;
  padding: 0 12.5% 24px;   /* text constrained to ~75%, rule stays full width */
  text-align: center;
  position: relative;
}
/* Elaborate rule under the lede (matches the header/footer dividers) */
.page__lede::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--rule-strong) 18%, var(--rule-strong) 82%, transparent);
}
.page__lede::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 6px;
  height: 6px;
  background: var(--accent);
  transform: translate(-50%, 50%) rotate(45deg);
}


/* ---------- People ------------------------------------------------------ */

.people-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 28px;
}
.person-card__photo {
  aspect-ratio: 2 / 3;
  overflow: hidden;
  border-radius: 5px;
  background: var(--rule);
  margin-bottom: 10px;
}
.person-card__photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.person-card__name { font-weight: 700; font-size: 15px; }
.person-card__role { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.person-card__bio  { font-size: 13px; color: var(--muted); margin: 0 0 6px; line-height: 1.5; }
.person-card__links { font-size: 12px; }
.person-card__links a { margin-right: 12px; }

.alumni { margin-top: 56px; padding-top: 32px; border-top: 0.5px solid var(--rule); }
.alumni__heading {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--fg);
  margin: 0 0 16px;
}
.alumni__list { list-style: none; padding: 0; margin: 0; }
.alumni__item {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  padding: 6px 0;
  align-items: baseline;
}
.alumni__name { font-weight: 700; font-size: 15px; }
.alumni__status { font-size: 14px; color: var(--muted); }
.people-album { margin: 48px 0; }
.people-album .alumni__heading { margin-bottom: 20px; }

/* ---------- Publications ------------------------------------------------ */

.pub-year { margin-bottom: 28px; padding-bottom: 28px; border-bottom: 0.5px solid var(--rule); }
.pub-year:last-child { border-bottom: 0; }
.pub-year__heading {
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--black);
  font-weight: 700;
  margin: 0 0 12px;
  text-align: center;
}
.pub-list { list-style: none; padding: 0; margin: 0; counter-reset: pub; }
.pub {
  padding: 10px 0;
  font-size: 14px;
  line-height: 1.55;
}
.pub__authors { color: var(--muted); }
.pub__title   { color: var(--fg); }
.pub__title a { color: inherit; }
.pub__title a:hover { text-decoration: underline; }
.pub__venue   { color: var(--muted); }
.pub__links   { display: inline; margin-left: 6px; font-size: 12px; }
.pub__note    { color: var(--muted); }

/* ---------- Teaching / Join cards --------------------------------------- */

.course {
  padding: 24px 0;
  border-top: 0.5px solid var(--rule);
  border-bottom: 0.5px solid var(--rule);
  margin-bottom: 24px;
}
.course__title { font-size: 20px; font-weight: 700; margin: 0 0 4px; }
.course__meta  { font-size: 13px; color: var(--muted); margin: 0 0 12px; }
.course__desc  { font-size: 15px; line-height: 1.6; margin: 0; max-width: 720px; }
/* Course with an image alongside the text (image is 25% of the width, 3:2) */
.course--with-media { display: flex; gap: 24px; align-items: flex-start; }
.course--with-media .course__body { flex: 1 1 auto; min-width: 0; }
.course--with-media .course__media { flex: 0 0 25%; }
.course__media img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 5px; display: block; }

.teaching-block { margin-bottom: 40px; }
.teaching-block__heading {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--fg);
  margin: 0 0 16px;
}
.course-list { list-style: none; padding: 0; margin: 0; }
.course-list__item {
  font-size: 16px;
  padding: 6px 0;
}

.join-grid {
  display: flex;
  flex-direction: column;
  margin-top: 8px;
}
.join-card { padding: 24px 0; border-top: 0.5px solid var(--rule); }
.join-card:first-child { border-top: none; }
.join-card:last-child { border-bottom: 0.5px solid var(--rule); }
.join-card h2 {
  font-size: 16px;
  letter-spacing: 0.02em;
  margin: 0 0 8px;
  color: var(--fg);
}
.join-card p { font-size: 14px; margin: 0 0 10px; }
.join-card h2 a { color: inherit; text-decoration: none; }
.join-card h2 a:hover { text-decoration: underline; }

/* Join detail pages (postdoc / PhD / undergraduate) */
.join-page .page__title { text-align: left; }
.join-page .page__lede { text-align: left; padding-left: 0; padding-right: 0; }
.join-detail { max-width: 720px; margin: 0; }
.join-detail h2 {
  font-size: 16px;
  letter-spacing: 0.02em;
  margin: 28px 0 10px;
  color: var(--fg);
}
.join-detail h2:first-child { margin-top: 0; }
.join-detail p { font-size: 14px; line-height: 1.6; margin: 0 0 12px; }
.join-detail ul { margin: 0 0 16px; padding-left: 20px; }
.join-detail li { font-size: 14px; line-height: 1.6; margin: 0 0 6px; }
.join-back { margin-top: 28px; font-size: 13px; }

/* ---------- Project page ------------------------------------------------ */

/* ---------- Project / Art detail pages (shared Lauren-style layout) ----- */

.proj { padding: 32px 0 0; }
.proj__inner { max-width: 760px; }

.proj__back {
  display: inline-block;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 16px;
}
.proj__back:hover { color: var(--accent); text-decoration: none; }
.proj__topbar { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; margin-bottom: 16px; }
.proj__topbar .proj__back { margin-bottom: 0; }
.proj__print { font-size: 13px; color: var(--muted); white-space: nowrap; }
.proj__print:hover { color: var(--accent); text-decoration: none; }

.proj__header { text-align: center; }
.proj__title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.1;
  margin: 0 0 8px;
}
.proj__subtitle {
  font-size: 15px;
  color: var(--muted);
  margin: 0;
}

/* Metadata table */
.proj__meta {
  margin: 24px auto;
  padding: 16px 0;
  border-top: 0.5px solid var(--rule);
  border-bottom: 0.5px solid var(--rule);
  max-width: 600px;
}
.proj__meta-row {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 16px;
  padding: 6px 0;
  align-items: start;
}
.proj__meta-label {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  padding-top: 3px;
}
.proj__meta-value { font-size: 15px; color: var(--fg); }
.proj__tag {
  display: inline-block;
  font-size: 12px;
  padding: 2px 10px;
  margin: 0 4px 4px 0;
  border-radius: 5px;
  background: var(--tag, var(--accent));
  color: var(--black);
  cursor: pointer;
  transition: filter 0.15s ease;
}
.proj__tag:hover { text-decoration: none; filter: brightness(0.92); }
/* Per-theme pastel colors (match the Research page filter tags) */
.proj__tag[data-tag="Shape transformation"]  { --tag: #d98b86; }
.proj__tag[data-tag="Fabrication"]           { --tag: #d9a679; }
.proj__tag[data-tag="Architected materials"] { --tag: #c9b072; }
.proj__tag[data-tag="Soft matter"]           { --tag: #86b87f; }
.proj__tag[data-tag="Textiles"]              { --tag: #6fb6ab; }
.proj__tag[data-tag="Algorithm"]             { --tag: #7f9fd9; }
.proj__tag[data-tag="Functional materials"]  { --tag: #a98bd1; }
.proj__tag[data-tag="3D printing"]           { --tag: #d585b0; }
.proj__tag[data-tag="Surfaces"]              { --tag: #6fb6ab; }

.proj__hero { width: 66%; margin: 24px auto; }
.proj__hero img,
.proj__hero video { width: 100%; height: auto; display: block; border-radius: 5px; }
.proj__hero figcaption {
  font-size: 13px;
  color: var(--muted);
  margin-top: 10px;
  line-height: 1.5;
}

.proj__body {
  font-size: 17px;
  line-height: 1.7;
}
.proj__body h2 {
  font-size: 16px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--fg);
  margin: 22px 0 6px;
}
.proj__body img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 5px;
  margin: 28px 0;
}
.proj__body p:has(> img:only-child) { margin: 0; }

/* Figure with caption (use in body): <figure class="project-figure">…</figure> */
.project-figure { margin: 28px auto; }
.project-figure img { margin: 0; border-radius: 5px; width: 100%; height: auto; display: block; }
.project-figure figcaption { font-size: 13px; color: var(--muted); margin-top: 8px; line-height: 1.5; }

.proj__links { margin-top: 24px; display: flex; flex-wrap: wrap; gap: 8px; }
.proj__pubs { margin-top: 28px; padding-top: 20px; border-top: 0.5px solid var(--rule); }
.proj__press { margin-top: 28px; padding-top: 20px; border-top: 0.5px solid var(--rule); }

/* Press list (top-level Press page + per-project press sections) */
.press-list { list-style: none; padding: 0; margin: 0; font-size: 15px; line-height: 1.6; }
.press-item {
  display: flex;
  gap: 14px;
  align-items: baseline;
  padding: 8px 0;
}
.press-item__date {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
  min-width: 64px;
}
.press-item__outlet { color: var(--muted); margin-right: 8px; }
.press-item__title { color: var(--fg); }
.proj__pubs-heading {
  font-size: 16px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--fg);
  margin: 0 0 16px;
}
.link-pill {
  display: inline-block;
  padding: 6px 14px;
  border: 0.5px solid var(--accent);
  border-radius: 5px;
  font-size: 12px;
  color: var(--accent);
}
.link-pill:hover { background: var(--accent); color: var(--bg); text-decoration: none; }

/* Previous / Next navigation */
.proj__nav {
  margin-top: 64px;
  padding-top: 28px;
  border-top: 0.5px solid var(--rule);
  display: flex;
  justify-content: space-between;
  gap: 24px;
}
.proj__nav-prev { text-align: left; }
.proj__nav-next { text-align: right; margin-left: auto; }
.proj__nav-label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 4px;
}
.proj__nav a { font-weight: 700; font-size: 15px; }

/* ---- Art variant: dark background, amber accent, regardless of mode ---- */
.proj--art {
  --bg: var(--black);
  --fg: var(--white);
  --accent: var(--orange);
  --rule: rgba(255,255,255,0.18);
  --muted: rgba(255,255,255,0.6);
  background: var(--black);
  color: var(--white);
  margin: -1px 0;
  padding-bottom: 80px;
}

/* ---------- Footer ------------------------------------------------------ */

.site-footer {
  margin-top: 32px;
  padding: 0 0 40px;
}
.site-footer .rule { margin-bottom: 48px; }
.site-footer__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--gutter);
}
/* Three blocks (logo, nav, Imperial) spanning the full content width */
.site-footer__top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 40px;
}
/* Footer nav is mode-aware: Science shows full nav, Art shows only About */
[data-mode="research"] .site-footer__nav--gallery { display: none; }
[data-mode="gallery"]  .site-footer__nav--research { display: none; }
.site-footer__logo { display: block; width: 52px; height: 52px; }
.site-footer__logo svg { width: 100%; height: 100%; display: block; }
.site-footer__col { display: flex; flex-direction: column; gap: 12px; }
.site-footer__col a {
  font-size: 14px;
  color: var(--fg);
}
.site-footer__col a:hover { color: var(--accent); }
.site-footer__imperial { color: var(--muted) !important; font-size: 13px !important; }
.site-footer__imperial .imperial-svg {
  display: block;
  width: 150px;
  height: auto;
  color: var(--fg);
  margin-top: 2px;
}
.site-footer__imperial:hover .imperial-svg { color: var(--accent); }

.site-footer__legal-text {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.7;
  margin-top: 8px;
}
.site-footer__social { display: flex; gap: 16px; align-items: center; margin-top: 6px; }
.site-footer__social a {
  color: var(--muted);
  display: inline-flex;
}
.site-footer__social a:hover { color: var(--accent); }
.site-footer__social svg { width: 18px; height: 18px; display: block; }

/* ---------- Album masonry grid ----------------------------------------- */

/* Column-based masonry: photos keep their natural aspect ratio and pack into
   columns. 3 columns on desktop, 2 on tablet, 1 on phone (set in responsive). */
.album-masonry {
  column-count: 3;
  column-gap: 12px;
}
.album-item {
  break-inside: avoid;
  margin: 0 0 12px;
  padding: 0;
  border: 0;
  width: 100%;
  background: none;
  cursor: zoom-in;
  display: block;
}
.album-item img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 5px;
}
.album-item figcaption {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
  line-height: 1.4;
}

/* Cover gallery: uniform A4-ish portrait tiles (Publications page) */
.covers-title {
  margin: 0 0 18px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-align: center;
  color: var(--fg);
}
.cover-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 20px;
  margin: 0 0 40px;
}
.cover-item {
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  cursor: zoom-in;
}
.cover-item img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  display: block;
  border-radius: 5px;
  border: 0.5px solid var(--rule);
}
.cover-item figcaption {
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
  line-height: 1.4;
}

/* Lightbox overlay */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.88);
  padding: 32px;
}
.lightbox.is-open { display: flex; }
.lightbox__img {
  max-width: 92vw;
  max-height: 82vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 5px;
}
.lightbox__caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 24px;
  text-align: center;
  color: var(--white);
  font-size: 14px;
  padding: 0 24px;
}
.lightbox__close,
.lightbox__nav {
  position: absolute;
  appearance: none;
  background: transparent;
  border: 0;
  color: var(--white);
  cursor: pointer;
  line-height: 1;
}
.lightbox__close { top: 20px; right: 24px; font-size: 32px; }
.lightbox__nav { top: 50%; transform: translateY(-50%); font-size: 44px; padding: 12px; }
.lightbox__nav--prev { left: 12px; }
.lightbox__nav--next { right: 12px; }
.lightbox__nav:hover, .lightbox__close:hover { color: var(--accent); }

/* ---------- Collapsing header (all pages) ------------------------------- */
/* Full header on load; once scrolled, JS adds --compact to shrink it to a
   single row: logo on the left, menu/hamburger on the right. */
.site-header--compact {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 24px;
  padding: 8px var(--gutter);
}
.site-header--compact .wordmark { flex-direction: row; padding: 0; margin: 0; gap: 10px; }
.site-header--compact .wordmark__name { display: none; }
.site-header--compact .wordmark__logo { width: 40px; height: 40px; }
.site-header--compact .mode-toggle { display: none; }
.site-header--compact .site-header__utility { margin: 0 0 0 auto; }
.site-header--compact .site-menu { margin: 0; max-width: none; padding: 0; justify-content: flex-end; }
.site-header--compact .rule { display: none; }
@media (max-width: 879px) {
  .site-header--compact .site-menu { flex-basis: 100%; align-items: flex-end; }
}

/* ---------- Full-screen deck homepage ----------------------------------- */
body.is-deck { height: 100dvh; overflow: hidden; }
body.is-deck .site-main { height: 100dvh; }

/* The shared header floats over the imagery, frosted and white */
body.is-deck .site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  background: transparent;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  padding-bottom: 10px;
}
body.is-deck .site-header::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: rgba(22, 26, 29, 0.5);   /* over a dark panel (Science + Art) */
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  pointer-events: none;
}
/* Front page frost follows the panel brightness (light image -> white frost). */
body.is-deck .site-header--on-light::before { background: rgba(255, 255, 255, 0.6); }

/* Header chrome, driven by the per-context tokens set on .site-header above. */
.site-header .wordmark__name,
.site-header .wordmark__suffix--lab,
.site-header .wordmark__suffix--studio,
.site-header .site-menu__link {
  color: var(--hdr-fg);
  text-shadow: var(--hdr-shadow);
}
.site-header .site-menu__link:hover,
.site-header .site-menu__link.is-active { color: var(--accent); }
.site-header .mode-toggle { border-color: var(--hdr-fg); background: transparent; }
.site-header .mode-toggle__btn { color: var(--hdr-fg); }
.site-header .mode-toggle__btn[aria-selected="true"] { background: var(--hdr-fg); color: var(--hdr-fg-inv); }
.site-header .menu-btn__bar { background: var(--hdr-fg); }
/* Logo: disc takes the chrome color, the "AIM" mark takes its inverse. */
.site-header .wordmark__logo svg > circle { fill: var(--hdr-fg); }
.site-header .wordmark__logo svg g { fill: var(--hdr-fg-inv); }
/* Front-page wordmark suffix keeps the mode color (Laboratory blue, Studio
   orange). It only shows on the homepage, where the full name is visible. */
.site-header .wordmark__suffix--lab { color: var(--blue); }
.site-header .wordmark__suffix--studio { color: var(--orange); }

/* Two decks, one per mode */
[data-mode="research"] .deck--gallery { display: none; }
[data-mode="gallery"]  .deck--research { display: none; }
.deck {
  height: 100dvh;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  scrollbar-width: none;
}
.deck::-webkit-scrollbar { display: none; }
.deck__panel {
  position: relative;
  height: 100%;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: flex-end;
}
.deck__panel::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(22,26,29,0.78) 0%, rgba(22,26,29,0.25) 38%, rgba(22,26,29,0.05) 60%);
  pointer-events: none;
}
.deck__text {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--gutter) 44px;
  color: var(--white);
}
.deck__title {
  font-size: clamp(20px, 2.4vw, 30px);
  line-height: 1.06;
  font-weight: 700;
  letter-spacing: -0.015em;
  margin: 0 0 10px;
  max-width: 18em;
  text-shadow: 0 2px 14px rgba(0,0,0,0.45);
}
.deck__title a { color: inherit; text-decoration: none; }
.deck__title a:hover { text-decoration: underline; }
.deck__subtitle {
  font-family: Georgia, "Times New Roman", Times, serif;
  font-style: italic;
  font-size: clamp(14px, 1.4vw, 18px);
  line-height: 1.45;
  opacity: 0.9;
  margin: 0 0 18px;
  max-width: 36em;
  text-shadow: 0 1px 8px rgba(0,0,0,0.5);
}
.deck__link {
  display: inline-block;
  color: var(--white);
  font-size: 14px;
  font-weight: 700;
  padding: 9px 16px;
  border: 1px solid rgba(255,255,255,0.65);
  border-radius: 5px;
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  transition: background 0.15s ease, color 0.15s ease;
}
.deck__link:hover { background: var(--white); color: var(--black); text-decoration: none; }
.deck__panel--first { flex-direction: column; align-items: stretch; justify-content: flex-end; }
.deck__panel--first::after {
  background: linear-gradient(to top, rgba(22,26,29,0.78) 0%, rgba(22,26,29,0.4) 38%, rgba(22,26,29,0.32) 100%);
}
.deck__tagline {
  position: relative;
  flex: 1;
  min-height: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 300px var(--gutter) 0;
  pointer-events: none;
}
.deck__tagline p {
  font-family: Georgia, "Times New Roman", Times, serif;
  font-style: italic;
  font-size: clamp(20px, 2.4vw, 30px);
  line-height: 1.55;
  color: var(--white);
  max-width: 26em;
  margin: 0;
  text-shadow: 0 2px 12px rgba(0,0,0,0.55);
}
.deck__hint {
  position: absolute;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  z-index: 1;
  color: var(--white);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  opacity: 0.8;
  animation: deckHint 2.2s ease-in-out infinite;
}
@keyframes deckHint {
  0%, 100% { transform: translate(-50%, 0); }
  50% { transform: translate(-50%, 6px); }
}

/* ---------- Responsive -------------------------------------------------- */

@media (max-width: 900px) {
  .album-masonry { column-count: 2; }
}

@media (max-width: 720px) {
  .wordmark__logo { width: 72px; height: 72px; }
  .wordmark__name { font-size: 24px; }
  .home-tagline { font-size: 19px; }
  .research-grid, .art-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 20px; }
  .research-scroller .research-card { flex-basis: 300px; }
  .home-cols { grid-template-columns: 1fr; gap: 36px; }
  .people-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 18px; }
  .album-masonry { column-count: 1; }
  .proj__meta-row { grid-template-columns: 1fr; gap: 4px; }
  .course--with-media { flex-direction: column; }
  .course--with-media .course__media { flex-basis: auto; width: 50%; }
  .site-footer__top { flex-wrap: wrap; gap: 28px; }
  .site-footer__brand { flex-basis: 100%; }
  .site-footer__col--end { flex-basis: 100%; }
}
