/* ==========================================================================
   Cho's Group @ UIC — design system

   A light page in UIC's navy and red. The lab images do the talking:
   fluorescence micrographs, membrane renders, mechanism figures, so the
   interface stays quiet and lets them carry the colour.

   Every colour is a custom property in :root below — change them there and
   the whole site follows.
   ========================================================================== */

@font-face {
  font-family: "Inter";
  src: url("../fonts/inter-var.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
  font-style: normal;
}
@font-face {
  font-family: "Space Grotesk";
  src: url("../fonts/space-grotesk-var.woff2") format("woff2");
  font-weight: 300 700;
  font-display: swap;
  font-style: normal;
}

:root {
  --ink: #ffffff;
  --ink-2: #f4f6fa;
  --ink-3: #e7ebf2;
  --line: #d3d9e4;
  --bone: #001e62;
  --bone-dim: #45527d;
  --grey: #66708b;
  --accent: #d50032;
  --accent-dim: #ff8fa3;

  /* text + rules inside the inverted .section--bone band */
  --bone-muted: #b9c2da;
  --bone-line: #3d4d7d;

  --measure: 68ch;
  --gutter: clamp(1.25rem, 5vw, 4.5rem);
  --shell: 80rem;

  --step-0: 1rem;
  --step-1: clamp(1.1rem, 0.4vw + 1rem, 1.25rem);
  --step-2: clamp(1.35rem, 1vw + 1.1rem, 1.75rem);
  --step-3: clamp(1.75rem, 2vw + 1.2rem, 2.5rem);
  --step-4: clamp(2.25rem, 4vw + 1.2rem, 3.75rem);
  --step-5: clamp(2.75rem, 6.5vw + 1rem, 5.5rem);

  color-scheme: light;
}

*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  background: var(--ink);
  color: var(--bone);
  font-family: "Inter", ui-sans-serif, system-ui, -apple-system, sans-serif;
  font-size: var(--step-0);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
  font-family: "Space Grotesk", "Inter", sans-serif;
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.022em;
  margin: 0;
  text-wrap: balance;
}
h1 { font-size: var(--step-5); }
h2 { font-size: var(--step-4); }
h3 { font-size: var(--step-2); }

p { margin: 0; text-wrap: pretty; }
img { max-width: 100%; height: auto; display: block; }

a { color: inherit; }
a:focus-visible,
button:focus-visible,
input:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 3px;
}

::selection { background: var(--accent); color: var(--ink); }

.skip-link {
  position: absolute;
  left: -9999px;
}
.skip-link:focus {
  left: 1rem;
  top: 1rem;
  z-index: 100;
  padding: 0.75rem 1.25rem;
  background: var(--bone);
  color: var(--ink);
  border-radius: 999px;
  font-weight: 500;
}

/* --------------------------------------------------------------- layout */

.shell {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section { padding-block: clamp(4rem, 9vw, 8rem); }
.section--tight { padding-block: clamp(3rem, 6vw, 5rem); }
.section--bone { background: var(--bone); color: var(--ink); }
.section--raised { background: var(--ink-2); }

.section--bone .eyebrow { color: var(--accent-dim); }
.section--bone .lead,
.section--bone .muted { color: var(--bone-muted); }

.eyebrow {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 1rem;
}

.lead {
  font-size: var(--step-1);
  color: var(--bone-dim);
  max-width: var(--measure);
}
.muted { color: var(--grey); }

/* --------------------------------------------------------------- header */

.masthead {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--ink) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.masthead__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  min-height: 4.5rem;
}
.wordmark {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  text-decoration: none;
  display: inline-flex;
  align-items: baseline;
  gap: 0.5ch;
  white-space: nowrap;
}
.wordmark span { color: var(--accent); }

.nav { display: flex; align-items: center; gap: 1.75rem; }
.nav a {
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--bone-dim);
  padding-block: 0.4rem;
  border-bottom: 1px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}
