/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #ffffff;
  --bg-alt: #f7f7f5;
  --text: #333333;
  --text-light: #555555;
  --text-muted: #777777;
  --accent: #2c5f8a;
  --accent-light: #e8f0f7;
  --border: #e0ddd8;
  --heading-font: "Source Sans 3", "Helvetica Neue", Arial, sans-serif;
  --body-font: "Source Sans 3", "Helvetica Neue", Arial, sans-serif;
  --max-width: 1200px;
  --nav-height: 64px;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--body-font);
  font-size: 18px;
  line-height: 1.8;
  color: var(--text-light);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 {
  font-family: var(--heading-font);
  color: var(--text);
  font-weight: 600;
  line-height: 1.3;
}

/* ===== NAVIGATION ===== */
nav {
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 100;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  height: var(--nav-height);
}

.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 100%;
}

.nav-logo {
  font-family: var(--heading-font);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
}

.nav-logo:hover { text-decoration: none; }

.nav-links {
  display: flex;
  gap: 28px;
  list-style: none;
  align-items: center;
}

.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 400;
  letter-spacing: 0.01em;
  transition: color 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text);
}

.nav-hire-btn {
  display: inline-block;
  padding: 6px 16px;
  border-radius: 6px;
  background: var(--accent);
  color: #fff !important;
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.2s;
  white-space: nowrap;
}

.nav-hire-btn:hover {
  background: #234f74;
  text-decoration: none;
}

/* Tools dropdown */
.nav-dropdown { position: relative; }
.nav-dd-label {
  color: var(--text-muted); font-size: 0.9rem; font-weight: 400; cursor: default;
  display: inline-flex; align-items: center; gap: 5px; padding: 22px 0; transition: color 0.2s;
}
.nav-dropdown:hover .nav-dd-label,
.nav-dropdown.active-tool .nav-dd-label { color: var(--text); }
.nav-dd-caret { font-size: 0.6rem; }
.nav-dd-menu {
  display: none; position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
  background: var(--bg); border: 1px solid var(--border); border-radius: 8px;
  padding: 8px 0; min-width: 195px; list-style: none; box-shadow: 0 6px 20px rgba(0,0,0,0.10);
}
.nav-dropdown:hover .nav-dd-menu { display: block; }
.nav-dd-menu li { display: block; }
.nav-dd-menu a { display: block; padding: 8px 18px; font-size: 0.88rem; color: var(--text-muted); white-space: nowrap; }
.nav-dd-menu a:hover, .nav-dd-menu a.active { color: var(--text); background: var(--bg-alt); }

/* Hamburger */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  margin: 5px 0;
  transition: 0.3s;
}

@media (max-width: 768px) {
  .nav-toggle { display: block; }

  .nav-links {
    display: none;
    position: absolute;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: var(--bg);
    flex-direction: column;
    padding: 16px 24px 24px;
    gap: 16px;
    border-bottom: 1px solid var(--border);
  }

  .nav-links.open { display: flex; }

  /* Keep the recruiting CTA visible on mobile, beside the menu toggle */
  .nav-logo { order: 1; }
  .nav-hire-btn {
    display: inline-block;
    order: 2;
    margin-left: auto;
    margin-right: 10px;
    padding: 6px 12px;
  }
  .nav-toggle { order: 3; }

  /* Tools dropdown: show submenu inline (indented) inside the open mobile menu */
  .nav-links { align-items: flex-start; }
  .nav-dd-label { padding: 0; }
  .nav-dd-menu {
    display: block; position: static; transform: none; border: none; box-shadow: none;
    padding: 6px 0 0 14px; min-width: 0; margin: 6px 0 0;
  }
  .nav-dd-menu a { padding: 6px 0; }
}

/* ===== HERO ===== */
.hero {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 116px 24px 64px;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 56px;
  align-items: center;
}

.hero h1 {
  font-size: clamp(2.5rem, 5vw, 3.75rem);
  font-weight: 800;
  line-height: 1.05;
  margin-bottom: 16px;
  letter-spacing: -0.02em;
}

.hero .affiliation {
  font-size: 1.05rem;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.hero .affiliation .aff-primary {
  font-size: 1.18rem;
  font-weight: 600;
  color: var(--text);
}

.hero .tagline {
  font-size: 1.15rem;
  line-height: 1.7;
  color: var(--text-light);
  max-width: 640px;
}

.hero .pi-line {
  font-size: 1rem;
  color: var(--text-muted);
  margin-top: 20px;
}

.hero-visual {
  width: 100%;
  max-width: 460px;
  justify-self: center;
}

.hero-visual video {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 12px;
}

@media (max-width: 768px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 32px;
    padding: 96px 24px 48px;
  }
  .hero-visual { max-width: 340px; }
}

