/* =========================================================
   Linen Theme — Humans & Agents Lab
   bg: #f7f3ed  |  text: #2a2a2a  |  accent: #2d5a27
   ========================================================= */

/* ── Tokens ─────────────────────────────────────────────── */
:root {
  --bg:           #f7f3ed;
  --bg-card:      #fdfbf8;
  --bg-card-alt:  #f2ede6;
  --text:         #2a2a2a;
  --text-muted:   #7a7066;
  --text-light:   #a89f96;
  --accent:       #2d5a27;
  --accent-hover: #1e3f1b;
  --accent-light: #eaf2e8;
  --border:       #ddd5c8;
  --border-light: #ede8e0;
  --nav-bg:       #2a2a2a;
  --nav-text:     #f7f3ed;
  --nav-muted:    #b0a89e;
}

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

/* ── Base ───────────────────────────────────────────────── */
html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

img { display: block; max-width: 100%; }

/* ── Navigation ─────────────────────────────────────────── */
nav {
  background: var(--nav-bg);
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid #1a1a1a;
}

nav .nav-inner {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 54px;
}

nav .brand {
  color: var(--nav-text);
  font-weight: 600;
  font-size: 0.92rem;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

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

nav ul li a {
  color: var(--nav-muted);
  font-size: 0.83rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  padding: 0 0.9rem;
  height: 54px;
  display: flex;
  align-items: center;
  transition: color 0.15s;
  border-bottom: 2px solid transparent;
}

nav ul li a:hover,
nav ul li a.active {
  color: var(--nav-text);
  border-bottom-color: var(--accent);
}

/* ── Hero Banner ────────────────────────────────────────── */
/*
 * Usage: place directly after <nav>, before <main>.
 *
 * <div class="hero-banner">
 *   <img src="banner_bg.jpg" alt="Campus">
 *   <div class="hero-banner-text">
 *     <div class="hero-eyebrow">University of Western Ontario</div>
 *     <h1>Humans &amp; Agents Lab</h1>
 *     <p>Studying how people and AI systems collaborate, communicate, and coexist.</p>
 *   </div>
 * </div>
 */
.hero-banner {
  position: relative;
  height: 280px;
  overflow: hidden;
}

.hero-banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 40%;
  display: block;
}

/* dark gradient so text is always legible over any photo */
.hero-banner::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(20, 18, 14, 0.15) 0%,
    rgba(20, 18, 14, 0.40) 55%,
    rgba(20, 18, 14, 0.72) 100%
  );
}

.hero-banner-text {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 2;
  max-width: 900px;
  margin: 0 auto;
  padding: 0 2rem 1.75rem;
}

.hero-banner-text .hero-eyebrow {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #a8c898;
  margin-bottom: 0.5rem;
}

.hero-banner-text h1 {
  font-size: 2.2rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.15;
  color: #f5f0e8;
  margin-bottom: 0.35rem;
}

.hero-banner-text p {
  font-size: 0.93rem;
  color: rgba(245, 240, 232, 0.70);
  max-width: 520px;
}

/* ── Page wrapper ───────────────────────────────────────── */
main {
  max-width: 900px;
  margin: 0 auto;
  padding: 3.5rem 2rem 6rem;
}

/* ── Page header ────────────────────────────────────────── */
/*
 * On the home page, omit .page-header entirely when using .hero-banner —
 * the banner already carries the title. Keep .page-header on inner pages.
 */
.page-header {
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.page-header h1 {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin-bottom: 0.35rem;
}

.page-header p {
  color: var(--text-muted);
  font-size: 0.93rem;
}

/* ── Section heading ────────────────────────────────────── */
.section-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

hr.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 3rem 0;
}

/* ============================================================
   HOME PAGE
   ============================================================ */

/* Hero (text-only fallback — used when no .hero-banner image is present) */
.hero {
  padding: 3.5rem 0 3rem;
}

