/* ============================================================
   COMPREHEND Lab — Shared Stylesheet
   Brand-aligned. No frameworks, no build step.
   ============================================================ */

:root {
  --navy: #1B2A5E;
  --teal: #3FAB95;
  --ink: #1F2937;
  --paper: #FFFFFF;
  --mist: #E5E7EB;
  --steel: #D9DEE5;
  --smoke: #78909C;
  --gray: #6B7280;

  --shadow-card: 0 2px 8px rgba(27, 42, 94, 0.06);
  --shadow-card-hover: 0 8px 24px rgba(27, 42, 94, 0.12);
  --shadow-nav: 0 2px 12px rgba(27, 42, 94, 0.08);

  --radius-card: 12px;
  --radius-btn: 6px;

  --content-max: 1100px;
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 1rem;
  line-height: 1.65;
  color: var(--ink);
  background: linear-gradient(180deg, #FFFFFF 0%, #F7F9FB 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}
@media (min-width: 1024px) {
  body { font-size: 1.0625rem; }
}

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

:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
  border-radius: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
  html { scroll-behavior: auto; }
}

/* ---------- Layout helpers ---------- */
.container {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 1.5rem;
}
@media (min-width: 1024px) { .container { padding: 0 2rem; } }

main { display: block; }
section { padding: 5rem 0; position: relative; }
@media (min-width: 1024px) { section { padding: 7rem 0; } }

/* ---------- Typography ---------- */
h1, h2, h3, h4 { color: var(--navy); margin: 0 0 0.5em; line-height: 1.2; }
h1 { font-size: clamp(2rem, 5vw, 3.5rem); font-weight: 700; letter-spacing: -0.01em; }
h2 { font-size: clamp(1.5rem, 3vw, 2.25rem); font-weight: 700; letter-spacing: -0.005em; }
h3 { font-size: 1.25rem; font-weight: 700; }
p { margin: 0 0 1em; }

.eyebrow {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--teal);
  margin: 0 0 0.75rem;
}

.lead {
  font-size: clamp(1.125rem, 2vw, 1.375rem);
  color: var(--navy);
  font-weight: 500;
  line-height: 1.5;
}

.caption { font-size: 0.875rem; color: var(--gray); }

/* ---------- Navigation ---------- */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--paper);
  border-bottom: 1px solid transparent;
  transition: box-shadow 200ms ease, border-color 200ms ease;
}
.site-nav.is-scrolled {
  box-shadow: var(--shadow-nav);
  border-bottom-color: var(--mist);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.5rem;
  max-width: var(--content-max);
  margin: 0 auto;
  gap: 1rem;
}
.brand-link {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  color: var(--navy);
  font-weight: 700;
  letter-spacing: 0.02em;
}
.brand-link:hover { text-decoration: none; }
.brand-link img { height: 32px; width: auto; }
@media (min-width: 768px) { .brand-link img { height: 40px; } }
.brand-text { font-size: 0.95rem; }

.nav-toggle {
  appearance: none;
  background: transparent;
  border: 0;
  padding: 0.5rem;
  cursor: pointer;
  color: var(--navy);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.nav-toggle svg { display: block; }
@media (min-width: 768px) { .nav-toggle { display: none; } }

.nav-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: none;
  gap: 1.5rem;
}
.nav-links.is-open {
  display: flex;
  flex-direction: column;
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  background: var(--paper);
  padding: 1rem 1.5rem 1.25rem;
  border-bottom: 1px solid var(--mist);
  box-shadow: var(--shadow-nav);
  gap: 0.75rem;
}
@media (min-width: 768px) {
  .nav-links {
    display: flex !important;
    flex-direction: row;
    position: static;
    background: transparent;
    padding: 0;
    box-shadow: none;
    border: 0;
  }
}
.nav-links a {
  color: var(--navy);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.4rem 0;
  border-bottom: 2px solid transparent;
}
.nav-links a:hover { color: var(--teal); text-decoration: none; }
.nav-links a[aria-current="page"] {
  color: var(--navy);
  border-bottom-color: var(--teal);
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: 0 0 4rem;
  background: radial-gradient(circle at 20% 0%, rgba(63, 171, 149, 0.06), transparent 60%),
              radial-gradient(circle at 80% 10%, rgba(27, 42, 94, 0.05), transparent 55%),
              var(--paper);
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("../assets/network.svg");
  background-repeat: no-repeat;
  background-position: right -80px top -40px;
  background-size: 720px auto;
  opacity: 0.45;
  pointer-events: none;
}
.hero-banner {
  width: 100%;
  max-height: 480px;
  object-fit: contain;
  margin: 0 auto;
  padding: 1.5rem 1rem 0;
  position: relative;
}
.hero-tagline {
  text-align: center;
  padding: 2rem 1.5rem 0;
  position: relative;
}
.hero-tagline .eyebrow { color: var(--teal); }
.hero-tagline .lead { max-width: 760px; margin: 0.5rem auto 0; }

