/* =========================================================
   SAI MA LAB — CLEANED SITE STYLESHEET
   ========================================================= */

/* ---------- VARIABLES ---------- */
:root {
  --text: #18202a;
  --muted: #66717f;
  --line: #e4e8ec;
  --background: #ffffff;
  --soft-background: #f6f8fa;
  --accent: #2563eb;
  --dark: #111827;
  --max-width: 1180px;
}

/* ---------- BASE ---------- */
* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  color: var(--text);
  background: var(--background);
  line-height: 1.6;
}

a {
  color: inherit;
  text-decoration: none;
}

img { max-width: 100%; }

.container {
  width: min(90%, var(--max-width));
  margin: 0 auto;
}

/* =========================================================
   HEADER
   ========================================================= */

.site-header {
  background: rgba(255,255,255,0.96);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(8px);
}

.nav {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-weight: 750;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

nav {
  display: flex;
  align-items: center;
  gap: 32px;
}

nav a {
  font-size: 0.95rem;
  color: #374151;
  white-space: nowrap;
}

nav a:hover { color: var(--accent); }

.nav-right {
  display: flex;
  align-items: center;
  gap: 28px;
}

.header-logo img {
  width: 58px;
  height: 58px;
  object-fit: contain;
  display: block;
}

/* =========================================================
   PAGE HERO — INNER PAGES
   ========================================================= */

.page-hero {
  padding: 82px 0 44px;
  background: linear-gradient(
    120deg,
    #ffffff 0%,
    #ffffff 72%,
    #f6f8fa 100%
  );
}

.page-hero h1 {
  font-size: clamp(2.5rem, 5vw, 4.5rem);
  line-height: 1.02;
  letter-spacing: -0.05em;
  margin: 14px 0 22px;
}

.page-hero .hero-text { margin-bottom: 0; }

/* =========================================================
   HOME HERO SLIDESHOW
   ========================================================= */

.hero.hero-slideshow {
  position: relative;
  min-height: 520px;
  display: flex;
  align-items: center;
  overflow: hidden;
  background: #f5f5f5;
}

.hero-backgrounds {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  opacity: 0;
  transform: scale(1.025);
  transition:
    opacity 1.2s ease,
    transform 6s ease;
}

.hero-slide.active {
  opacity: 1;
  transform: scale(1);
}

.hero-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(
    90deg,
    rgba(255,255,255,0.97) 0%,
    rgba(255,255,255,0.92) 34%,
    rgba(255,255,255,0.58) 58%,
    rgba(255,255,255,0.12) 100%
  );
}

.hero.hero-slideshow .hero-inner {
  position: relative;
  z-index: 2;

  width: min(90%, var(--max-width));
  max-width: var(--max-width);
  margin-left: auto;
  margin-right: auto;

  padding: 80px 0;
}

.eyebrow,
.section-label {
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent);
}

.hero.hero-slideshow h1 {
  font-size: clamp(2.4rem, 4.5vw, 4rem);
  line-height: 1.04;
  letter-spacing: -0.05em;
  white-space: nowrap;
  margin: 18px 0 28px;
}

.hero-text {
  font-size: 1.35rem;
  max-width: 760px;
  color: var(--muted);
  margin-bottom: 28px;
}

.hero-buttons {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}


/* =========================================================
   HOME HERO SLIDESHOW CONTROLS
   ========================================================= */

.hero-controls {
  position: absolute;
  right: max(5%, calc((100vw - var(--max-width)) / 2));
  bottom: 28px;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 12px;
}

.hero-arrow {
  width: 38px;
  height: 38px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(24, 32, 42, 0.18);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.86);
  color: var(--dark);
  font: inherit;
  font-size: 1.05rem;
  line-height: 1;
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    transform 0.2s ease;
}

.hero-arrow:hover {
  background: #ffffff;
  border-color: var(--dark);
  transform: translateY(-1px);
}

.hero-dots {
  display: flex;
  align-items: center;
  gap: 7px;
}

