/* ============================================
   PEÑAGARICANO LAB — Global Styles
   Quantitative Genomics & Computational Biology
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Red+Hat+Display:wght@400;500;600;700;900&family=Red+Hat+Text:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

/* --- CSS Variables --- */
:root {
  --primary: #1E3A5F;
  --primary-light: #2C5478;
  --primary-dark: #142942;
  --accent: #C5050C;
  --accent-light: #D93025;
  --gold: #C49A2A;
  --gold-light: #DDB347;
  --cream: #FAFBFC;
  --gray-50: #F4F6F8;
  --gray-100: #E2E7EC;
  --gray-200: #CCD3DB;
  --gray-300: #A3AEBC;
  --gray-500: #5A6D80;
  --gray-700: #374B5E;
  --gray-900: #1B2D42;
  --white: #ffffff;
  --font-display: 'Red Hat Display', 'Segoe UI', sans-serif;
  --font-body: 'Red Hat Text', 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.12);
  --shadow-xl: 0 20px 60px rgba(0,0,0,0.15);
  --radius: 6px;
  --radius-lg: 12px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --max-width: 1200px;
}

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: var(--font-body);
  color: var(--gray-900);
  background: var(--cream);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--primary-light); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent); }

/* --- Utility --- */
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 2rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

/* --- UW-Madison Institutional Banner (UW-207 Required) --- */
.uw-top-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1001;
  background: #C5050C;
  color: #ffffff;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  padding: 0.55rem 0;
  height: 42px;
}
.uw-top-banner .container {
  display: flex;
  align-items: center;
}
.uw-top-banner a {
  color: #ffffff;
  text-decoration: none;
  transition: opacity 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.uw-top-banner a:hover {
  opacity: 0.85;
  color: #ffffff;
}
.uw-banner-crest {
  height: 24px;
  width: auto;
}

/* --- Skip Navigation (WCAG 2.1 AA Required) --- */
.skip-nav {
  position: absolute;
  top: -100%;
  left: 1rem;
  background: var(--accent);
  color: var(--white);
  padding: 0.75rem 1.5rem;
  border-radius: 0 0 var(--radius) var(--radius);
  font-weight: 600;
  font-size: 0.9rem;
  z-index: 10000;
  transition: top 0.2s ease;
}
.skip-nav:focus {
  top: 0;
  color: var(--white);
}

/* --- Focus Visible (WCAG 2.1 AA) --- */
*:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}
a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

/* --- Navigation --- */
.site-nav {
  position: fixed; top: 42px; left: 0; right: 0; z-index: 1000;
  background: rgba(30, 58, 95, 0.97);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  transition: all var(--transition);
}
.site-nav.scrolled {
  background: rgba(20, 41, 66, 0.99);
  box-shadow: 0 2px 20px rgba(0,0,0,0.3);
}
.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 70px;
}
.nav-brand {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.nav-brand-name {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--white);
  letter-spacing: 0.02em;
  line-height: 1.2;
}
.nav-brand-sub {
  font-size: 0.7rem;
  color: var(--gold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 500;
}
.nav-links {
  display: flex;
  gap: 0.25rem;
  list-style: none;
}
.nav-links a {
  color: rgba(255,255,255,0.75);
  font-size: 0.88rem;
  font-weight: 500;
  padding: 0.5rem 0.9rem;
  border-radius: var(--radius);
  transition: all var(--transition);
  letter-spacing: 0.01em;
}
.nav-links a:hover,
.nav-links a.active {
  color: var(--white);
  background: rgba(255,255,255,0.1);
}

/* Mobile menu */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--white);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.5rem;
}
.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--white);
  margin: 5px 0;
  transition: var(--transition);
}

/* --- Hero Section --- */
.hero {
  position: relative;
  min-height: 92vh;
  display: flex;
  align-items: center;
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 40%, var(--primary-light) 100%);
  overflow: hidden;
  padding-top: 112px; /* 42px UW banner + 70px nav */
}
.hero::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(196, 154, 42, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(197, 5, 12, 0.05) 0%, transparent 40%);
  pointer-events: none;
}
.hero::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 120px;
  background: linear-gradient(to top, var(--cream), transparent);
  pointer-events: none;
}

