/* =========================================================================
   [LAB NAME] — site styles
   Design tokens live in :root. Change --accent to re-theme the whole site.
   ========================================================================= */

:root {
  /* Color */
  --bg:          #FBFBFC;   /* soft cool white page background */
  --surface:     #FFFFFF;   /* cards / raised areas */
  --ink:         #16305C;   /* primary text — Rochester navy (dark blue) */
  --muted:       #5A6472;   /* secondary text */
  --accent:      #16305C;   /* Rochester navy — the lab's signature color */
  --accent-ink:  #0E2044;   /* darker navy for hover */
  --accent-soft: #E7ECF4;   /* pale blue wash for section bands */
  --gold:        #F5B315;   /* dandelion gold — used sparingly (UR nod) */
  --line:        #E4E6EC;   /* hairline borders */
  --dot:         rgba(22, 48, 92, 0.09); /* background tile dots (navy). Lower alpha = fainter */

  /* Type */
  --display: "Roboto", Georgia, "Times New Roman", serif;
  --body:    "Public Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  /* Layout */
  --maxw: 1080px;
  --gutter: clamp(1.25rem, 4vw, 3rem);
}

/* ---- Reset-ish ---------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background-color: var(--bg);
  background-image: radial-gradient(var(--dot) 1.2px, transparent 1.2px);
  background-size: 20px 20px;
  color: var(--ink);
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.65;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-ink); text-decoration: underline; }

/* ---- Typography --------------------------------------------------------- */
h1, h2, h3 {
  font-family: var(--display);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 0 0 0.5em;
}
h1 { font-size: clamp(2.1rem, 5vw, 3.4rem); font-weight: 460; }
h2 { font-size: clamp(1.55rem, 3vw, 2.2rem); }
h3 { font-size: 1.25rem; font-family: var(--body); font-weight: 700; letter-spacing: 0; }
p  { margin: 0 0 1.1em; }
p:last-child { margin-bottom: 0; }

/* Eyebrow label — small uppercase tag above section titles */
.eyebrow {
  font-family: var(--body);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 0.9rem;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}
.eyebrow::before {
  content: "";
  width: 1.75rem;
  height: 3px;
  background: var(--gold);
  border-radius: 2px;
  display: inline-block;
}

/* ---- Layout helpers ----------------------------------------------------- */
.wrap { max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: clamp(3rem, 7vw, 5.5rem); }
.section--band { background: var(--surface); border-block: 1px solid var(--line); }
.lede { font-size: clamp(1.15rem, 2vw, 1.4rem); line-height: 1.5; color: var(--ink); max-width: 60ch; }
.measure { max-width: 68ch; }

