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

/* ===== Variables ===== */
:root {
  --color-bg: #ffffff;
  --color-bg-alt: #f7f8fa;
  --color-text: #2d3748;
  --color-text-light: #718096;
  --color-heading: #1a202c;
  --color-accent: #2c5282;
  --color-accent-light: #ebf4ff;
  --color-border: #e2e8f0;
  --color-white: #ffffff;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-heading: var(--font-body);
  --max-width: 56rem;
  --nav-height: 3.5rem;
}

/* ===== Base ===== */
html { font-size: 17px; scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--color-accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ===== Container ===== */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ===== Typography ===== */
h1, h2, h3, h4 {
  color: var(--color-heading);
  font-weight: 700;
  line-height: 1.3;
}
h1 { font-size: 2rem; margin-bottom: 0.75rem; }
h2 { font-size: 1.5rem; margin-top: 2.5rem; margin-bottom: 0.75rem; }
h3 { font-size: 1.2rem; margin-top: 1.5rem; margin-bottom: 0.5rem; }
p { margin-bottom: 1rem; }
ul, ol { margin-bottom: 1rem; padding-left: 1.5rem; }
blockquote {
  border-left: 4px solid var(--color-accent);
  padding: 0.75rem 1.25rem;
  margin: 1.5rem 0;
  color: var(--color-text-light);
  background: var(--color-bg-alt);
  border-radius: 0 4px 4px 0;
}

/* ===== Navigation ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--color-white);
  border-bottom: 1px solid var(--color-border);
  height: var(--nav-height);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}
.site-logo {
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--color-heading);
  letter-spacing: 0.02em;
}
.site-logo:hover { text-decoration: none; }
.site-nav a {
  color: var(--color-text);
  margin-left: 1.75rem;
  font-size: 0.92rem;
  font-weight: 500;
  transition: color 0.15s;
}
.site-nav a:hover,
.site-nav a.active {
  color: var(--color-accent);
  text-decoration: none;
}
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  width: 28px;
  height: 24px;
  position: relative;
  flex-shrink: 0;
}
.nav-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--color-heading);
  position: absolute;
  left: 0;
  transition: transform 0.25s, opacity 0.25s;
}
.nav-toggle span:nth-child(1) { top: 2px; }
.nav-toggle span:nth-child(2) { top: 11px; }
.nav-toggle span:nth-child(3) { top: 20px; }
.nav-toggle.open span:nth-child(1) { top: 11px; transform: rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { top: 11px; transform: rotate(-45deg); }

/* ===== Hero banner ===== */
.hero {
  background: linear-gradient(135deg, #1a365d 0%, #2c5282 50%, #2b6cb0 100%);
  background-size: cover;
  background-position: center;
  color: var(--color-white);
  padding: 6rem 1.5rem 5rem;
  text-align: center;
  position: relative;
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(26, 54, 93, 0.55);
  pointer-events: none;
}
.hero-overlay {
  position: relative;
  z-index: 1;
  max-width: var(--max-width);
  margin: 0 auto;
}
.hero h1 {
  color: var(--color-white);
  font-size: 2.75rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  margin-bottom: 0.75rem;
}
.hero p {
  font-size: 1.2rem;
  opacity: 0.92;
  max-width: 36rem;
  margin: 0 auto;
  line-height: 1.6;
}

/* ===== Page header ===== */
.page-header {
  background: var(--color-bg-alt);
  border-bottom: 1px solid var(--color-border);
  padding: 3rem 0 2.5rem;
}
.page-header h1 {
  font-size: 2rem;
  margin-bottom: 0.25rem;
}
.page-header .subtitle {
  color: var(--color-text-light);
  font-size: 1.1rem;
  margin: 0;
}
.page-content {
  padding: 2.5rem 1.5rem 4rem;
  max-width: var(--max-width);
  margin: 0 auto;
}

/* ===== Floating images ===== */
.img-right {
  float: right;
  max-width: 280px;
  margin: 0.25rem 0 1rem 1.75rem;
  border-radius: 4px;
}
.img-left {
  float: left;
  max-width: 280px;
  margin: 0.25rem 1.75rem 1rem 0;
  border-radius: 4px;
}

/* ===== Sections on landing page ===== */
.landing-section {
  padding: 3rem 0;
}
.landing-section:nth-child(even) {
  background: var(--color-bg-alt);
}
.landing-section .container {
  overflow: hidden; /* contain floats */
}
.landing-section h2 {
  margin-top: 0;
}

/* ===== Spotlight: alternating image+text sections ===== */
.spotlight {
  display: flex;
  align-items: flex-start;
  gap: 2.5rem;
  padding: 3rem 0;
}
.spotlight:nth-child(even) {
  flex-direction: row-reverse;
}
.spotlight-image {
  flex-shrink: 0;
  width: 240px;
}
.spotlight-image img {
  border-radius: 6px;
  width: 100%;
}
.spotlight-content {
  flex: 1;
}
.spotlight-content h2 {
  margin-top: 0;
}

/* ===== Research areas grid on landing ===== */
.research-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
  margin-top: 1.5rem;
}
.research-card {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  overflow: hidden;
  transition: box-shadow 0.2s;
}
.research-card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.research-card img {
  width: 100%;
  height: 160px;
  object-fit: cover;
}
.research-card .card-body {
  padding: 1.25rem;
}
.research-card h3 {
  margin-top: 0;
  font-size: 1.05rem;
}
.research-card p {
  color: var(--color-text-light);
  font-size: 0.92rem;
  margin-bottom: 0;
}

/* ===== People ===== */
.member {
  display: flex;
  gap: 1.5rem;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--color-border);
  align-items: flex-start;
}
.member:last-child { border-bottom: none; }
.member-photo {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.member-info { flex: 1; }
.member-info h3 { margin-top: 0; margin-bottom: 0.25rem; }
.member-info p { margin-bottom: 0; }

/* ===== News date ===== */
.news-date {
  display: block;
  color: var(--color-text-light);
  font-size: 0.88rem;
  font-style: italic;
  margin-top: -0.5rem;
  margin-bottom: 1.5rem;
}

/* ===== Footer ===== */
.site-footer {
  background: var(--color-bg-alt);
  border-top: 1px solid var(--color-border);
  padding: 2rem 0;
  text-align: center;
  font-size: 0.88rem;
  color: var(--color-text-light);
}
.site-footer a {
  color: var(--color-text-light);
}
.site-footer a:hover {
  color: var(--color-accent);
}

/* ===== Clearfix for floated images ===== */
.page-content::after,
.landing-section .container::after {
  content: "";
  display: table;
  clear: both;
}

/* Section clearfix — each h2 clears previous floats */
.page-content h2 {
  clear: both;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  html { font-size: 16px; }

  .nav-toggle { display: block; }
  .site-nav {
    display: none;
    position: absolute;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: var(--color-white);
    border-bottom: 1px solid var(--color-border);
    padding: 1rem 0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  }
  .site-nav.open { display: flex; flex-direction: column; }
  .site-nav a {
    margin: 0;
    padding: 0.6rem 1.5rem;
  }

  .hero { padding: 4rem 1.5rem 3.5rem; }
  .hero h1 { font-size: 2rem; }
  .hero p { font-size: 1.05rem; }

  .spotlight {
    flex-direction: column !important;
    gap: 1.25rem;
    padding: 2rem 0;
  }
  .spotlight-image { width: 100%; max-width: 320px; }

  .research-grid { grid-template-columns: 1fr; }

  .img-right, .img-left {
    float: none;
    max-width: 100%;
    margin: 0 0 1rem 0;
  }

  .member {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .page-header { padding: 2rem 0 1.5rem; }
}

@media (max-width: 480px) {
  .hero h1 { font-size: 1.6rem; }
  .page-header h1 { font-size: 1.5rem; }
}