/* DNA helix animation background */
.hero-dna {
  position: absolute;
  top: 0; right: -5%; bottom: 0;
  width: 50%;
  opacity: 0.08;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='60'%3E%3Cpath d='M30 0 Q45 15 30 30 Q15 45 30 60' fill='none' stroke='%23ffffff' stroke-width='1'/%3E%3Cpath d='M30 0 Q15 15 30 30 Q45 45 30 60' fill='none' stroke='%23ffffff' stroke-width='1'/%3E%3Ccircle cx='30' cy='15' r='2' fill='%23C49A2A'/%3E%3Ccircle cx='30' cy='45' r='2' fill='%23C49A2A'/%3E%3C/svg%3E");
  background-size: 60px 60px;
  animation: dnaScroll 20s linear infinite;
}
@keyframes dnaScroll {
  from { background-position: 0 0; }
  to { background-position: 60px 60px; }
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 4rem 2rem;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(196, 154, 42, 0.15);
  border: 1px solid rgba(196, 154, 42, 0.3);
  color: var(--gold-light);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.45rem 1rem;
  border-radius: 50px;
  margin-bottom: 2rem;
  animation: fadeInUp 0.8s ease-out;
}
.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 5.5vw, 4.5rem);
  font-weight: 700;
  color: var(--white);
  line-height: 1.1;
  margin-bottom: 1rem;
  animation: fadeInUp 0.8s ease-out 0.15s both;
}
.hero h1 .accent { color: var(--gold); }
.hero-subtitle {
  font-size: clamp(1.05rem, 2vw, 1.3rem);
  color: rgba(255,255,255,0.7);
  font-weight: 300;
  max-width: 640px;
  margin-bottom: 0.75rem;
  animation: fadeInUp 0.8s ease-out 0.3s both;
  line-height: 1.6;
}
.hero-dept {
  font-size: 0.92rem;
  color: rgba(255,255,255,0.5);
  margin-bottom: 2.5rem;
  animation: fadeInUp 0.8s ease-out 0.4s both;
}
.hero-dept a { color: rgba(255,255,255,0.7); }
.hero-dept a:hover { color: var(--gold-light); }
.hero-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  animation: fadeInUp 0.8s ease-out 0.5s both;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.6rem;
  font-family: var(--font-body);
  font-size: 0.92rem;
  font-weight: 600;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
}
.btn-primary {
  background: var(--accent);
  color: var(--white);
}
.btn-primary:hover {
  background: var(--accent-light);
  color: var(--white);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(197, 5, 12, 0.3);
}
.btn-outline {
  background: transparent;
  color: var(--white);
  border: 1.5px solid rgba(255,255,255,0.3);
}
.btn-outline:hover {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.5);
  color: var(--white);
}