.nav a:hover { color: var(--bone); }
.nav a[aria-current="page"] {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.nav-toggle {
  display: none;
  width: 2.75rem;
  height: 2.75rem;
  margin-right: -0.5rem;
  background: none;
  border: 0;
  color: inherit;
  cursor: pointer;
  align-items: center;
  justify-content: center;
}
.nav-toggle span {
  display: block;
  width: 1.4rem;
  height: 1px;
  background: currentColor;
  position: relative;
}
.nav-toggle span::before,
.nav-toggle span::after {
  content: "";
  position: absolute;
  left: 0;
  width: 1.4rem;
  height: 1px;
  background: currentColor;
  transition: transform 0.25s;
}
.nav-toggle span::before { top: -6px; }
.nav-toggle span::after { top: 6px; }
.nav-toggle[aria-expanded="true"] span { background: transparent; }
.nav-toggle[aria-expanded="true"] span::before { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span::after { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 60rem) {
  .nav-toggle { display: inline-flex; }
  .nav {
    position: fixed;
    inset: 4.5rem 0 auto;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--ink);
    border-bottom: 1px solid var(--line);
    padding: 0 var(--gutter) 1.5rem;
    max-height: calc(100dvh - 4.5rem);
    overflow-y: auto;
  }
  .nav[hidden] { display: none; }
  .nav a {
    font-size: 1.05rem;
    padding-block: 1rem;
    border-bottom: 1px solid var(--line);
    text-transform: none;
    letter-spacing: 0;
  }
}

.page-head {
  border-bottom: 1px solid var(--line);
  padding-block: clamp(6rem, 12vw, 9rem) clamp(2.5rem, 5vw, 4rem);
}
/* Every page heading and its standfirst, defined once here instead of being
   repeated as inline styles on each page. */
.page-title { font-size: var(--step-4); max-width: 18ch; }
.page-head .lead { margin-top: 1.75rem; }

/* ---------------------------------------------------------------- links */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.85rem 1.6rem;
  border-radius: 3px;
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  border: 1px solid transparent;
  transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}
.btn--primary { background: var(--accent); color: var(--ink); }
.btn--primary:hover { background: var(--bone); }
.btn--ghost { border-color: var(--line); color: var(--bone); }
.btn--ghost:hover { border-color: var(--bone); background: var(--bone); color: var(--ink); }
.section--bone .btn--ghost { border-color: var(--bone-line); color: var(--ink); }
.section--bone .btn--ghost:hover { background: var(--ink); color: var(--bone); border-color: var(--ink); }

.btn-row { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 2.25rem; }

.link-underline {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
  transition: border-color 0.2s;
}
.link-underline:hover { border-bottom-color: var(--accent); }

/* ---------------------------------------------------------------- grids */

.grid { display: grid; gap: clamp(1.5rem, 3vw, 2.5rem); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(min(17rem, 100%), 1fr)); }
/* auto-fill, not auto-fit: a group of one keeps a card-sized track
   instead of stretching across the whole row. */
.grid--4 { grid-template-columns: repeat(auto-fill, minmax(min(13rem, 100%), 1fr)); }

.split {
  display: grid;
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
}
@media (min-width: 62rem) {
  .split { grid-template-columns: 1fr 1fr; }
  .split--wide-first { grid-template-columns: 1.2fr 0.8fr; }
  .split--wide-last { grid-template-columns: 0.8fr 1.2fr; }
}

/* --------------------------------------------------------------- pieces */

.figure { margin: 0; }
.figure img { border-radius: 1.4rem; }
.figure figcaption {
  margin-top: 0.85rem;
  font-size: 0.85rem;
  color: var(--grey);
}
.figure--frame img {
  border: 1px solid var(--line);
  background: var(--ink-2);
}

/* ------------------------------------------------------- research thrusts */

/* The research overview and the thrust prose run at reading measure; the
   figure column stacks however many figures a thrust carries. */