.hero-dot {
  width: 8px;
  height: 8px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(24, 32, 42, 0.30);
  cursor: pointer;
  transition:
    width 0.2s ease,
    background 0.2s ease;
}

.hero-dot.active {
  width: 22px;
  border-radius: 5px;
  background: var(--dark);
}

/* =========================================================
   BUTTONS
   ========================================================= */

.button {
  display: inline-block;
  padding: 13px 22px;
  border-radius: 7px;
  font-weight: 600;
  transition:
    transform 0.2s ease,
    border-color 0.2s ease,
    background 0.2s ease;
}

.button.primary {
  background: var(--dark);
  color: #fff;
}

.button.primary:hover { transform: translateY(-2px); }

.button.secondary {
  border: 1px solid #cbd2d9;
  background: rgba(255,255,255,0.45);
}

.button.secondary:hover { border-color: var(--dark); }

.button.white {
  background: #fff;
  color: var(--dark);
  white-space: nowrap;
}

/* =========================================================
   GENERAL SECTIONS
   ========================================================= */

.section { padding: 110px 0; }

.section h2,
.join-section h2 {
  font-size: clamp(2rem, 4vw, 3.2rem);
  letter-spacing: -0.04em;
  line-height: 1.1;
  margin: 15px 0 50px;
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 30px;
}

.soft-section { background: var(--soft-background); }

.text-link { font-weight: 600; }

.text-link:hover { color: var(--accent); }

/* =========================================================
   HOME — RESEARCH
   ========================================================= */

.research-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}

.card {
  border-top: 2px solid var(--dark);
  padding: 28px 4px;
}

.card h3 {
  font-size: 1.4rem;
  margin: 0 0 14px;
}

.card p {
  color: var(--muted);
  margin: 0;
}

/* =========================================================
   HOME — NEWS
   ========================================================= */

.news-section { background: var(--soft-background); }

.news-list { width: 100%; }

.news-item {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 30px;
  border-top: 1px solid #d8dde3;
  padding: 30px 0;
}

.news-date {
  color: var(--muted);
  font-size: 0.9rem;
}

.news-item h3 {
  font-size: 1.25rem;
  margin: 0 0 8px;
}

.news-item p {
  color: var(--muted);
  max-width: 780px;
  margin: 0;
}

/* =========================================================
   NEWS ARCHIVE
   ========================================================= */

.news-card {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 28px;
  align-items: start;
  padding: 28px 0;
  border-top: 1px solid var(--line);
}

.news-card-content { min-width: 0; }

.news-card-date {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 6px;
}

.news-card h2 {
  font-size: 1.4rem;
  margin: 0 0 10px;
}

.news-card p {
  margin: 0;
  color: var(--muted);
}

.news-card-image img {
  width: 100%;
  max-width: 220px;
  max-height: 160px;
  object-fit: cover;
  border-radius: 10px;
  display: block;
}

.news-credit {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.8rem;
}

/* =========================================================
   HOME — JOIN
   ========================================================= */

.join-section {
  background: var(--dark);
  color: #fff;
  padding: 100px 0;
}

.join-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 80px;
}

.join-inner p {
  max-width: 760px;
  color: #cbd5e1;
}

.section-label.light { color: #93c5fd; }

/* =========================================================
   JOIN PAGE
   ========================================================= */

.join-text {
  color: var(--muted);
  font-size: 1.05rem;
  max-width: 820px;
}

.join-email-button { margin-top: 24px; }

.opportunity-list { max-width: 900px; }

.opportunity {
  padding: 42px 0;
  border-top: 1px solid var(--line);
}

.opportunity h2 {
  margin: 8px 0 16px;
  font-size: 1.8rem;
}

.opportunity p {
  margin: 0;
  color: var(--muted);
  font-size: 1.05rem;
  max-width: 760px;
}

/* =========================================================
   PUBLICATIONS
   ========================================================= */

.publication-list { max-width: 950px; }

.publication-year {
  font-size: 2rem;
  font-weight: 750;
  letter-spacing: -0.04em;
  margin-top: 70px;
  margin-bottom: 10px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--dark);
}