/* --- News Ticker --- */
.news-bar {
  background: var(--white);
  border-bottom: 1px solid var(--gray-100);
  padding: 1.2rem 0;
}
.news-bar .container {
  display: flex;
  align-items: flex-start;
  gap: 1.2rem;
}
.news-label {
  background: var(--accent);
  color: var(--white);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.3rem 0.7rem;
  border-radius: 3px;
  white-space: nowrap;
  margin-top: 2px;
}
.news-items {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.news-item {
  font-size: 0.88rem;
  color: var(--gray-700);
  line-height: 1.5;
}
.news-item a { font-weight: 600; }
.news-item .news-date {
  color: var(--gray-500);
  font-size: 0.78rem;
  margin-left: 0.5rem;
}

/* --- Section Styles --- */
.section {
  padding: 5rem 0;
}
.section-dark {
  background: var(--primary);
  color: var(--white);
}
.section-dark a,
.research-focus-section a {
  color: var(--gold-light);
}
.section-dark a:hover,
.research-focus-section a:hover {
  color: var(--white);
}
/* Join Us section with image */
.join-us-section {
  background: var(--primary);
  color: var(--white);
  padding: 0;
}
.join-us-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  min-height: 340px;
}
.join-us-img-wrap {
  overflow: hidden;
}
.join-us-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.join-us-content {
  padding: 3rem 2.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
@media (max-width: 768px) {
  .join-us-grid { grid-template-columns: 1fr; }
  .join-us-img { max-height: 200px; }
  .join-us-content { padding: 2rem 1.5rem; text-align: center; }
  .join-us-content div { justify-content: center; }
}
.section-alt {
  background: var(--white);
}
.section-header {
  text-align: center;
  margin-bottom: 3.5rem;
}
.section-header h2 {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 0.75rem;
}
.section-dark .section-header h2 { color: var(--white); }
.section-header p {
  font-size: 1.05rem;
  color: var(--gray-500);
  max-width: 600px;
  margin: 0 auto;
}
.section-dark .section-header p { color: rgba(255,255,255,0.6); }
.section-divider {
  width: 50px;
  height: 3px;
  background: var(--gold);
  margin: 1rem auto 0;
  border-radius: 2px;
}

/* --- Research Focus Section --- */
.research-focus-section {
  background: var(--primary-dark);
  color: var(--white);
}
.research-focus-section .section-header h2 { color: var(--white); }
.research-focus-section .section-header p { color: rgba(255,255,255,0.6); }
.research-focus-section .section-divider { background: var(--gold); }
.research-focus-visual {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 2.5rem;
  align-items: center;
}
.focus-visual-img {
  width: 100%;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  object-fit: cover;
  max-height: 360px;
}
.research-focus-cloud {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 0.6rem;
  padding: 0.5rem 0;
}
.focus-tag {
  display: inline-block;
  padding: 0.45rem 1.1rem;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 500;
  color: rgba(255,255,255,0.85);
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 20px;
  transition: all var(--transition);
  letter-spacing: 0.01em;
  text-decoration: none;
  cursor: pointer;
}
.focus-tag:hover {
  background: var(--gold);
  color: var(--primary-dark);
  border-color: var(--gold);
}
.focus-tag-md {
  font-size: 0.95rem;
  padding: 0.5rem 1.2rem;
  font-weight: 600;
  color: var(--white);
  border-color: rgba(255,255,255,0.25);
  background: rgba(255,255,255,0.12);
}
.focus-tag-lg {
  font-size: 1.05rem;
  padding: 0.55rem 1.35rem;
  font-weight: 700;
  background: var(--gold);
  color: var(--primary-dark);
  border-color: var(--gold);
}
.focus-tag-lg:hover {
  background: var(--gold-light);
  border-color: var(--gold-light);
}
@media (max-width: 768px) {
  .research-focus-visual {
    grid-template-columns: 1fr;
  }
  .focus-visual-left { display: none; }
  .research-focus-cloud { justify-content: center; }
}

/* --- Research Cards --- */
.research-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}
.research-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 2rem;
  border: 1px solid var(--gray-100);
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}
.research-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  opacity: 0;
  transition: opacity var(--transition);
}
.research-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: transparent;
}
.research-card:hover::before { opacity: 1; }
.research-card-icon {
  width: 48px; height: 48px;
  background: linear-gradient(135deg, var(--gray-700), var(--gray-500));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-size: 1.4rem;
  margin-bottom: 1.2rem;
}
.research-card h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--gray-900);
}
.research-card p {
  font-size: 0.9rem;
  color: var(--gray-500);
  line-height: 1.65;
}

/* --- People Section --- */
.people-section { padding: 5rem 0; }

.pi-card {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 2.5rem;
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  border: 1px solid var(--gray-100);
  margin-bottom: 3rem;
  box-shadow: var(--shadow-sm);
}
.pi-photo {
  width: 200px;
  height: 240px;
  border-radius: var(--radius-lg);
  object-fit: cover;
  background: var(--gray-100);
  border: 3px solid var(--gold);
}
.pi-info h3 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}
.pi-title {
  color: var(--accent);
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 0.15rem;
}
.pi-dept {
  color: var(--gray-500);
  font-size: 0.88rem;
  margin-bottom: 1rem;
}
.pi-bio {
  font-size: 0.92rem;
  color: var(--gray-700);
  line-height: 1.7;
  margin-bottom: 1rem;
}
.pi-links {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.pi-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius);
  background: var(--gray-50);
  color: var(--primary);
  border: 1px solid var(--gray-200);
  transition: all var(--transition);
}
.pi-link:hover {
  background: var(--primary);
  color: var(--white);
  border-color: var(--primary);
}