.overview-body {
  margin-top: 1.75rem;
  display: grid;
  gap: 1.1rem;
  max-width: var(--measure);
  font-size: var(--step-1);
  color: var(--bone-dim);
}
.thrusts-head {
  font-size: var(--step-2);
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--line);
}
.thrust-body {
  margin-top: 1.5rem;
  display: grid;
  gap: 1.1rem;
  color: var(--bone-dim);
  max-width: var(--measure);
}
.thrust-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1rem;
}
.thrust-list li {
  border-left: 2px solid var(--line);
  padding-left: 1.1rem;
}
.thrust-list b { color: var(--bone); font-weight: 600; }
.thrust-figures { display: grid; gap: clamp(1.5rem, 3vw, 2.25rem); }
.thrust-figures img { width: 100%; height: auto; }

.project {
  border-top: 1px solid var(--line);
  padding-top: 2rem;
}
.project__index {
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.8rem;
  letter-spacing: 0.16em;
  color: var(--accent);
}
.project h3 { margin-top: 0.75rem; }
.project p { margin-top: 1.1rem; color: var(--bone-dim); max-width: var(--measure); }

.news-item {
  display: grid;
  gap: 0.4rem;
  padding-block: 1.5rem;
  border-top: 1px solid var(--line);
}
.news-item__meta {
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--grey);
}
.news-item h3 { font-size: var(--step-1); font-weight: 500; }

/* Group label above the first member of each group. Every card carries the
   element, empty or not, so portraits stay aligned across a row. */
/* One heading per category, its rule spanning the whole group of cards.
   The categories share a single four-column grid: research faculty takes one
   column and doctoral researchers the other three, so they sit on one line.
   Each category is a subgrid of that track list, which keeps every portrait
   exactly the same width no matter which category it belongs to. */
.team-row { display: grid; gap: clamp(1.5rem, 3vw, 2.5rem); }
.team-group {
  display: grid;
  gap: clamp(1.5rem, 3vw, 2.5rem);
  grid-template-columns: repeat(auto-fill, minmax(min(13rem, 100%), 1fr));
}
.team-group__label {
  grid-column: 1 / -1;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--accent);
  padding-bottom: 0.85rem;
  margin: 0;
  border-bottom: 1px solid var(--line);
}
@media (min-width: 62rem) {
  .team-row {
    grid-template-columns: repeat(4, 1fr);
    row-gap: clamp(3rem, 6vw, 4.5rem);
    align-items: start;
  }
  .team-group { grid-template-columns: subgrid; }
  .team-group--1 { grid-column: span 1; }
  .team-group--2 { grid-column: span 2; }
  .team-group--3 { grid-column: span 3; }
  .team-group--4 { grid-column: 1 / -1; }
}
/* Pre-subgrid browsers get fixed track counts, which line up everywhere
   except across the faculty/doctoral boundary. */
@supports not (grid-template-columns: subgrid) {
  @media (min-width: 62rem) {
    .team-group--1 { grid-template-columns: 1fr; }
    .team-group--2 { grid-template-columns: repeat(2, 1fr); }
    .team-group--3 { grid-template-columns: repeat(3, 1fr); }
    .team-group--4 { grid-template-columns: repeat(4, 1fr); }
  }
}

/* ------------------------------------------------------------------ alumni */

.alum-list {
  list-style: none;
  margin: 2.5rem 0 0;
  padding: 0;
  display: grid;
  gap: 0 2.5rem;
  grid-template-columns: repeat(auto-fill, minmax(min(15rem, 100%), 1fr));
}
.alum { border-top: 1px solid var(--line); padding-block: 1.1rem; }
.alum__name { font-weight: 500; }
.alum__where { font-size: 0.9rem; color: var(--grey); }
.alum__field { font-size: 0.92rem; color: var(--bone-dim); margin-top: 0.35rem; }