.page-header {
  position: relative;
  padding: 4rem 0 3rem;
  background: radial-gradient(circle at 90% 10%, rgba(63, 171, 149, 0.06), transparent 55%), var(--paper);
  overflow: hidden;
}
.page-header::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("../assets/network.svg");
  background-repeat: no-repeat;
  background-position: left -100px center;
  background-size: 640px auto;
  opacity: 0.4;
  pointer-events: none;
}
.page-header .container { position: relative; }
.page-header .lead { max-width: 720px; }

/* ---------- Wave divider ---------- */
.wave-divider {
  width: 100%;
  height: 80px;
  display: block;
  background: url("../assets/wave-divider.svg") no-repeat center bottom / cover;
  margin-top: -1px;
}
.wave-divider.flip { transform: scaleY(-1); }

/* ---------- Sections ---------- */
.section-mission { background: var(--paper); }
.section-mission .container { max-width: 780px; text-align: center; }
.section-mission p { color: var(--ink); }

.section-study { background: var(--paper); }
.section-impact { background: var(--paper); }

.section-head { text-align: center; margin-bottom: 3rem; }
.section-head .lead { max-width: 720px; margin: 0.25rem auto 0; }

/* ---------- Card grid (subdivisions, impact) ---------- */
.card-grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: 1fr;
}
@media (min-width: 768px) {
  .card-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) {
  .card-grid { grid-template-columns: repeat(3, 1fr); gap: 2rem; }
}

.card {
  background: var(--paper);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 1.75rem 1.5rem 1.5rem;
  position: relative;
  overflow: hidden;
  border-top: 3px solid var(--teal);
  transition: box-shadow 200ms ease, transform 200ms ease;
}
.card h3 { margin-bottom: 0.5rem; }
.card p { color: var(--ink); margin-bottom: 0; }
.card .eyebrow { color: var(--smoke); }

a.card:hover,
.card.is-interactive:hover {
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-2px);
  text-decoration: none;
}

.card-placeholder {
  background: repeating-linear-gradient(
    45deg,
    #FBFCFD,
    #FBFCFD 12px,
    #F2F4F7 12px,
    #F2F4F7 24px
  );
  border-top-color: var(--smoke);
}
.card-placeholder .eyebrow { color: var(--smoke); }
.card-placeholder p { color: var(--gray); font-style: italic; }

/* ---------- CTA strip ---------- */
.cta-strip {
  background: var(--navy);
  color: var(--paper);
  padding: 4rem 0;
  position: relative;
  overflow: hidden;
}
.cta-strip::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("../assets/network.svg");
  background-repeat: no-repeat;
  background-position: right -80px center;
  background-size: 600px auto;
  opacity: 0.35;
  pointer-events: none;
  filter: brightness(0) invert(1);
}
.cta-strip .container { position: relative; text-align: center; }
.cta-strip h2 { color: var(--paper); margin-bottom: 1.25rem; }
.cta-strip .lead { color: rgba(255, 255, 255, 0.85); margin-bottom: 2rem; }
.cta-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.875rem;
  justify-content: center;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-btn);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
  background: var(--navy);
  color: var(--paper);
  border: 2px solid var(--navy);
  transition: background 200ms ease, border-color 200ms ease, color 200ms ease;
  min-height: 44px;
  line-height: 1.4;
}
.btn:hover {
  background: var(--teal);
  border-color: var(--teal);
  color: var(--paper);
  text-decoration: none;
}
.btn-outline {
  background: transparent;
  color: var(--paper);
  border-color: var(--paper);
}
.btn-outline:hover {
  background: var(--paper);
  color: var(--navy);
  border-color: var(--paper);
}