/* People grid */
.people-group-title {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--gray-900);
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--gold);
  display: inline-block;
}
.people-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.5rem;
  margin-bottom: 3rem;
}
.person-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  border: 1px solid var(--gray-100);
  transition: all var(--transition);
  text-align: center;
}
.person-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--gold);
}
.person-avatar {
  width: 100px; height: 100px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 1rem;
  background: linear-gradient(135deg, var(--primary-light), var(--primary));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 700;
}
.person-card h4 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.2rem;
}
.person-role {
  font-size: 0.82rem;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 0.3rem;
}
.person-detail {
  font-size: 0.8rem;
  color: var(--gray-500);
  line-height: 1.5;
  margin-bottom: 0.75rem;
}
.person-links {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
}
.person-link-icon {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: var(--gray-500);
  transition: all var(--transition);
}
.person-link-icon:hover {
  background: var(--primary);
  color: var(--white);
  border-color: var(--primary);
}

/* --- Publications --- */
.pub-year-header {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--primary);
  margin: 2.5rem 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--gray-100);
}
.pub-list {
  list-style: none;
}
.pub-item {
  padding: 1rem 0;
  border-bottom: 1px solid var(--gray-100);
  font-size: 0.9rem;
  line-height: 1.65;
  color: var(--gray-700);
  transition: background var(--transition);
}
.pub-item:hover {
  background: var(--gray-50);
  padding-left: 1rem;
  border-radius: var(--radius);
}
.pub-item a { font-weight: 600; }
.pub-item .pub-journal {
  font-style: italic;
  color: var(--gray-500);
}
.pub-count-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: var(--primary);
  color: var(--white);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: 50px;
  margin-left: 0.5rem;
}

/* --- Software Section --- */
.software-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
}
.software-card {
  background: var(--gray-900);
  border-radius: var(--radius-lg);
  padding: 2rem;
  color: var(--white);
  transition: all var(--transition);
}
.software-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-xl);
}
.software-card h3 {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  color: var(--gold-light);
  margin-bottom: 0.5rem;
}
.software-card p {
  font-size: 0.88rem;
  color: rgba(255,255,255,0.65);
  line-height: 1.6;
  margin-bottom: 1rem;
}
.software-tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: 3px;
  background: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.7);
  margin-right: 0.3rem;
}

/* --- Stats Bar --- */
.stats-bar {
  background: var(--white);
  border-top: 1px solid var(--gray-100);
  border-bottom: 1px solid var(--gray-100);
  padding: 3rem 0;
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
  text-align: center;
}
.stat-item h3 {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1;
  margin-bottom: 0.3rem;
}
.stat-item p {
  font-size: 0.85rem;
  color: var(--gray-500);
  font-weight: 500;
}

/* --- Former Members --- */
.former-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.former-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 0.6rem;
}
.former-item {
  padding: 0.6rem 1rem;
  background: var(--gray-50);
  border-radius: var(--radius);
  font-size: 0.88rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  border: 1px solid transparent;
  transition: all var(--transition);
}
.former-item:hover {
  border-color: var(--gray-200);
  background: var(--white);
}
.former-name { font-weight: 600; color: var(--gray-900); font-size: 0.85rem; }
.former-info { font-size: 0.75rem; color: var(--gray-500); text-align: right; white-space: nowrap; }
.former-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.former-avatar-placeholder {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--gray-200);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-400);
}
@media (max-width: 640px) {
  .former-item { flex-wrap: wrap; }
  .former-info { white-space: normal; text-align: left; }
}

