* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  color: #0b0b0b;
  background: var(--white);
  line-height: 1.6;
}

/* Color tokens */
:root {
  --black: #000000;
  --navy: #0A2342;
  --light-blue: #63B3ED;
  --white: #f0f8ff;
  --muted: #f6f8fb;
  --border: #e5eaf1;
  --focus: #2563eb;
}

/* Focus styles */
:focus {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

:focus:not(:focus-visible) {
  outline: none;
}

/* Header / Top Nav */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: linear-gradient(180deg, var(--black), var(--navy));
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-bottom: 4px solid var(--light-blue);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.brand-logo {
  height: 36px;
  width: auto;
}

.brand-text {
  font-weight: 700;
  letter-spacing: 0.3px;
}

/* Top-right tabs */
.top-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 0.5rem;
}

.top-nav a {
  display: inline-block;
  padding: 0.5rem 0.85rem;
  border-radius: 999px;
  text-decoration: none;
  color: var(--white);
  border: 1px solid transparent;
  transition: transform 120ms ease, background 120ms ease, color 120ms ease, border-color 120ms ease;
}

.top-nav a:hover {
  background: var(--light-blue);
  color: var(--navy);
  transform: translateY(-1px);
}

.top-nav a.active {
  background: var(--white);
  color: var(--navy);
  border-color: var(--light-blue);
}

/* Hero */
.hero {
  padding: 4rem 1rem 2.25rem;
  text-align: center;
  background: linear-gradient(180deg, var(--navy), #17375e 60%, #1b1b1b 100%);
  color: var(--white);
  border-bottom: 4px solid var(--light-blue);
}

.center-title {
  text-align: center;
}

/* Title row with flank images */
.title-row {
  max-width: 1100px;
  margin: 0 auto 0.75rem;
  padding: 0 1rem;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
}

.title-row h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  margin: 0;
}

.title-img {
  width: 150px;
  height: 150px;
  object-fit: contain;
  display: block;
}

.title-img.left {
  justify-self: end;
}

.title-img.right {
  justify-self: start;
}

.subtitle {
  margin: 0.15rem 0;
  font-size: clamp(1rem, 2.2vw, 1.25rem);
  opacity: 0.95;
}

.subtitle.sponsor {
  color: var(--light-blue);
  font-weight: 600;
}

/* CTA buttons */
.button {
  display: inline-block;
  padding: 0.6rem 1rem;
  margin: 0.75rem 0.35rem 0 0.35rem;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 600;
  border: 2px solid var(--light-blue);
}

.button.solid {
  background: var(--light-blue);
  color: var(--navy);
}

.button.ghost {
  background: transparent;
  color: var(--light-blue);
}

.button:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
}

/* Generic content section */
.content-block {
  max-width: 1100px;
  margin: 2rem auto;
  padding: 0 1rem;
}

/* Project Overview */
.project-overview p {
  text-align: center;
}

/* Advisor Grid */
.advisor-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
  margin-top: 1rem;
}

.advisor {
  background: var(--muted);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  transition: transform 120ms ease, box-shadow 120ms ease;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.advisor:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.08);
}

.advisor h3 {
  margin: 0 0 0.25rem;
  color: var(--navy);
}

/* Committee Grid */
.committee-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  margin-top: 1rem;
}

.committee {
  background: var(--muted);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  transition: transform 120ms ease, box-shadow 120ms ease;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.committee:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.08);
}

.committee h3 {
  margin: 0 0 0.25rem;
  color: var(--navy);
}

/* Prototype Image Grid (two side-by-side) */
.prototype-image-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  /* two equal columns */
  gap: 1rem;
  /* space between images */
  margin-top: 1rem;
}

.prototype-image-grid .project-image {
  width: 100%;
  height: auto;
  border-radius: 16px;
  border: 2px solid var(--border);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  object-fit: fill;
}
/* About / Team section (bottom) */
.about-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1rem 3rem;
  border-top: 1px solid var(--border);
}

.about-section h2 {
  text-align: center;
  margin-bottom: 1rem;
}

/* Four in a row grid (wraps on small screens) */
.team-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

@media (max-width: 1000px) {
  .team-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

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

.member-card {
  display: block;
  text-decoration: none;
  color: inherit;
  background: var(--muted);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  transition: transform 120ms ease, box-shadow 120ms ease;
}

.member-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.08);
}

