/* ══════════════════════════════════════════════
   Data Science of the Mind — Shared Styles
   ══════════════════════════════════════════════ */

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

:root {
  --red: #cc0000;
  --dark: #1a1a1a;
  --mid: #444;
  --light: #767676;
  --bg: #fafaf8;
  --card-bg: #fff;
  --border: #e2e0dc;
  --serif: 'Source Serif 4', Georgia, serif;
  --sans: 'DM Sans', system-ui, sans-serif;
}

body {
  font-family: var(--sans);
  color: var(--dark);
  background: var(--bg);
  line-height: 1.65;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

/* ── NAV ── */
nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  max-width: 960px;
  margin: 0 auto;
  padding: 1.75rem 2rem;
  gap: 0.5rem;
}
.nav-links { flex-shrink: 0; }
.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
}
.nav-brand img {
  height: 80px; /* logo */
  width: auto;
}
.nav-links { display: flex; gap: 2rem; }
.nav-links a {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--mid);
  text-decoration: none;
  transition: color 0.2s;
}
.nav-links a:hover,
.nav-links a.active { color: var(--red); }

/* ── PAGE HEADER ── */
.page-header {
  max-width: 960px;
  margin: 0 auto;
  padding: 3.5rem 2rem 1rem;
}
.page-header h1 {
  font-family: var(--serif);
  font-size: 2.4rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.page-header p {
  margin-top: 0.75rem;
  color: var(--light);
  max-width: 560px;
}
.page-header a { color: var(--red); }

/* Links inside sections (e.g. "See Google Scholar…") */
.section > p a {
  color: var(--dark);
  font-weight: 500;
  text-decoration: underline;
  text-decoration-color: var(--border);
  text-underline-offset: 2px;
  transition: color 0.2s, text-decoration-color 0.2s;
}
.section > p a:hover {
  color: var(--red);
  text-decoration-color: var(--red);
}

/* ── HERO (index) ── */
.hero {
  max-width: 960px;
  margin: 0 auto;
  padding: 0.5rem 2rem 2rem;
}
.hero h1 {
  font-family: var(--serif);
  font-size: clamp(2.4rem, 5vw, 3.4rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.03em;
  color: var(--dark);
  max-width: 700px;
}
.hero h1 em {
  font-style: italic;
  color: var(--red);
}
.hero-sub {
  margin-top: 1.5rem;
  font-size: 1.1rem;
  color: var(--light);
  /* max-width: 600px; */
  line-height: 1.7;
}
.hero-affiliation {
  margin-top: 2rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--mid);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.hero-affiliation .dot {
  width: 6px; height: 6px;
  background: var(--red);
  border-radius: 50%;
  flex-shrink: 0;
}

/* Styling for the new wrapper */
.hero-bg-wrapper {
  max-width: 960px;
  margin: 0 auto;
  overflow: hidden;
  /* Background image for wide screens — text overlaps it */
  background-image: url('img/ccds.jpg');
  background-repeat: no-repeat;
  background-position: right top;
  background-size: 65%;
}

/* Hero text constrained to left side on desktop so it doesn't cover the building */
.hero-bg-wrapper .hero-sub {
  max-width: 60%;
}.hero-bg-wrapper .hero-sub:first-child {
  padding-top: 2rem;
}
/* Stacked image: hidden on desktop, shown on smaller screens */
.hero-image-stacked {
  display: none;
  max-width: 960px;
  margin: 0 auto;
  padding: 0 2rem;
}
.hero-image-stacked img {
  width: 100%;
  height: auto;
  display: block;
}

/* Ensure the cards are readable and sit cleanly on top of the image */
.research-card {
  background-color: #ffffff;
  position: relative;
  z-index: 10;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

/* ── SECTIONS ── */
.section {
  max-width: 960px;
  margin: 0 auto;
  padding: 2rem 2rem 1rem;
}
.section--hero-spacing { padding: 3rem 2rem; }
.section-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--red);
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}
.section-label--no-border {
  border-bottom: none;
  padding-bottom: 0;
}

.see-more {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0.02em;
  color: var(--light);
  text-decoration: none;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.15rem 0.6rem;
  margin-left: 0.5rem;
  vertical-align: middle;
  position: relative;
  top: -1px;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.see-more:hover {
  color: var(--red);
  border-color: var(--red);
  background: rgba(204, 0, 0, 0.04);
}

/* ── RESEARCH PAGE ── */
.research-page {
  max-width: 960px;
  margin: 0 auto;
  padding: 2rem 2rem 3rem;
}
.research-page h1 {
  font-family: var(--serif);
  font-size: 2.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 1.25rem;
}
.research-intro {
  font-size: 1.05rem;
  color: var(--mid);
  line-height: 1.75;
  margin-bottom: 2.5rem;
}

/* ── RESEARCH GRID (index & research page) ── */
.research-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
}
.research-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.75rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.research-card:hover {
  border-color: var(--red);
  box-shadow: 0 2px 12px rgba(204,0,0,0.06);
}
.research-card h2 {
  font-family: var(--serif);
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 0.6rem;
}
.research-card h3 {
  font-family: var(--serif);
  font-size: 1.09rem;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 0.6rem;
}
.research-card p {
  font-size: 0.88rem;
  color: var(--light);
  line-height: 1.6;
}
.research-card p + p {
  margin-top: 0.75rem;
}
.research-card a {
  color: var(--red);
  text-decoration: none;
  font-weight: 500;
}
.research-card a:hover {
  text-decoration: underline;
}
a.research-card--link {
  display: block;
  text-decoration: none;
  color: inherit;
}

/* ── PUBLICATION SEARCH ── */
.pub-search-wrapper {
  margin: 1.25rem 0 1.5rem;
}
.pub-search {
  width: 100%;
  max-width: 420px;
  padding: 0.6rem 1rem;
  font-family: var(--sans);
  font-size: 0.9rem;
  color: var(--dark);
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.pub-search::placeholder {
  color: var(--light);
}
.pub-search:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(204, 0, 0, 0.08);
}
.pub-no-results {
  font-size: 0.9rem;
  color: var(--light);
  margin-bottom: 1rem;
}

/* ── PUBLICATION LIST (shared by index & publications) ── */
.featured-pubs { margin-top: 1rem; }
.pub-item {
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  gap: 1rem;
  align-items: baseline;
}
.pub-item:last-child { border-bottom: none; }

.pub-list { list-style: none; }
.pub-entry {
  padding: 1.15rem 0;
  border-bottom: 1px solid var(--border);
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 1.25rem;
  align-items: baseline;
}
.pub-entry:last-child { border-bottom: none; }

.pub-venue {
  flex-shrink: 0;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--red);
  width: 100px;
  text-align: right;
  line-height: 1.8;
}
.pub-info h4,
.pub-body h3 {
  font-family: var(--serif);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.45;
}
.pub-info .authors,
.pub-body .authors {
  font-size: 0.84rem;
  color: var(--light);
  margin-top: 0.2rem;
}
.pub-body .pub-links {
  margin-top: 0.4rem;
  display: flex;
  gap: 0.85rem;
}
.pub-body .pub-links a {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--dark);
  text-decoration: none;
  transition: color 0.15s;
}
.pub-body .pub-links a:hover { color: var(--red); }