/* ===== PAGE HEADER ===== */
.page-header {
  padding: 120px 24px 48px;
  max-width: var(--max-width);
  margin: 0 auto;
}

.page-header h1 {
  font-size: clamp(1.8rem, 3.5vw, 2.5rem);
  margin-bottom: 12px;
}

.page-header .subtitle {
  font-size: 1.05rem;
  color: var(--text-muted);
}

/* ===== SECTIONS ===== */
section {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px 80px;
}

.section-title {
  font-size: 1.6rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.section-subtitle {
  font-size: 1rem;
  color: var(--text-muted);
  margin-bottom: 40px;
}

.section-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 0 auto 80px;
  max-width: var(--max-width);
}

/* ===== FULL-WIDTH ALT BACKGROUND ===== */
.bg-alt {
  background: var(--bg-alt);
  padding: 80px 0;
}

.bg-alt > section,
.bg-alt > .section-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* Breathing room when a white section directly follows a gray band */
.bg-alt + section {
  padding-top: 64px;
}

/* ===== RESEARCH CARDS ===== */
.research-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}

.research-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 28px;
  transition: box-shadow 0.2s;
}

.research-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.08);
}

.card-title {
  font-family: var(--heading-font);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 10px;
}

.card-body {
  font-size: 0.92rem;
  color: var(--text-light);
  line-height: 1.75;
}

.card-tags {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.card-tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 500;
  background: var(--accent-light);
  color: var(--accent);
  border: 1px solid rgba(44, 95, 138, 0.15);
}

/* ===== PIPELINE TABLE ===== */
.pipeline-wrap { overflow-x: auto; }

.pipeline {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.pipeline th {
  text-align: left;
  padding: 10px 14px;
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 2px solid var(--border);
}

.pipeline td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}

.pipeline tr:hover td { background: var(--bg-alt); }