.person figure { margin: 0; }
.person img {
  aspect-ratio: 1;
  object-fit: cover;
  width: 100%;
  border-radius: 1.4rem;
  background: var(--ink-3);
}
.person h3 { margin-top: 1rem; font-size: 1.05rem; font-weight: 600; }
.person__role {
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-top: 0.35rem;
}
.person__email { font-size: 0.85rem; margin-top: 0.35rem; word-break: break-all; }
.person__email a { color: var(--grey); text-decoration: none; }
.person__email a:hover { color: var(--bone); }

.lead-person {
  display: grid;
  gap: clamp(2rem, 4vw, 3.5rem);
  align-items: start;
}
@media (min-width: 50rem) {
  .lead-person { grid-template-columns: minmax(0, 20rem) 1fr; }
}

/* ------------------------------------------------------- publications */

.pub-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  padding-block: 1.25rem;
  border-block: 1px solid var(--line);
  position: sticky;
  top: 4.5rem;
  background: color-mix(in srgb, var(--ink) 94%, transparent);
  backdrop-filter: blur(8px);
  z-index: 20;
}
.pub-search {
  flex: 1 1 18rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 0.55rem 1.1rem;
}
.pub-search input {
  flex: 1;
  background: none;
  border: 0;
  color: inherit;
  font: inherit;
  min-width: 0;
}
.pub-search input::placeholder { color: var(--grey); }
.pub-count { font-size: 0.85rem; color: var(--grey); font-variant-numeric: tabular-nums; }

.pub-year {
  font-family: "Space Grotesk", sans-serif;
  font-size: var(--step-3);
  font-weight: 500;
  color: var(--accent);
  padding-top: 2.5rem;
  font-variant-numeric: tabular-nums;
}
.pub-list { list-style: none; margin: 0; padding: 0; }
.pub {
  padding-block: 1.25rem;
  border-top: 1px solid var(--line);
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--bone-dim);
  max-width: 90ch;
}
.pub a { color: var(--accent); text-decoration: none; }
.pub a:hover { text-decoration: underline; }
.pub__links {
  display: flex;
  gap: 1rem;
  margin-top: 0.5rem;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.pub[hidden] { display: none; }
.pub-empty { padding-block: 3rem; color: var(--grey); }

/* -------------------------------------------------------------- gallery */

.masonry { column-gap: 1rem; columns: 1; }
@media (min-width: 40rem) { .masonry { columns: 2; } }
@media (min-width: 64rem) { .masonry { columns: 3; } }
.masonry figure {
  break-inside: avoid;
  margin: 0 0 1rem;
}
.masonry img { border-radius: 0.75rem; }

/* --------------------------------------------------------------- footer */

.site-footer {
  border-top: 1px solid var(--line);
  background: var(--ink-2);
  padding-block: clamp(3rem, 6vw, 4.5rem) 2rem;
  margin-top: clamp(4rem, 8vw, 7rem);
}
.site-footer__grid {
  display: grid;
  gap: 2.5rem;
  align-items: start;
}
@media (min-width: 50rem) {
  .site-footer__grid { grid-template-columns: 1.4fr 1fr 1fr; }
}
.site-footer a { color: var(--bone-dim); text-decoration: none; }
.site-footer a:hover { color: var(--bone); }
.site-footer ul { list-style: none; margin: 0.75rem 0 0; padding: 0; display: grid; gap: 0.6rem; font-size: 0.92rem; }
.site-footer h2 { font-size: 0.72rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--accent); font-weight: 600; }
.colophon {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  font-size: 0.8rem;
  color: var(--grey);
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 2rem;
  justify-content: space-between;
}
.footer-logo { height: 3rem; width: auto; opacity: 0.9; border-radius: 0.35rem; }

/* ------------------------------------------------------------- contact */