.view-all-link {
  margin-top: 1.5rem;
  display: inline-block;
  color: var(--red);
  font-weight: 500;
  font-size: 0.9rem;
  text-decoration: none;
}

/* ── PI CARD (people) ── */
.pi-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 2.25rem;
  display: flex;
  gap: 2.25rem;
  align-items: flex-start;
}
.pi-portrait {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: #e8e6e2;
}
.portrait-placeholder {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  flex-shrink: 0;
  background: linear-gradient(135deg, #e8e6e2 0%, #d4d1cc 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--serif);
  font-size: 2.8rem;
  font-weight: 600;
  color: #a09e9a;
}
.pi-info h2 {
  font-family: var(--serif);
  font-size: 1.5rem;
  font-weight: 700;
}
.pi-info .title {
  font-size: 0.9rem;
  color: var(--red);
  font-weight: 500;
  margin-top: 0.2rem;
}
.pi-info .bio {
  margin-top: 0.85rem;
  font-size: 0.92rem;
  color: var(--mid);
  line-height: 1.7;
}
.pi-links {
  margin-top: 1rem;
  display: flex;
  gap: 1.25rem;
}
.pi-links a {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--dark);
  text-decoration: none;
  letter-spacing: 0.02em;
  transition: color 0.2s;
}
.pi-links a:hover { color: var(--red); }
.pi-links .pi-mail {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--dark);
  letter-spacing: 0.02em;
  cursor: pointer;
  text-decoration: none;
  transition: color 0.2s;
}
.pi-links .pi-mail:hover { color: var(--red); }

/* ── STUDENT GRID (people) ── */
.student-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
}
.student-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.75rem;
  text-align: center;
  transition: border-color 0.2s;
}
.student-card:hover { border-color: var(--red); }
.student-portrait {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 1rem;
  background: #e8e6e2;
}
.student-placeholder {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  margin: 0 auto 1rem;
  background: linear-gradient(135deg, #e8e6e2 0%, #d4d1cc 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--serif);
  font-size: 2rem;
  font-weight: 600;
  color: #a09e9a;
}
.student-card h3 {
  font-family: var(--serif);
  font-size: 1.1rem;
  font-weight: 600;
}
.student-card .role {
  font-size: 0.82rem;
  color: var(--red);
  font-weight: 500;
  margin-top: 0.15rem;
}
.student-card .interests {
  font-size: 0.84rem;
  color: var(--light);
  margin-top: 0.6rem;
  line-height: 1.55;
}
.student-card .student-links {
  margin-top: 0.85rem;
  display: flex;
  justify-content: center;
  gap: 1rem;
}
.student-card .student-links a {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--dark);
  text-decoration: none;
  transition: color 0.2s;
}
.student-card .student-links a:hover { color: var(--red); }