.status {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.status.done { background: var(--accent); }
.status.progress { background: #4a9; }
.status.empty { background: var(--border); }

.pipeline-legend {
  margin-top: 16px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.pipeline-legend .status {
  vertical-align: middle;
  margin-right: 4px;
}

/* ===== RESEARCH HEADINGS ===== */
.research-heading {
  text-align: center;
  font-size: 1.7rem;
  font-weight: 600;
  margin-bottom: 32px;
}

/* ===== ALTERNATING IMAGE + TEXT ===== */
.alt-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
  margin-bottom: 64px;
}

.alt-row:last-child { margin-bottom: 0; }

.alt-row.reverse .alt-text { order: -1; }

.alt-text h3 {
  font-size: 1.3rem;
  margin-bottom: 12px;
}

.alt-text p {
  font-size: 1.05rem;
  color: var(--text-light);
  line-height: 1.85;
}

.alt-img {
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.alt-img img,
.alt-img video {
  width: 100%;
  height: auto;
  max-height: 500px;
  object-fit: contain;
  display: block;
}

/* GCaMP neuron clip shown at ~87.5% of its previous size */
.alt-img video.neuron-video {
  max-width: 438px;
  max-height: 438px;
  margin: 0 auto;
}

@media (max-width: 768px) {
  .alt-row {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .alt-row.reverse .alt-text { order: 0; }
}

/* ===== FULL-WIDTH FIGURE + CAPTION ===== */
.figure-block {
  margin-top: 40px;
}

.figure-block img {
  width: 100%;
  height: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.figure-block figcaption {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 10px;
  text-align: center;
}

/* ===== APPROACH / NUMBERED ITEMS ===== */
.approach-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 32px;
}

.approach-item h3 {
  font-size: 1.05rem;
  margin-bottom: 8px;
}

.approach-item p {
  font-size: 0.9rem;
  color: var(--text-light);
}

.approach-num {
  font-family: var(--heading-font);
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 12px;
  opacity: 0.5;
}

/* ===== PUBLICATIONS ===== */
.pub-list {
  list-style: none;
}

.pub-item {
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

.pub-year {
  font-family: var(--heading-font);
  font-size: 1rem;
  font-weight: 600;
  color: var(--accent);
  min-width: 48px;
  padding-top: 2px;
}

.pub-details { flex: 1; }

.pub-title {
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--text);
  margin-bottom: 4px;
  line-height: 1.5;
}

.pub-authors {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.pub-journal {
  font-size: 0.95rem;
  color: var(--accent);
  font-style: italic;
}

.pub-links {
  margin-top: 6px;
}

.pub-links a {
  font-size: 0.9rem;
  color: var(--accent);
  margin-right: 12px;
}

.patent-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 3px 10px;
  border-radius: 12px;
  background: var(--accent-light);
  color: var(--accent);
  vertical-align: middle;
  margin-left: 6px;
  font-family: var(--body-font);
}

/* ===== PEOPLE ===== */
.people-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 32px;
}

.person-card {
  text-align: center;
}

.person-photo {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: var(--bg-alt);
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid var(--border);
}

.person-name {
  font-family: var(--heading-font);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.person-title {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ===== ABOUT SECTION / BIO ===== */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 48px;
  align-items: start;
}

@media (max-width: 768px) {
  .about-grid { grid-template-columns: 1fr; }
}

.about-bio .person-name {
  font-size: 1.6rem;
  font-weight: 600;
  margin: 0 0 4px;
  color: var(--text);
}

.about-bio .person-title {
  font-size: 0.95rem;
  color: var(--accent);
  margin-bottom: 20px;
}

.about-bio p {
  font-size: 0.95rem;
  color: var(--text-light);
  margin-bottom: 16px;
}

.about-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.stat-box {
  background: var(--bg-alt);
  border-radius: 8px;
  padding: 20px;
  text-align: center;
  border: 1px solid var(--border);
}

.stat-num {
  font-family: var(--heading-font);
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
}

.stat-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ===== JOIN / CTA BOX ===== */
.join-box {
  background: var(--bg-alt);
  border-radius: 8px;
  border: 1px solid var(--border);
  padding: 48px;
  text-align: center;
  margin-top: 40px;
}

.join-box h2 {
  font-size: 1.6rem;
  margin-bottom: 12px;
}

.join-box p {
  color: var(--text-light);
  max-width: 600px;
  margin: 0 auto 24px;
  font-size: 0.95rem;
}

.btn {
  display: inline-block;
  padding: 12px 28px;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  transition: background 0.2s;
}

.btn:hover {
  background: #234f74;
  text-decoration: none;
}

.btn-outline {
  background: transparent;
  color: var(--accent);
  border: 1.5px solid var(--accent);
}

.btn-outline:hover {
  background: var(--accent);
  color: #fff;
}

.hero-cta {
  display: flex;
  gap: 12px;
  margin-top: 32px;
}

/* ===== JOB POSTING ===== */
.job-posting {
  max-width: 780px;
}

.job-posting h2 {
  font-size: 1.5rem;
  margin-bottom: 8px;
}

.job-posting .job-location {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.job-posting p {
  font-size: 0.95rem;
  color: var(--text-light);
  margin-bottom: 16px;
}

.job-posting h3 {
  font-size: 1.1rem;
  margin-top: 32px;
  margin-bottom: 12px;
}

.job-posting ul {
  margin-left: 20px;
  margin-bottom: 16px;
}

.job-posting li {
  font-size: 0.92rem;
  color: var(--text-light);
  margin-bottom: 8px;
  line-height: 1.7;
}

.job-posting .apply-btn {
  margin-top: 32px;
}

/* ===== FOOTER ===== */
footer {
  border-top: 1px solid var(--border);
  padding: 40px 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

footer a {
  color: var(--text-muted);
}

footer a:hover {
  color: var(--text);
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}

.footer-logos {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 36px;
  margin-bottom: 20px;
}

.footer-logos img {
  height: 36px;
  width: auto;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.footer-logos img[src*="tnc-logo"] {
  height: 46px;
}

.footer-logos img:hover {
  opacity: 1;
}

.footer-links {
  margin-bottom: 8px;
}

.footer-links a {
  margin: 0 8px;
}

.footer-address {
  color: #666;
  margin-top: 4px;
}

/* ===== QUICK LINKS (homepage) ===== */
.quick-links {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

.quick-link {
  display: block;
  padding: 20px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  text-decoration: none;
  color: var(--text);
  font-weight: 500;
  font-size: 0.95rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.quick-link:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.08);
  text-decoration: none;
}

.quick-link span {
  display: block;
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 400;
  margin-top: 4px;
}

/* ===== PUBLICATION JUMP LINKS ===== */
.pub-jump-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 32px;
}

/* Offset jump-link targets so the fixed nav does not cover them */
[id^="year-"] { scroll-margin-top: 84px; }

.pub-jump-links a {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 500;
  background: var(--bg-alt);
  color: var(--text-muted);
  text-decoration: none;
  border: 1px solid var(--border);
  transition: all 0.2s;
}

.pub-jump-links a:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  text-decoration: none;
}

/* ===== CONTACT MAP ===== */
@media (max-width: 768px) {
  .contact-grid { grid-template-columns: 1fr !important; }
  .hero { padding: 100px 24px 40px; }
  section { padding-bottom: 48px; }
  .section-divider { margin-bottom: 48px; }
  .section-subtitle { margin-bottom: 24px; }
}

/* ===== UTILITY ===== */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}