/* ---- Header / nav ------------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(150%) blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-header__inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1.5rem; min-height: 68px;
}
.brand { display: flex; flex-direction: row; align-items: center; gap: 0.65rem; text-decoration: none; }
.brand:hover { text-decoration: none; }
.brand__logo { height: 42px; width: auto; display: block; flex: none; }
.brand__text { display: flex; flex-direction: column; line-height: 1; }
.brand__name {
  font-family: var(--display);
  font-size: 1.3rem; font-weight: 600; letter-spacing: -0.01em;
  color: var(--ink);
}
.brand__sub {
  font-size: 0.7rem; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--muted); margin-top: 0.28rem;
}

.nav { display: flex; align-items: center; gap: 0.35rem; }
.nav a {
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 500;
  padding: 0.45rem 0.7rem;
  border-radius: 6px;
  text-decoration: none;
  position: relative;
}
.nav a:hover { background: var(--accent-soft); color: var(--accent-ink); }
.nav a[aria-current="page"] { color: var(--accent); }
.nav a[aria-current="page"]::after {
  content: ""; position: absolute; left: 0.7rem; right: 0.7rem; bottom: 0.15rem;
  height: 2px; background: var(--accent); border-radius: 2px;
}

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  background: none; border: 1px solid var(--line); border-radius: 8px;
  width: 42px; height: 40px; cursor: pointer; padding: 0;
  align-items: center; justify-content: center;
}
.nav-toggle span, .nav-toggle span::before, .nav-toggle span::after {
  content: ""; display: block; width: 18px; height: 2px; background: var(--ink);
  transition: transform 0.2s ease, opacity 0.2s ease; position: relative;
}
.nav-toggle span::before { position: absolute; top: -6px; }
.nav-toggle span::after  { position: absolute; top: 6px; }

/* ---- Hero --------------------------------------------------------------- */
.hero { padding-block: clamp(3.5rem, 8vw, 6rem) clamp(2.5rem, 6vw, 4rem); }
.hero__grid { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.hero h1 { margin-bottom: 0.6rem; }
.hero .lede { margin-top: 1.2rem; color: var(--muted); }
.hero__figure {
  aspect-ratio: 4 / 3;
  background: var(--accent-soft);
  border-radius: 12px;
  border: 1px solid var(--line);
  display: grid; place-items: center;
  color: var(--accent);
  overflow: hidden;
}
.hero__figure img { width: 100%; height: 100%; object-fit: cover; }
.hero__img { width: 100%; height: auto; display: block; }
.hero__media { margin: 0; }
.hero__caption { margin-top: 0.7rem; font-size: 0.85rem; color: var(--muted); text-align: center; font-style: italic; }
.placeholder-note { font-size: 0.85rem; color: var(--accent); text-align: center; padding: 1rem; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-weight: 600; font-size: 0.95rem;
  padding: 0.7rem 1.25rem; border-radius: 8px;
  background: var(--accent); color: #fff; text-decoration: none;
  border: 1px solid var(--accent);
  transition: background 0.15s ease, transform 0.05s ease;
}
.btn:hover { background: var(--accent-ink); color: #fff; text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn--ghost { background: transparent; color: var(--accent); }
.btn--ghost:hover { background: var(--accent-soft); color: var(--accent-ink); }
.btn-row { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.75rem; }

/* ---- Prose blocks / two-column ----------------------------------------- */
.prose h2 { margin-top: 2.5rem; }
.prose h2:first-child { margin-top: 0; }

/* Card grid (team, news, research highlights) */
.grid { display: grid; gap: 1.5rem; }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--2 { grid-template-columns: repeat(2, 1fr); }

.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; padding: 1.5rem; height: 100%;
}
.card h3 { margin-bottom: 0.25rem; }
.card__role { font-size: 0.85rem; color: var(--accent); font-weight: 600; margin-bottom: 0.6rem; }
.card p { color: var(--muted); font-size: 0.95rem; }

/* Person card with avatar */
.person__photo {
  width: 100%; aspect-ratio: 1; border-radius: 10px; margin-bottom: 1rem;
  background: var(--accent-soft); object-fit: cover;
  display: grid; place-items: center; color: var(--accent); font-family: var(--display); font-size: 2rem;
}

/* Publication list */
.pub-list { list-style: none; margin: 0; padding: 0; }
.pub {
  padding: 1.4rem 0; border-bottom: 1px solid var(--line);
  display: grid; grid-template-columns: 4.5rem 1fr; gap: 1.25rem;
}
.pub:first-child { padding-top: 0; }
.pub__year { font-family: var(--display); font-size: 1.25rem; color: var(--accent); }
.pub__title { font-weight: 600; margin: 0 0 0.3rem; color: var(--ink); }
.pub__meta { font-size: 0.9rem; color: var(--muted); margin: 0 0 0.5rem; }
.pub__links { display: flex; gap: 1rem; font-size: 0.85rem; font-weight: 600; }

/* News items */
.news-item { padding: 1.6rem 0; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 8rem 1fr; gap: 1.5rem; }
.news-item:first-child { padding-top: 0; }
.news-item__date { font-size: 0.85rem; color: var(--muted); font-weight: 600; letter-spacing: 0.03em; padding-top: 0.15rem; }
.news-item h3 { margin-bottom: 0.35rem; }
.news-item p { color: var(--muted); margin: 0; }

/* Contact / join */
.contact-grid { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: clamp(2rem, 5vw, 4rem); }
.address-block { font-style: normal; color: var(--muted); line-height: 1.9; }
.address-block strong { color: var(--ink); font-weight: 600; }
.role-list { list-style: none; margin: 1rem 0 0; padding: 0; }
.role-list li { padding: 0.25rem 0}
.role-list li:first-child { padding-top: 0; }
.role-list strong { display: block; color: var(--ink); }
.role-list span { font-size: 0.92rem; color: var(--muted); }

/* ---- Footer ------------------------------------------------------------- */
.site-footer { border-top: 1px solid var(--line); background: var(--surface); margin-top: 2rem; }
.site-footer__inner {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1.5rem;
  padding-block: 2.5rem;
}
.site-footer .brand__name { font-size: 1.1rem; }
.footer-contact { font-size: 0.9rem; color: var(--muted); line-height: 1.9; }
.footer-contact a { color: var(--muted); }
.footer-contact a:hover { color: var(--accent); }
.footer-nav { display: flex; flex-direction: column; gap: 0.4rem; font-size: 0.9rem; }
.footer-nav a { color: var(--ink); }
.site-footer__legal { border-top: 1px solid var(--line); font-size: 0.8rem; color: var(--muted); padding-block: 1.25rem; }

/* =========================================================================
   Responsive
   ========================================================================= */
@media (max-width: 820px) {
  .hero__grid { grid-template-columns: 1fr; }
  .hero__figure, .hero__media { order: -1; }
  .grid--3 { grid-template-columns: repeat(2, 1fr); }
  .contact-grid { grid-template-columns: 1fr; }

  .nav-toggle { display: inline-flex; }
  .nav {
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--surface); border-bottom: 1px solid var(--line);
    padding: 0.5rem var(--gutter) 1rem;
    display: none;
  }
  .nav.is-open { display: flex; }
  .nav a { padding: 0.75rem 0.5rem; border-radius: 6px; }
  .nav a[aria-current="page"]::after { display: none; }
}