/* ── DIRECTOR PROSE (director page) ── */
.director-prose p {
  font-size: 0.95rem;
  color: var(--mid);
  line-height: 1.75;
}
.director-prose p + p {
  margin-top: 1rem;
}
.director-prose strong {
  color: var(--dark);
}
.director-prose a {
  color: var(--dark);
  font-weight: 500;
  text-decoration: underline;
  text-decoration-color: var(--border);
  text-underline-offset: 2px;
  transition: color 0.2s, text-decoration-color 0.2s;
}
.director-prose a:hover {
  color: var(--red);
  text-decoration-color: var(--red);
}

/* ── MAIL LINK (obfuscated email) ── */
.mail-link {
  cursor: pointer;
  color: var(--red);
  text-decoration: underline;
}

/* ── JOIN INTRO ── */
.join-intro {
  display: flex;
  align-items: center;
  /* gap: 2rem; */
}
.join-intro-text {
  flex: 1;
}
.join-intro-text p {
  font-size: 1.05rem;
  color: var(--mid);
  line-height: 1.75;
}
.join-intro-text p + p {
  margin-top: 0.75rem;
}
.join-intro-text a {
  color: var(--dark);
  font-weight: 500;
  text-decoration: none;
  transition: color 0.2s;
}
.join-intro-text a:hover { color: var(--red); }
.join-intro-img {
  width: 340px;
  height: auto;
  border-radius: 6px;
  flex-shrink: 0;
}
@media (max-width: 700px) {
  .join-intro { flex-direction: column; }
  .join-intro-img { width: 100%; }
}

/* ── DATASET GRID (datasets page) ── */
.dataset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
  gap: 1.25rem;
}
.dataset-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.75rem;
  transition: border-color 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
}
.dataset-card:hover {
  border-color: var(--red);
  box-shadow: 0 2px 12px rgba(204,0,0,0.06);
}
.dataset-card h3 {
  font-family: var(--serif);
  font-size: 1.12rem;
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 0.3rem;
}
.dataset-meta {
  font-size: 0.74rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--red);
  margin-bottom: 0.65rem;
}
.dataset-card p {
  font-size: 0.88rem;
  color: var(--light);
  line-height: 1.65;
  flex: 1;
}
.dataset-authors {
  font-size: 0.82rem;
  color: var(--mid);
  margin-top: 0.6rem;
}
.dataset-links {
  margin-top: 0.65rem;
  display: flex;
  gap: 0.85rem;
}
.dataset-links a {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--dark);
  text-decoration: none;
  transition: color 0.15s;
}
.dataset-links a:hover { color: var(--red); }
@media (max-width: 640px) {
  .dataset-grid { grid-template-columns: 1fr; }
}

/* ── FOOTER ── */
footer {
  max-width: 960px;
  margin: 0 auto;
  padding: 2.5rem 2rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  color: var(--light);
  flex-wrap: wrap;
  gap: 1rem;
}
footer a { color: var(--mid); text-decoration: none; }
footer a:hover { color: var(--red); }
.footer-links { display: flex; gap: 1.5rem; }

/* ── RESPONSIVE: mid-size screens ── */
@media (max-width: 820px) {
  nav {
    padding: 1.5rem 1.5rem 1rem;
    justify-content: flex-start;
    row-gap: 1.25rem;
  }
  .nav-brand {
    width: 100%;
  }
  .nav-brand img {
    display: block;
    width: auto;
    max-width: 100%;
    height: auto;
    max-height: 100px;
  }
  .nav-links {
    width: 100%;
    margin-top: 0.15rem;
    gap: 1.5rem;
  }
  .hero-bg-wrapper {
    background-image: none;
  }
  .hero-bg-wrapper .hero-sub {
    max-width: 100%;
  }
  .hero-bg-wrapper .hero-sub:first-child {
    padding-top: 0;
  }
  .hero-image-stacked {
    display: block;
  }
  .hero {
    padding: 0.4rem 1.5rem 2rem;
  }
  .hero-sub:first-child {
    margin-top: 0;
  }
}

/* ── RESPONSIVE ── */
@media (max-width: 640px) {
  nav {
    padding: 1.25rem;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
  }
  .nav-brand {
    width: 100%;
    justify-content: center;
  }
  .nav-brand img {
    display: block;
    width: auto;
    max-width: 100%;
    height: auto;
    max-height: 100px;
  }
  .nav-links {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 0.35rem;
    column-gap: 1rem;
    row-gap: 0.65rem;
  }
  .nav-links a {
    white-space: nowrap;
    text-align: center;
    display: block;
    padding: 0.35rem 0.25rem;
  }
  .hero { padding: 0.75rem 1.25rem 2rem; }
  .hero-sub:first-child { margin-top: 0; }
  .page-header { padding: 2rem 1.25rem 0.5rem; }
  .section { padding: 1.5rem 1.25rem 1rem; }
  .pub-item { flex-direction: column; gap: 0.25rem; }
  .pub-venue { text-align: left; width: auto; }
  .pub-entry { grid-template-columns: 1fr; gap: 0.2rem; }
  .pi-card { flex-direction: column; align-items: center; text-align: center; }
  .pi-links { justify-content: center; }
  footer { padding: 2rem 1.25rem; }
}
