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

:root {
  --jhu-blue: #002D72;
  --jhu-blue-light: #003d99;
  --jhu-gold: #CF8A05;
  --jhu-gold-light: #e9a820;
  --text: #2c2c2c;
  --text-light: #555;
  --bg: #f8f9fc;
  --white: #ffffff;
  --border: #e2e5ea;
  --accent: #003087;
  --link: #1a5276;
  --link-hover: #CF8A05;
  --section-bg: #f0f3f8;
  --card-shadow: 0 2px 12px rgba(0,45,114,0.06);
  --card-shadow-hover: 0 8px 32px rgba(0,45,114,0.12);
  --max-width: 980px;
}

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

body {
  font-family: 'Inter', 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--link); text-decoration: none; transition: color 0.25s ease; }
a:hover { color: var(--link-hover); }

/* ===== Fade-in Animations ===== */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-20px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ===== Header / Nav ===== */
header {
  background: var(--jhu-blue);
  color: var(--white);
  padding: 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 16px rgba(0,0,0,0.18);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

nav {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
}

nav .site-name {
  font-size: 1.25rem;
  font-weight: 700;
  padding: 0.9rem 0;
  color: var(--white);
  letter-spacing: 0.03em;
  transition: opacity 0.2s;
}

nav .site-name:hover {
  opacity: 0.85;
}

nav ul {
  list-style: none;
  display: flex;
  gap: 0.15rem;
}

nav ul li a {
  color: rgba(255,255,255,0.8);
  padding: 0.9rem 1.05rem;
  display: block;
  font-size: 0.92rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  transition: background 0.25s, color 0.25s, border-color 0.25s;
  border-bottom: 3px solid transparent;
  border-radius: 2px 2px 0 0;
}

nav ul li a:hover,
nav ul li a.active {
  color: var(--white);
  background: rgba(255,255,255,0.1);
  border-bottom-color: var(--jhu-gold);
}

/* ===== Main Content ===== */
main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
}