@media (max-width: 560px) {
  .grid--3, .grid--2 { grid-template-columns: 1fr; }
  .pub { grid-template-columns: 1fr; gap: 0.35rem; }
  .pub__year { font-size: 1rem; }
  .news-item { grid-template-columns: 1fr; gap: 0.35rem; }
}

/* ---- Accessibility ------------------------------------------------------ */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.skip-link {
  position: absolute; left: -999px; top: 0; background: var(--accent); color: #fff;
  padding: 0.6rem 1rem; z-index: 100; border-radius: 0 0 6px 0;
}
.skip-link:focus { left: 0; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}

/* Anchor scroll offset so the sticky header doesn't cover section titles */
.hero, .section { scroll-margin-top: 88px; }

/* Team: featured PI card + trainee grid */
.pi-feature { display: flex; gap: 1.75rem; align-items: flex-start; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 1.75rem; }
.pi-feature .person__photo { width: 200px; flex: none; margin-bottom: 0; }
.pi-feature__body { flex: 1; min-width: 0; }
.pi-feature__body h3 { margin-bottom: 0.15rem; }
.card__project { color: var(--muted); }
.card__links { font-size: 0.9rem; font-weight: 600; margin-top: 0.75rem; }
@media (max-width: 560px) {
  .pi-feature { flex-direction: column; align-items: stretch; }
  .pi-feature .person__photo { width: 150px; }
}

/* Publication titles are the link */
.pub__title a { color: var(--ink); text-decoration: none; }
.pub__title a:hover { color: var(--accent); text-decoration: underline; }

/* Uniform vertical people list (photo left, body right) */
.person-list { display: flex; flex-direction: column; gap: 1.25rem; margin-top: 1rem; }
.person-row { display: flex; gap: 1.5rem; align-items: flex-start; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 1.5rem; }
.person-row .person__photo { width: 150px; flex: none; margin-bottom: 0; }
.person-row__body { flex: 1; min-width: 0; }
.person-row__body h3 { margin-bottom: 0.15rem; }
@media (max-width: 560px) {
  .person-row { flex-direction: column; }
  .person-row .person__photo { width: 130px; }
}

/* Research figures (transparent cartoons) */
.fig { margin: 0; }
.fig img { width: 100%; height: auto; display: block; }
.fig figcaption { margin-top: 0.7rem; font-size: 0.85rem; color: var(--muted); font-style: italic; text-align: center; }

/* Education line under a person's role (smaller + italic) */
.person-edu { font-size: 0.78rem; font-style: italic; color: var(--muted); margin-top: 0.12rem; }