/* --- Footer --- */
.site-footer {
  background: var(--primary-dark);
  color: rgba(255,255,255,0.6);
  padding: 3rem 0 2rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 2rem;
}
.footer-logo {
  height: 48px;
  margin-bottom: 0.75rem;
  opacity: 0.9;
}
.footer-brand h3 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--white);
  margin-bottom: 0.5rem;
}
.footer-brand p {
  font-size: 0.85rem;
  line-height: 1.6;
}
.footer-links h4 {
  color: var(--gold);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.75rem;
}
.footer-links ul {
  list-style: none;
}
.footer-links li { margin-bottom: 0.4rem; }
.footer-links a {
  color: rgba(255,255,255,0.5);
  font-size: 0.88rem;
  transition: color var(--transition);
}
.footer-links a:hover { color: var(--white); }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-top: 1.5rem;
  font-size: 0.8rem;
}
.footer-legal p {
  margin-bottom: 0.4rem;
  color: rgba(255,255,255,0.5);
}
.footer-legal a {
  color: rgba(255,255,255,0.6);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.footer-legal a:hover {
  color: var(--white);
}

/* --- Page Headers (non-home) --- */
.page-header {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  padding: calc(8rem + 42px) 0 3rem;
  text-align: center;
}
.page-header h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3rem);
  color: var(--white);
  margin-bottom: 0.5rem;
}
.page-header p {
  color: rgba(255,255,255,0.6);
  font-size: 1.05rem;
}

/* --- Responsive --- */
@media (max-width: 900px) {
  .nav-links { display: none; }
  .nav-toggle { display: block; }
  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 70px; left: 0; right: 0;
    background: var(--primary-dark);
    padding: 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
  }
  .pi-card { grid-template-columns: 1fr; text-align: center; }
  .pi-photo { margin: 0 auto; }
  .pi-links { justify-content: center; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr; }
  .hero { min-height: auto; padding-top: 142px; padding-bottom: 4rem; } /* 42px UW banner + 100px */
}

@media (max-width: 600px) {
  .hero h1 { font-size: 2rem; }
  .section { padding: 3rem 0; }
  .people-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .news-entry { flex-direction: column; gap: 0.5rem; }
  .news-entry-date { flex-direction: row; gap: 0.5rem; min-width: auto; text-align: left; }
  .opportunity-reasons { grid-template-columns: 1fr; }
}

/* =============================================
   RESEARCH DETAIL PAGES
   ============================================= */
.research-intro {
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
  font-size: 1.05rem;
  color: var(--gray-700);
  line-height: 1.8;
}

.research-detail {
  max-width: 850px;
  margin: 0 auto;
}

.research-detail-header {
  display: flex;
  align-items: baseline;
  gap: 1.2rem;
  margin-bottom: 1.5rem;
}

.research-detail-number {
  font-family: var(--font-display);
  font-size: 3rem;
  font-weight: 700;
  color: var(--gold);
  line-height: 1;
  opacity: 0.5;
}

.research-detail-header h2 {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  color: var(--gray-900);
}

.section-alt .research-detail-header h2 {
  color: var(--gray-900);
}

.research-detail-body p {
  font-size: 0.95rem;
  color: var(--gray-700);
  line-height: 1.8;
  margin-bottom: 1.25rem;
}

.research-detail-body h4 {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--gray-900);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.75rem;
  margin-top: 1.5rem;
}

.research-questions {
  list-style: none;
  padding: 0;
}

.research-questions li {
  position: relative;
  padding-left: 1.25rem;
  font-size: 0.9rem;
  color: var(--gray-700);
  line-height: 1.65;
  margin-bottom: 0.5rem;
}

.research-questions li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold);
}

.research-pubs-link {
  margin-top: 1.5rem;
  padding: 1rem 1.25rem;
  background: var(--gray-50);
  border-left: 3px solid var(--gold);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 0.85rem;
  color: var(--gray-700);
  line-height: 1.6;
}

/* =============================================
   PUBLICATIONS PAGE
   ============================================= */
.pub-header-bar {
  text-align: center;
  margin-bottom: 2.5rem;
  padding: 1.25rem;
  background: var(--gray-50);
  border-radius: var(--radius-lg);
  font-size: 0.95rem;
  color: var(--gray-700);
}

.pub-header-bar a {
  color: var(--primary);
}

.pub-earlier-note {
  text-align: center;
  margin-top: 3rem;
  padding: 2rem;
  background: var(--gray-50);
  border-radius: var(--radius-lg);
  font-size: 0.95rem;
  color: var(--gray-500);
}