.hero-eyebrow {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.75rem;
}

.hero h1 {
  font-size: 2.2rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.15;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.hero-sub {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.hero-desc {
  max-width: 620px;
  font-size: 0.97rem;
  line-height: 1.75;
  color: #4a4540;
}

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

.area-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 1.1rem 1.25rem;
  transition: border-color 0.15s;
}

.area-card:hover {
  border-color: #c4b9ab;
}

.area-card h3 {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 0.3rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.area-card h3::before {
  content: '→';
  font-size: 0.8rem;
}

.area-card p {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Home two-col layout */
.home-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 3rem;
  margin-top: 1rem;
}

/* News list */
.news-list {
  list-style: none;
}

.news-item {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 0.9rem;
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--border-light);
}

.news-item:first-child {
  padding-top: 0;
}

.news-item:last-child {
  border-bottom: none;
}

.news-date {
  font-size: 0.75rem;
  color: var(--text-light);
  font-weight: 500;
  padding-top: 0.15rem;
  white-space: nowrap;
}

.news-text h4 {
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.35;
  margin-bottom: 0.2rem;
  color: var(--text);
}

.news-text p {
  font-size: 0.81rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.news-text p a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: var(--accent-light);
  text-underline-offset: 2px;
}

/* ============================================================
   GROUP PAGE
   ============================================================ */

.pi-card {
  display: flex;
  gap: 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.75rem;
  margin-bottom: 2.5rem;
}

.pi-card img {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
  flex-shrink: 0;
}

.pi-info h2 {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.15rem;
}

.pi-info .pi-role {
  font-size: 0.83rem;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 0.65rem;
}

.pi-info p {
  font-size: 0.9rem;
  color: #555;
  line-height: 1.65;
}

.pi-info a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-color: var(--accent-light);
}

.pi-info a:hover {
  text-decoration-color: var(--accent);
}

.group-section-title {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.1rem;
  margin-top: 2.5rem;
}

.members-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 0.9rem;
}

.member-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 1.15rem;
}

.member-card img {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border);
  margin-bottom: 0.65rem;
}

.member-card h3 {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.1rem;
  line-height: 1.3;
}

.member-card .m-role {
  font-size: 0.76rem;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 0.05rem;
}

.member-card .m-period {
  font-size: 0.73rem;
  color: var(--text-light);
  margin-bottom: 0.5rem;
}

.member-card p {
  font-size: 0.81rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ============================================================
   RESEARCH PAGE
   ============================================================ */

.research-intro {
  font-size: 0.97rem;
  line-height: 1.75;
  color: #4a4540;
  max-width: 700px;
  margin-bottom: 2.5rem;
}

details.rsection {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 0.75rem;
  overflow: hidden;
}

details.rsection > summary {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 1.05rem 1.25rem;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.97rem;
  list-style: none;
  user-select: none;
  transition: background 0.15s;
}

details.rsection > summary::-webkit-details-marker { display: none; }

details.rsection > summary .toggle-icon {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent-light);
  color: var(--accent);
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.2s, background 0.15s;
  font-style: normal;
}

details.rsection[open] > summary .toggle-icon {
  transform: rotate(90deg);
  background: var(--accent);
  color: white;
}

details.rsection > summary:hover {
  background: var(--accent-light);
}

.rsection-body {
  padding: 0.25rem 1.25rem 1.25rem 3.15rem;
}

.rsection-intro {
  font-size: 0.92rem;
  line-height: 1.72;
  color: #4a4540;
  margin-bottom: 1.1rem;
}

details.rsub {
  margin: 0.6rem 0;
  border-left: 2px solid var(--border);
  padding-left: 1rem;
}