.member-card img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  display: block;
  background: #dbe9ff;
}

.member-card figcaption {
  padding: 0.75rem 0.9rem 1rem;
}

.member-name {
  font-weight: 700;
  font-size: 1.05rem;
}

.member-role {
  font-size: 0.95rem;
  opacity: 0.85;
  margin-top: 0.2rem;
}

.member-actions {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 0.75rem;
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: opacity 200ms ease, transform 200ms ease, visibility 200ms;
}

/* Reveal buttons on hover */
.member-card:hover .member-actions {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* Optional: shrink the text slightly */
.member-actions .button {
  padding: 0.4rem 0.75rem;
  font-size: 0.85rem;
}

/* Footer */
.site-footer {
  background: linear-gradient(180deg, var(--navy), var(--black));
  color: var(--white);
  text-align: center;
  padding: 1rem;
  border-top: 4px solid var(--light-blue);
}

/* Utilities */
.hidden {
  display: none !important;
}

.center {
  text-align: center;
}

/* =========================================================
   Mobile-first polish (does NOT affect desktop)
   ========================================================= */
@media (max-width: 768px) {

  /* Prevent sideways scroll & add breathing room */
  html,
  body {
    overflow-x: hidden;
  }

  .content-block,
  .about-section {
    padding-left: 16px;
    padding-right: 16px;
  }

  /* Header / top nav: allow wrapping with comfy hit targets */
  .site-header {
    flex-wrap: wrap;
    row-gap: 8px;
    padding: 0.65rem 0.75rem;
  }

  .brand-text {
    font-size: 0.95rem;
  }

  .top-nav ul {
    flex-wrap: wrap;
    gap: 6px;
  }

  .top-nav a {
    padding: 0.45rem 0.75rem;
    line-height: 1.1;
  }

  /* Hero: tighten spacing, make title row stack nicely */
  .hero {
    padding: 2.75rem 1rem 1.5rem;
  }

  .title-row {
    grid-template-columns: 1fr;
    /* stack */
    text-align: center;
    gap: 0.75rem;
  }

  .title-img {
    width: 96px;
    height: 96px;
    justify-self: center;
  }

  .subtitle {
    font-size: clamp(0.95rem, 3.8vw, 1.05rem);
  }

  /* Buttons: make easier to tap */
  .button {
    width: 100%;
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
  }

  /* Team grid already adapts at 1000/560; keep spacing consistent */
  .team-grid {
    gap: 0.85rem;
  }

  .member-card img {
    height: 200px;
  }

  /* Keep actions visible on touch devices (no hover) */
  .member-actions {
    opacity: 1;
    visibility: visible;
    transform: none;
  }

  /* ===== Advisors grid: 1 row × 2 columns per row on mobile ===== */
  .advisor-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    /* two columns on small screens */
    gap: 0.9rem;
  }

  .advisor {
    padding: 0.85rem;
  }

  /* Committee grid: scale down progressively */
  .committee-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.9rem;
  }

  /* Prototype images: stack for narrow screens */
  .prototype-image-grid {
    grid-template-columns: 1fr;
    gap: 0.85rem;
  }

  .prototype-image-grid .project-image {
    border-radius: 12px;
  }

  /* Footer padding tweak */
  .site-footer {
    padding: 0.85rem;
  }
}

/* Even narrower phones */
@media (max-width: 420px) {
  .title-img {
    width: 80px;
    height: 80px;
  }

  .member-card img {
    height: 180px;
  }

  .advisor {
    padding: 0.75rem;
  }

  .top-nav a {
    padding: 0.4rem 0.6rem;
    font-size: 0.95rem;
  }
}

/* ---- QUICK LINKS ROW (matches top-nav active style) ---- */
.cta-row .button,
.cta-row .github-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: var(--white);
  color: var(--navy);
  border: 2px solid var(--light-blue);
  padding: 0.6rem 1rem;
  margin: 0.75rem 0.35rem 0 0.35rem;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 600;
  transition: transform 120ms ease, background 120ms ease, color 120ms ease;
}

.cta-row .button:hover,
.cta-row .github-link:hover,
.cta-row .github-link:focus {
  background: var(--light-blue);
  color: var(--navy);
  transform: translateY(-1px);
  text-decoration: none;
  opacity: 1;
  filter: none;
}

.github-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}