.pub-earlier-note a {
  font-weight: 600;
}

/* =============================================
   SOFTWARE DETAIL PAGE
   ============================================= */
.software-detail-card {
  background: var(--white);
  border: 1px solid var(--gray-100);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  margin-bottom: 2rem;
  transition: all var(--transition);
}

.software-detail-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--gray-200);
}

.software-detail-header h2 {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.25rem;
}

.software-detail-tagline {
  font-size: 0.95rem;
  color: var(--gray-500);
  margin-bottom: 1.5rem;
}

.software-detail-body p {
  font-size: 0.92rem;
  color: var(--gray-700);
  line-height: 1.75;
  margin-bottom: 1.25rem;
}

.software-detail-body h4 {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--gray-900);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.75rem;
  margin-top: 1.5rem;
}

.software-features {
  list-style: none;
  padding: 0;
  columns: 2;
  column-gap: 2rem;
}

.software-features li {
  position: relative;
  padding-left: 1.2rem;
  font-size: 0.88rem;
  color: var(--gray-700);
  line-height: 1.5;
  margin-bottom: 0.5rem;
  break-inside: avoid;
}

.software-features li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.5em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
}

.software-detail-links {
  margin-top: 1.5rem;
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.software-tags-bar {
  margin-top: 1.25rem;
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.software-tags-bar .software-tag {
  background: var(--gray-50);
  color: var(--gray-700);
  border: 1px solid var(--gray-200);
  font-size: 0.75rem;
  padding: 0.25rem 0.6rem;
  border-radius: 3px;
}

.software-cite {
  margin-top: 1.25rem;
  padding: 1rem 1.25rem;
  background: var(--gray-50);
  border-left: 3px solid var(--primary);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 0.82rem;
  color: var(--gray-500);
  line-height: 1.6;
}

/* =============================================
   NEWS PAGE
   ============================================= */
.news-entry {
  display: flex;
  gap: 1.5rem;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--gray-100);
}

.news-entry:last-child {
  border-bottom: none;
}

.news-entry-date {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 60px;
  text-align: center;
  flex-shrink: 0;
}

.news-month {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.news-year-small {
  font-size: 0.75rem;
  color: var(--gray-500);
}

.news-entry-content h4 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--gray-900);
  margin-bottom: 0.4rem;
}

.news-entry-content p {
  font-size: 0.9rem;
  color: var(--gray-700);
  line-height: 1.65;
}

.news-entry-content a {
  font-weight: 600;
}

/* =============================================
   OPPORTUNITIES PAGE
   ============================================= */
.opportunity-card {
  background: var(--white);
  border: 1px solid var(--gray-100);
  border-radius: var(--radius-lg);
  padding: 2rem 2.25rem;
  margin-bottom: 1.5rem;
  transition: all var(--transition);
}

.opportunity-card:hover {
  box-shadow: var(--shadow-sm);
  border-color: var(--gray-200);
}

.opportunity-card h3 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 0.75rem;
}

.opportunity-card h4 {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--gray-900);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 1.25rem;
  margin-bottom: 0.5rem;
}

.opportunity-card p {
  font-size: 0.92rem;
  color: var(--gray-700);
  line-height: 1.7;
}

.opportunity-list {
  list-style: none;
  padding: 0;
}

.opportunity-list li {
  position: relative;
  padding-left: 1.2rem;
  font-size: 0.9rem;
  color: var(--gray-700);
  line-height: 1.6;
  margin-bottom: 0.4rem;
}

.opportunity-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--gold);
}

.why-madison-images {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  border-radius: var(--radius);
  overflow: hidden;
}
.why-madison-img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  border-radius: var(--radius);
  transition: transform var(--transition);
}
.why-madison-img:hover {
  transform: scale(1.03);
}
@media (max-width: 600px) {
  .why-madison-images { grid-template-columns: 1fr; }
  .why-madison-img { height: 140px; }
}

.opportunity-highlight {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  margin: 2.5rem 0;
  color: var(--white);
}

.opportunity-highlight h3 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  text-align: center;
}