.publication-year:first-child { margin-top: 0; }

.publication {
  padding: 28px 0;
  border-bottom: 1px solid var(--line);
}

.publication h3 {
  font-size: 1.3rem;
  line-height: 1.4;
  margin: 0 0 10px;
}

.publication h3 a:hover { color: var(--accent); }

.publication-authors {
  margin: 0 0 5px;
  color: var(--muted);
}

.publication-meta { margin: 0; }

.publication-journal {
  font-weight: 650;
  font-style: italic;
}

.publication-year-inline {
  font-weight: 400;
  font-style: normal;
  color: var(--muted);
}

.publication-link-wrapper {
  display: block;
  color: inherit;
  text-decoration: none;
}

.publication-link-wrapper:hover .featured-pub,
.publication-link-wrapper:hover .publication {
  border-color: var(--accent);
}

.publications-all { background: var(--soft-background); }

/* FEATURED PUBLICATIONS */

.featured-publications {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.featured-pub {
  height: 100%;
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  transition:
    transform 0.2s ease,
    border-color 0.2s ease;
}

.featured-year {
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 700;
  margin-bottom: 25px;
}

.featured-pub h3 {
  font-size: 1.35rem;
  line-height: 1.35;
  margin: 0 0 18px;
}

.featured-pub h3 a:hover { color: var(--accent); }

.publication-link-wrapper:hover .featured-pub {
  transform: translateY(-2px);
}

/* =========================================================
   RESOURCES — TWO-COLUMN CARD LAYOUT
   ========================================================= */

.resource-category { margin-bottom: 75px; }

.resource-category:last-child { margin-bottom: 0; }

.resource-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  margin-top: 24px;
}

.resource-card-link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.resource-card {
  height: 100%;
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  transition:
    transform 0.2s ease,
    border-color 0.2s ease;
}

.resource-card-link:hover .resource-card {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.resource-card h3 {
  font-size: 1.35rem;
  line-height: 1.35;
  margin: 0 0 14px;
}

.resource-card p {
  margin: 0 0 22px;
  color: var(--muted);
  line-height: 1.55;
}

.resource-card-arrow {
  font-size: 0.9rem;
  font-weight: 650;
  color: var(--accent);
}

/* =========================================================
   SAI MA / PI PAGE
   ========================================================= */

.pi-hero {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 70px;
  align-items: start;
}

.pi-title {
  font-size: 1.2rem;
  color: var(--muted);
  max-width: 760px;
  margin: 0 0 28px;
}

.pi-bio {
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.7;
  max-width: 760px;
}

.pi-links {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 30px;
}

.pi-photo {
  display: flex;
  justify-content: flex-end;
}

.pi-photo img {
  width: 100%;
  max-width: 360px;
  height: auto;
  border-radius: 14px;
  display: block;
}

.pi-content { max-width: 950px; }

.pi-section { margin-bottom: 75px; }

.pi-section:last-child { margin-bottom: 0; }

.pi-section h2 {
  font-size: 2rem;
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin: 8px 0 22px;
}

.pi-section-text {
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.7;
  max-width: 800px;
}

.timeline { border-top: 1px solid var(--line); }

.timeline-item {
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
}

.timeline-item h3 {
  margin: 0 0 5px;
  font-size: 1.12rem;
  line-height: 1.35;
}

.timeline-item p {
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.5;
}

/* =========================================================
   TEAM PAGE
   ========================================================= */

.team-section-heading {
  font-size: clamp(2rem, 4vw, 3rem);
  letter-spacing: -0.04em;
  margin: 10px 0 36px;
}

.team-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  margin-top: 28px;
}

.team-card img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 12px;
  display: block;
  margin-bottom: 16px;
}

.team-card h3 {
  font-size: 1.25rem;
  margin: 0 0 4px;
}

.team-card p {
  margin: 0;
  color: var(--muted);
}

/* TEAM GALLERY */