/* ===== Hero / Profile Section ===== */
.hero {
  display: flex;
  gap: 2.5rem;
  align-items: flex-start;
  margin-bottom: 3rem;
  padding: 2.5rem;
  border-radius: 16px;
  background: linear-gradient(135deg, #f0f4fa 0%, #e8edf6 50%, #f5f3ee 100%);
  border: 1px solid var(--border);
  box-shadow: var(--card-shadow);
  animation: fadeIn 0.6s ease-out;
}

.hero-no-photo {
  display: block;
}

.hero-photo {
  flex-shrink: 0;
}

.photo-wrapper {
  width: 200px;
  height: 200px;
}

.hero-photo img {
  width: 200px;
  height: 200px;
  border-radius: 14px;
  object-fit: cover;
  border: 3px solid var(--border);
  background: #ddd;
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.photo-placeholder {
  width: 200px;
  height: 200px;
  border-radius: 14px;
  border: 3px solid var(--border);
  background: linear-gradient(135deg, var(--jhu-blue), var(--jhu-blue-light));
  color: var(--white);
  font-size: 3.5rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-text h1 {
  font-size: 2.2rem;
  color: var(--jhu-blue);
  margin-bottom: 0.3rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.hero-text .title {
  font-size: 1.1rem;
  color: var(--text-light);
  margin-bottom: 0.85rem;
  font-weight: 400;
}

.hero-text .contact-info {
  font-size: 0.92rem;
  color: var(--text-light);
  margin-bottom: 1.2rem;
  line-height: 1.9;
}

.hero-text .contact-info a { color: var(--link); }

.profile-links {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-top: 0.5rem;
}

.profile-links a {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.95rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text);
  background: var(--white);
  transition: all 0.25s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.profile-links a:hover {
  border-color: var(--jhu-blue);
  box-shadow: 0 3px 12px rgba(0,45,114,0.12);
  color: var(--jhu-blue);
  transform: translateY(-1px);
}

/* ===== Section Styling ===== */
section {
  margin-bottom: 3rem;
  animation: fadeInUp 0.5s ease-out both;
}

section:nth-child(1) { animation-delay: 0.05s; }
section:nth-child(2) { animation-delay: 0.12s; }
section:nth-child(3) { animation-delay: 0.19s; }
section:nth-child(4) { animation-delay: 0.26s; }
section:nth-child(5) { animation-delay: 0.33s; }

section h2 {
  font-size: 1.45rem;
  color: var(--jhu-blue);
  border-bottom: 2px solid var(--jhu-gold);
  padding-bottom: 0.45rem;
  margin-bottom: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.005em;
}

section h3 {
  font-size: 1.1rem;
  color: var(--accent);
  margin: 1.4rem 0 0.6rem;
  font-weight: 600;
}

p { margin-bottom: 0.85rem; }

/* ===== Research Topics (Cards) ===== */
.research-topics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.1rem;
  margin-top: 0.75rem;
}

a.topic-card, .topic-card {
  display: block;
  text-decoration: none;
  color: inherit;
  background: var(--white);
  border: 1px solid var(--border);
  border-left: 4px solid var(--jhu-blue);
  border-radius: 10px;
  padding: 1.2rem 1.35rem;
  transition: all 0.3s ease;
  box-shadow: var(--card-shadow);
  position: relative;
  overflow: hidden;
}

a.topic-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(0,45,114,0.02) 0%, rgba(207,138,5,0.03) 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

a.topic-card:hover {
  box-shadow: var(--card-shadow-hover);
  border-left-color: var(--jhu-gold);
  transform: translateY(-3px);
  color: inherit;
}

a.topic-card:hover::before {
  opacity: 1;
}

.topic-card h3 {
  font-size: 1.02rem;
  margin: 0 0 0.45rem;
  color: var(--jhu-blue);
  font-weight: 700;
  position: relative;
}

.topic-card p {
  font-size: 0.88rem;
  color: var(--text-light);
  margin: 0;
  line-height: 1.6;
  position: relative;
}

/* ===== Research page lists ===== */
section ul {
  margin: 0.5rem 0 1rem 1.5rem;
  line-height: 1.85;
}

section ul li {
  margin-bottom: 0.55rem;
  font-size: 0.95rem;
}

/* ===== Awards ===== */
.awards-list {
  list-style: none;
  padding: 0;
}

.awards-list li {
  padding: 0.55rem 0;
  border-bottom: 1px solid #eee;
  font-size: 0.95rem;
}

.awards-list li:last-child { border-bottom: none; }

.awards-list .year {
  display: inline-block;
  width: 4rem;
  font-weight: 700;
  color: var(--jhu-blue);
}

/* ===== Group / Team — Card Layout ===== */
.group-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.1rem;
  margin-top: 0.75rem;
}

.member-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.4rem 1.3rem;
  text-align: center;
  transition: all 0.3s ease;
  box-shadow: var(--card-shadow);
  position: relative;
  overflow: hidden;
}

.member-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--jhu-blue), var(--jhu-gold));
  border-radius: 12px 12px 0 0;
}

.member-card:hover {
  box-shadow: var(--card-shadow-hover);
  transform: translateY(-3px);
}

.member-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--jhu-blue), var(--jhu-blue-light));
  color: var(--white);
  font-size: 1.3rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 0.75rem;
  letter-spacing: 0.02em;
}

img.member-avatar {
  object-fit: cover;
  border: 2px solid var(--border);
}

.member-card .member-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--jhu-blue);
  margin-bottom: 0.2rem;
}

.member-card .member-role {
  font-size: 0.85rem;
  color: var(--text-light);
  margin-bottom: 0.15rem;
}

.member-card .member-since {
  font-size: 0.8rem;
  color: #888;
}

/* Alumni cards */
.member-card.alumni {
  background: var(--section-bg);
}

.member-card.alumni::before {
  background: linear-gradient(90deg, var(--text-light), #999);
}

.member-card .member-next {
  font-size: 0.8rem;
  color: var(--text-light);
  margin-top: 0.3rem;
  font-style: italic;
}

/* Keep the old group-table for fallback */
.group-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.5rem;
}

.group-table th {
  text-align: left;
  padding: 0.6rem 0.75rem;
  background: var(--jhu-blue);
  color: var(--white);
  font-weight: 600;
  font-size: 0.9rem;
}

.group-table td {
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.92rem;
}