details.rsub > summary {
  cursor: pointer;
  list-style: none;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  padding: 0.3rem 0;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

details.rsub > summary::-webkit-details-marker { display: none; }

details.rsub > summary::before {
  content: '›';
  color: var(--text-light);
  font-size: 1rem;
}

details.rsub[open] > summary::before {
  content: '⌄';
  font-size: 0.85rem;
}

details.rsub p {
  font-size: 0.86rem;
  color: #555;
  line-height: 1.68;
  margin-top: 0.5rem;
  padding-bottom: 0.4rem;
}

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

.publications-lead {
  font-size: 0.97rem;
  line-height: 1.75;
  color: #4a4540;
  max-width: 650px;
  margin-bottom: 2rem;
}

.scholar-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  background: var(--accent);
  color: #fff;
  font-size: 0.88rem;
  font-weight: 500;
  padding: 0.7rem 1.4rem;
  border-radius: 6px;
  transition: background 0.15s;
  letter-spacing: 0.01em;
}

.scholar-cta:hover {
  background: var(--accent-hover);
  color: #fff;
}

.scholar-cta svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.pub-venues {
  margin-top: 2.5rem;
}

.pub-venues p {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.7;
}

.venue-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.venue-tag {
  background: var(--bg-card-alt);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.25rem 0.65rem;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-muted);
}

/* ============================================================
   BIO PAGE
   ============================================================ */

.bio-layout {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2rem;
  margin-bottom: 2.5rem;
  align-items: flex-start;
}

.bio-photo {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
}

.bio-intro h1 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 0.2rem;
}

.bio-intro .bio-title {
  font-size: 0.88rem;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 0.15rem;
}

.bio-intro .bio-affil {
  font-size: 0.83rem;
  color: var(--text-muted);
}

.bio-body {
  max-width: 700px;
}

.bio-body p {
  font-size: 0.96rem;
  line-height: 1.78;
  color: #3a3530;
  margin-bottom: 1.2rem;
}

.bio-body a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-color: var(--accent-light);
}

.bio-body a:hover {
  text-decoration-color: var(--accent);
}

.affil-list {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.affil-list h2 {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.9rem;
}

.affil-items {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.affil-item {
  font-size: 0.88rem;
  color: #444;
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.affil-item::before {
  content: '·';
  color: var(--accent);
  font-weight: 700;
  flex-shrink: 0;
}

.affil-item a {
  color: var(--accent);
}

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

footer {
  border-top: 1px solid var(--border);
  background: var(--bg);
  padding: 1.5rem 2rem;
}

footer .footer-inner {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--text-light);
}

footer a {
  color: var(--text-muted);
}

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

/* ============================================================
   UTILITIES
   ============================================================ */

.see-all {
  font-size: 0.8rem;
  color: var(--accent);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.see-all:hover {
  color: var(--accent-hover);
}

.tag {
  display: inline-block;
  background: var(--accent-light);
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.15rem 0.55rem;
  border-radius: 3px;
  letter-spacing: 0.02em;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 700px) {
  main { padding: 2rem 1.25rem 4rem; }
  .hero h1 { font-size: 1.7rem; }
  .areas-grid { grid-template-columns: 1fr; }
  .home-grid { grid-template-columns: 1fr; gap: 2rem; }
  .pi-card { flex-direction: column; }
  .members-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
  .bio-layout { grid-template-columns: 1fr; }
  .bio-photo { width: 72px; height: 72px; }
  footer .footer-inner { flex-direction: column; gap: 0.5rem; text-align: center; }

  /* Better mobile navigation */
  nav .nav-inner {
    flex-wrap: wrap;
    height: auto;
    padding: 0.75rem 1rem;
  }
  
  nav .brand {
    font-size: 0.85rem;
    width: 100%;
    margin-bottom: 0.5rem;
    text-align: center;
  }
  
  nav ul {
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
  }
  
  nav ul li a {
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
    height: auto;
  }

  /* Banner responsive */
  .hero-banner { height: 200px; }
  .hero-banner-text h1 { font-size: 1.6rem; }
  .hero-banner-text { padding: 0 1.25rem 1.25rem; }
}