.team-gallery {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 18px;
}

.team-gallery figure { margin: 0; }

.team-gallery figure:nth-child(1) { grid-column: span 7; }

.team-gallery figure:nth-child(2) { grid-column: span 5; }

.team-gallery figure:nth-child(n + 3) { grid-column: span 4; }

.team-gallery img {
  width: 100%;
  height: 320px;
  object-fit: cover;
  border-radius: 12px;
  display: block;
}

.team-gallery figcaption {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.85rem;
}

/* ALUMNI */

.alumni-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  border-top: 1px solid var(--line);
}

.alumni-card {
  display: grid;
  grid-template-columns: 82px 1fr;
  gap: 18px;
  align-items: center;
  padding: 22px 24px 22px 0;
  border-bottom: 1px solid var(--line);
}

.alumni-card:nth-child(odd) {
  border-right: 1px solid var(--line);
  padding-right: 24px;
}

.alumni-card:nth-child(even) {
  padding-left: 24px;
}

.alumni-card img {
  width: 82px;
  height: 82px;
  object-fit: cover;
  border-radius: 50%;
}

.alumni-card h3 {
  margin: 0 0 3px;
  font-size: 1.05rem;
}

.alumni-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.alumni-next {
  margin-top: 4px !important;
  font-size: 0.86rem !important;
}

/* =========================================================
   FOOTER
   ========================================================= */

footer {
  padding: 45px 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 30px;
}

/* =========================================================
   TABLET / MOBILE
   ========================================================= */

@media (max-width: 800px) {

  /* Handles the inline grid currently used in default.html */
  .site-header .container {
    display: flex !important;
    flex-direction: column;
    align-items: flex-start !important;
    gap: 12px !important;
    padding: 14px 0;
  }

  nav {
    gap: 15px;
    flex-wrap: wrap;
  }

  .header-logo {
    display: none !important;
  }

  .page-hero {
    padding: 58px 0 32px;
  }

  .hero.hero-slideshow {
    min-height: 520px;
  }

  .hero.hero-slideshow .hero-inner {
    width: min(90%, var(--max-width));
    margin-left: auto;
    margin-right: auto;
    padding: 70px 0;
  }

  .hero.hero-slideshow h1 {
    white-space: normal;
    font-size: clamp(2.2rem, 9vw, 3.2rem);
  }

  .hero-overlay {
    background: rgba(255,255,255,0.82);
  }

  .hero-controls {
    right: 5%;
    bottom: 20px;
  }

  .hero-arrow {
    width: 34px;
    height: 34px;
  }

  .section {
    padding: 80px 0;
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

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

  .news-item {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .join-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 30px;
  }

  .news-card {
    grid-template-columns: 1fr;
  }

  .news-card-image img {
    max-width: 100%;
    max-height: none;
  }

  .featured-publications {
    grid-template-columns: 1fr;
  }

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

  .pi-hero {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .pi-photo {
    justify-content: flex-start;
  }

  .pi-photo img {
    max-width: 280px;
  }

  .pi-section {
    margin-bottom: 55px;
  }

  .pi-section h2 {
    font-size: 1.7rem;
  }

  .timeline-item {
    padding: 18px 0;
  }

  .team-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .team-gallery {
    grid-template-columns: 1fr;
  }

  .team-gallery figure:nth-child(n) {
    grid-column: auto;
  }

  .team-gallery img {
    height: auto;
  }

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

  .alumni-card:nth-child(odd) {
    border-right: 0;
    padding-right: 0;
  }

  .alumni-card:nth-child(even) {
    padding-left: 0;
  }

  .footer-inner {
    flex-direction: column;
    gap: 20px;
  }
}

@media (max-width: 520px) {

  .container {
    width: min(92%, var(--max-width));
  }

  .hero-text {
    font-size: 1.15rem;
  }

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

  .alumni-card {
    grid-template-columns: 64px 1fr;
  }

  .alumni-card img {
    width: 64px;
    height: 64px;
  }
}