/* ---------- People page ---------- */
.people-group { padding: 4rem 0 2rem; }
.people-group:first-of-type { padding-top: 2rem; }
.group-head { margin-bottom: 2rem; }
.group-head h2 { margin: 0; }
.subgroup-head {
  margin: 2.5rem 0 1.25rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--mist);
  font-size: 1rem;
  font-weight: 700;
  color: var(--navy);
  letter-spacing: 0.02em;
}
.subgroup-head:first-of-type { border-top: 0; padding-top: 0; margin-top: 0; }

.people-grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: 1fr;
}
@media (min-width: 600px) { .people-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .people-grid { grid-template-columns: repeat(3, 1fr); } }

.person {
  background: var(--paper);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 1.25rem;
  border-top: 3px solid var(--teal);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: box-shadow 200ms ease, transform 200ms ease;
}
.person:hover {
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-2px);
}
.person .headshot {
  aspect-ratio: 1 / 1;
  width: 100%;
  border-radius: var(--radius-card);
  background: var(--mist);
  object-fit: cover;
}
.pill {
  align-self: flex-start;
  display: inline-block;
  background: rgba(63, 171, 149, 0.12);
  color: var(--teal);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.25rem 0.625rem;
  border-radius: 999px;
}
.person h3 {
  font-size: 1.125rem;
  margin: 0;
  color: var(--navy);
}
.person .role,
.person .affiliation {
  color: var(--gray);
  font-size: 0.875rem;
  margin: 0;
}
.person .bio {
  color: var(--ink);
  font-size: 0.875rem;
  line-height: 1.5;
  margin: 0;
}
.person .email {
  color: var(--teal);
  font-size: 0.875rem;
  word-break: break-all;
  margin-top: auto;
}

/* ---------- Research page ---------- */
.research-section { padding: 4rem 0; }
.research-section .container { max-width: 900px; }
.research-section h2 { margin-bottom: 1.5rem; }

.research-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  counter-reset: research-item;
}
.research-list li {
  background: var(--paper);
  border-left: 3px solid var(--teal);
  padding: 1rem 1.25rem;
  border-radius: 0 var(--radius-card) var(--radius-card) 0;
  box-shadow: var(--shadow-card);
  color: var(--ink);
  line-height: 1.55;
  transition: background 200ms ease, box-shadow 200ms ease;
}
.research-list li:not(.placeholder) {
  counter-increment: research-item;
}
.research-list li:not(.placeholder)::before {
  content: counter(research-item) ". ";
  color: var(--navy);
  font-weight: 700;
  margin-right: 0.25rem;
}
.research-list li:hover {
  background: #F7FAFA;
  box-shadow: var(--shadow-card-hover);
}
.research-list li.placeholder {
  border-left-color: var(--smoke);
  background: #FBFCFD;
  color: var(--gray);
  font-style: italic;
}
.research-list a { color: var(--teal); font-weight: 600; }
.research-list em { color: var(--navy); font-style: italic; }
.research-list strong { color: var(--navy); }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--navy);
  color: var(--paper);
  padding: 1.5rem 0;
  font-size: 0.875rem;
}
.footer-inner {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: center;
  text-align: center;
}
@media (min-width: 768px) {
  .footer-inner {
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
  }
}
.site-footer .dot { color: var(--teal); margin: 0 0.4rem; }
.site-footer a { color: var(--paper); }
.site-footer a:hover { color: var(--teal); }

/* ---------- Utility ---------- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