.group-table tr:hover { background: #f0f4f8; }

/* ===== Publications ===== */
.pub-entry {
  padding: 0.85rem 0 0.85rem 1rem;
  border-bottom: 1px solid #eee;
  border-left: 3px solid transparent;
  transition: all 0.25s ease;
  margin-left: -1rem;
  padding-left: 1rem;
  border-radius: 0 4px 4px 0;
}

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

.pub-entry:hover {
  border-left-color: var(--jhu-gold);
  background: rgba(0,45,114,0.015);
}

.pub-number {
  font-weight: 700;
  color: var(--jhu-blue);
  font-size: 0.85rem;
  margin-right: 0.3rem;
}

.pub-title {
  font-weight: 600;
  color: var(--text);
}

.pub-title a {
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.25s, border-color 0.25s;
}

.pub-title a:hover {
  color: var(--link);
  border-bottom-color: var(--link);
}

.pub-authors {
  font-size: 0.9rem;
  color: var(--text-light);
}

.pub-authors strong {
  color: var(--text);
}

.pub-journal {
  font-size: 0.88rem;
  color: var(--text-light);
  font-style: italic;
}

.pub-badge {
  display: inline-block;
  padding: 0.12rem 0.55rem;
  border-radius: 4px;
  font-size: 0.73rem;
  font-weight: 600;
  font-style: normal;
  margin-left: 0.3rem;
  letter-spacing: 0.02em;
}

.badge-editors { background: #e8f5e9; color: #2e7d32; }
.badge-prl { background: #e3f2fd; color: #1565c0; }
.badge-nature { background: #fce4ec; color: #c62828; }
.badge-science { background: #fff3e0; color: #e65100; }
.badge-prx { background: #f3e5f5; color: #6a1b9a; }

.pub-section-title {
  font-size: 1.15rem;
  color: var(--jhu-blue);
  margin: 1.75rem 0 0.85rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px dashed var(--border);
}

/* ===== Talks — Timeline Style ===== */
.talks-year-group {
  margin-bottom: 2rem;
}

.talks-year-label {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--white);
  background: var(--jhu-blue);
  padding: 0.25rem 0.9rem;
  border-radius: 20px;
  margin-bottom: 0.75rem;
  letter-spacing: 0.03em;
}

.talk-entry {
  padding: 0.7rem 0 0.7rem 1.25rem;
  border-bottom: 1px solid #eee;
  border-left: 2px solid var(--border);
  margin-left: 0.5rem;
  transition: all 0.25s ease;
  position: relative;
}

.talk-entry::before {
  content: '';
  position: absolute;
  left: -5px;
  top: 1rem;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border);
  transition: background 0.25s ease;
}

.talk-entry:hover {
  border-left-color: var(--jhu-gold);
}

.talk-entry:hover::before {
  background: var(--jhu-gold);
}

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

.talk-number {
  font-weight: 700;
  color: var(--jhu-blue);
  font-size: 0.85rem;
  margin-right: 0.3rem;
}

.talk-title {
  font-weight: 600;
  color: var(--text);
  font-size: 0.95rem;
}

.talk-venue {
  font-size: 0.88rem;
  color: var(--text-light);
}

.talk-date {
  font-size: 0.82rem;
  color: var(--jhu-blue);
  font-weight: 600;
  margin-left: 0.5rem;
}

/* ===== Openings (highlight box) ===== */
.openings-box {
  background: linear-gradient(135deg, #f0f4fa 0%, #faf5ee 100%);
  border: 1px solid var(--border);
  border-left: 4px solid var(--jhu-gold);
  border-radius: 10px;
  padding: 1.5rem 1.75rem;
  box-shadow: var(--card-shadow);
}

.openings-box p {
  margin-bottom: 0;
}

/* ===== Footer ===== */
footer {
  background: var(--jhu-blue);
  color: rgba(255,255,255,0.7);
  text-align: center;
  padding: 2rem 1.5rem;
  font-size: 0.85rem;
  margin-top: 1rem;
}

footer a { color: var(--jhu-gold); transition: color 0.2s; }
footer a:hover { color: var(--jhu-gold-light); }

/* ===== Responsive ===== */
@media (max-width: 700px) {
  .hero {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 1.75rem 1.25rem;
  }
  .photo-wrapper { width: 160px; height: 160px; }
  .hero-photo img { width: 160px; height: 160px; }
  .photo-placeholder { width: 160px; height: 160px; font-size: 2.8rem; }
  .profile-links { justify-content: center; }
  .research-topics { grid-template-columns: 1fr; }
  .group-grid { grid-template-columns: 1fr; }
  nav { flex-direction: column; }
  nav ul { padding-bottom: 0.5rem; flex-wrap: wrap; justify-content: center; }
  .talk-entry { margin-left: 0.25rem; padding-left: 1rem; }
}

@media (max-width: 480px) {
  .hero-text h1 { font-size: 1.75rem; }
  main { padding: 1.5rem 1rem 3rem; }
}