.contact-card {
  border: 1px solid var(--line);
  border-radius: 1.5rem;
  padding: clamp(1.75rem, 4vw, 2.75rem);
  background: var(--ink-2);
}
.contact-card dt {
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
}
.contact-card dd {
  margin: 0.5rem 0 1.75rem;
  font-size: var(--step-1);
}
.contact-card dd:last-child { margin-bottom: 0; }

/* One horizontal band. Flex, not grid: each field takes only the width its
   content needs, so the long address does not force every other field into a
   column of the same width and strand a row of empty cells beside it. */
.contact-card--wide { padding: clamp(1.5rem, 3vw, 2.25rem); }
.contact-card--wide dl { margin: 0; display: flex; flex-wrap: wrap;
  align-items: flex-start; gap: 1.5rem clamp(2rem, 4vw, 3.5rem); }
.contact-card--wide dd { margin: 0.45rem 0 0; font-size: var(--step-0);
  line-height: 1.45; }
.contact-card--wide .contact-card__cta { margin-left: auto; align-self: center; }
/* The PI takes the first line on its own; everything else shares the second,
   separated by a hairline so the two bands read as a hierarchy. */
.contact-card--wide .contact-card__lead { flex: 0 0 100%;
  padding-bottom: 1.35rem; border-bottom: 1px solid var(--line); }
.contact-card--wide .contact-card__lead dd { font-size: var(--step-1); }

/* -------------------------------------------------------------- reveal */

.reveal { opacity: 1; }
@media (prefers-reduced-motion: no-preference) {
  .js .reveal {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.65s cubic-bezier(0.22, 1, 0.36, 1),
      transform 0.65s cubic-bezier(0.22, 1, 0.36, 1);
  }
  .js .reveal.is-visible { opacity: 1; transform: none; }
}

.bento-hero { display: grid; gap: clamp(2rem, 4vw, 3.5rem); align-items: center;
  padding-block: clamp(2.5rem, 6vw, 4.5rem); }
@media (min-width: 62rem) { .bento-hero { grid-template-columns: 0.85fr 1.15fr; } }

.bento-hero h1 { font-size: clamp(2.1rem, 4.4vw + 1rem, 3.6rem); font-weight: 500;
  letter-spacing: -0.03em; line-height: 1.05; }
.bento-hero .lead { margin-top: 1.5rem; max-width: 46ch; color: var(--bone-dim); }

.bento { display: grid; gap: 0.75rem; grid-template-columns: repeat(3, 1fr); }

.bento figure { margin: 0; border-radius: 0.9rem; overflow: hidden;
  border: 1px solid var(--line); background: var(--ink-3); }
.bento figure img { width: 100%; height: 100%; object-fit: cover; border-radius: 0; }

/* one main image, then a square and a double-width tile beneath it */
.b-main { grid-column: 1 / -1; aspect-ratio: 16 / 10; }
/* The cover render is 16:9; give the cell its own ratio so nothing is cropped. */
.b-main--photo { aspect-ratio: 16 / 9; }
.b-sq { aspect-ratio: 1; }
/* The row itself carries the height, via its own aspect-ratio, and both tiles
   simply fill it. Putting aspect-ratio on the tiles instead does not work: with
   flex:1 1 0 their base size is 0, so the ratio yields a zero hypothetical
   height and the flex line sizes itself from the images instead. One definite
   height on the parent removes every one of those interactions. */
.bento-row { grid-column: 1 / -1; display: flex; gap: 0.75rem; align-items: stretch;
             aspect-ratio: 14 / 3; }
/* position:relative is required on BOTH tiles: the images inside are absolute,
   and without a positioned parent they resolve against the viewport and cover
   the page. */
.bento-row > .b-sq   { flex: 1 1 0; min-width: 0; height: 100%; position: relative; }
.bento-row > .b-wide { flex: 2 1 0; min-width: 0; height: 100%; position: relative; }
.bento-row > figure img { position: absolute; top: 0; left: 0; width: 100%; height: 100%;
                         object-fit: cover; }