.opportunity-reasons {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.opportunity-reason {
  text-align: center;
}

.opportunity-reason h4 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--gold-light);
  margin-bottom: 0.5rem;
}

.opportunity-reason p {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.65);
  line-height: 1.6;
}
.opportunity-highlight a {
  color: var(--gold-light);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.opportunity-highlight a:hover {
  color: var(--white);
}

.opportunity-contact {
  text-align: center;
  padding: 2.5rem;
  background: var(--gray-50);
  border-radius: var(--radius-lg);
  margin-top: 2rem;
}

.opportunity-contact h3 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 0.75rem;
}

.opportunity-contact p {
  font-size: 0.95rem;
  color: var(--gray-500);
  margin-bottom: 1.5rem;
}

.opportunity-contact-links {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.btn-outline-dark {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.6rem;
  font-family: var(--font-body);
  font-size: 0.92rem;
  font-weight: 600;
  border-radius: var(--radius);
  border: 1.5px solid var(--gray-300);
  background: transparent;
  color: var(--gray-700);
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
}

.btn-outline-dark:hover {
  background: var(--primary);
  color: var(--white);
  border-color: var(--primary);
}

/* =============================================
   FLAGSHIP PROJECT
   ============================================= */
.flagship-project {
  background: var(--white);
  border: 2px solid var(--gray-100);
  border-radius: var(--radius-lg);
  padding: 2.5rem 3rem;
  position: relative;
  overflow: hidden;
}
.flagship-project::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, #2d8a4e, var(--gold), var(--accent));
}
.flagship-hero-img {
  width: 100%;
  max-height: 360px;
  object-fit: contain;
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
  background: #f5f5f5;
}
.flagship-badge {
  display: inline-block;
  background: rgba(45,138,78,0.1);
  color: #2d8a4e;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.35rem 0.9rem;
  border-radius: 50px;
  border: 1px solid rgba(45,138,78,0.2);
  margin-bottom: 1rem;
}
.flagship-project > h2 {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 3vw, 1.8rem);
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 0.5rem;
}
.flagship-subtitle {
  font-size: 0.95rem;
  color: var(--gray-500);
  font-style: italic;
  margin-bottom: 0.5rem;
}
.flagship-pi {
  font-size: 0.85rem;
  color: var(--gray-700);
  margin-bottom: 1.5rem;
}
.flagship-overview h4,
.flagship-traits h4,
.flagship-team h4 {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--gray-900);
  margin-bottom: 0.5rem;
}
.flagship-overview p {
  font-size: 0.92rem;
  color: var(--gray-700);
  line-height: 1.75;
  margin-bottom: 1.5rem;
}
.flagship-pillars {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin: 1.5rem 0;
}
.flagship-pillar {
  background: var(--gray-50);
  border-radius: var(--radius);
  padding: 1.5rem;
}
.flagship-pillar-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px; height: 28px;
  background: var(--primary);
  color: var(--white);
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 50%;
  margin-bottom: 0.75rem;
}
.flagship-pillar h4 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 0.5rem;
  text-transform: none;
  letter-spacing: 0;
}
.flagship-pillar p {
  font-size: 0.85rem;
  color: var(--gray-500);
  line-height: 1.6;
}
.flagship-traits { margin: 1.5rem 0; }
.flagship-team { margin: 1rem 0; }
.flagship-team p {
  font-size: 0.9rem;
  color: var(--gray-700);
}
.flagship-funding {
  margin-top: 1.5rem;
  padding: 1rem 1.25rem;
  background: var(--gray-50);
  border-left: 3px solid #2d8a4e;
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 0.82rem;
  color: var(--gray-500);
  line-height: 1.6;
}

/* =============================================
   RESPONSIVE ADDITIONS
   ============================================= */
@media (max-width: 900px) {
  .software-features { columns: 1; }
  .opportunity-reasons { grid-template-columns: 1fr; }
  .research-detail-header { flex-direction: column; gap: 0.25rem; }
  .research-detail-number { font-size: 2rem; }
  .flagship-pillars { grid-template-columns: 1fr; }
  .flagship-project { padding: 1.5rem; }
}
