/* =============================================
   Brahmachari Lab — Minimal Academic Light
   ============================================= */

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

:root {
  --bg:        #ffffff;
  --bg-soft:   #f8f8f6;
  --bg-card:   #f2f2ef;
  --border:    #ddddd8;
  --border-lt: #ebebea;
  --text-1:    #111110;
  --text-2:    #3a3a38;
  --text-3:    #6b6b68;
  --text-4:    #9a9a96;
  --accent:    #4a3d8f;
  --accent-md: #3a2f72;
  --accent-lt: #eeecf8;
  --radius:    4px;
  --radius-lg: 6px;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text-2);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 15px;
  line-height: 1.75;
  min-height: 100vh;
}

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

/* ── Nav ─────────────────────────────────── */
nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,0.96);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 40px;
  height: 54px;
}

.nav-logo {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-1);
  text-decoration: none;
  letter-spacing: 0.1px;
}
.nav-logo span { color: var(--accent); font-weight: 400; }

.nav-links {
  display: flex;
  gap: 32px;
  margin-left: auto;
  list-style: none;
}
.nav-links a {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  font-size: 13.5px;
  color: var(--text-3);
  transition: color 0.12s;
  text-decoration: none;
}
.nav-links a:hover,
.nav-links a.active {
  color: var(--text-1);
  text-decoration: none;
}

/* ── Page wrapper ────────────────────────── */
main { max-width: 820px; margin: 0 auto; padding: 0 40px 100px; }

/* ── Section base ────────────────────────── */
section { padding: 52px 0; border-bottom: 1px solid var(--border-lt); }
section:last-of-type { border-bottom: none; }

.section-label {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-4);
  letter-spacing: 1.2px;
  text-transform: uppercase;
  margin-bottom: 22px;
}

h1 {
  font-size: 32px;
  font-weight: normal;
  color: var(--text-1);
  line-height: 1.25;
  letter-spacing: -0.3px;
  margin-bottom: 0;
}
h2 {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  font-size: 18px;
  font-weight: 600;
  color: var(--text-1);
  letter-spacing: -0.2px;
  margin-bottom: 10px;
}
h3 {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-1);
  margin-bottom: 6px;
}

p { color: var(--text-2); margin-bottom: 16px; }
p:last-child { margin-bottom: 0; }

/* ── Hero ────────────────────────────────── */
.hero { padding: 64px 0 52px; border-bottom: 1px solid var(--border-lt); }

.hero-inst {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  font-size: 14px;
  color: #7e7a9e;
  letter-spacing: 0.2px;
  margin-bottom: 18px;
}
.hero h1 { margin-bottom: 18px; }
.hero .lead {
  font-size: 16px;
  color: var(--text-3);
  line-height: 1.8;
  max-width: 600px;
  margin-bottom: 28px;
}

.tag-row { display: flex; gap: 8px; flex-wrap: wrap; }
.tag {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 3px 10px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  font-size: 12.5px;
  color: var(--text-3);
}

/* ── Index link cards (About / Join) ─────── */
.index-link-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.index-link-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  text-decoration: none;
  transition: background 0.14s, border-color 0.14s;
}
.index-link-card:hover { background: var(--bg-card); border-color: var(--accent); text-decoration: none; }

.index-link-title {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  font-size: 17px;
  font-weight: 600;
  color: var(--text-1);
}
.index-link-arrow {
  font-size: 20px;
  color: var(--accent);
  transition: transform 0.14s;
}
.index-link-card:hover .index-link-arrow { transform: translateX(4px); }

/* ── Research cards ──────────────────────── */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }

.card {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: background 0.14s, border-color 0.14s;
  text-decoration: none;
  display: block;
}
.card:hover { background: var(--bg-card); text-decoration: none; }

.card-img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  border-radius: var(--radius);
  display: block;
  margin-bottom: 14px;
  mix-blend-mode: multiply;
}
.card h3 {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-1);
  margin-bottom: 6px;
}
.card p {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  font-size: 13px;
  color: var(--text-3);
  line-height: 1.6;
  margin: 0;
}
.card .card-link {
  display: inline-block;
  margin-top: 12px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  font-size: 12.5px;
  color: var(--accent);
}

/* ── Featured publications (homepage) ───── */
.pub-featured {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.pub-card {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: background 0.14s, border-color 0.14s;
  text-decoration: none;
}
.pub-card:hover { background: var(--bg-card); border-color: var(--accent); }
.pub-card-img {
  width: 100%;
  height: 110px;
  object-fit: contain;
  border-radius: var(--radius);
  margin-bottom: 12px;
  flex-shrink: 0;
  background: transparent;
  display: block;
  mix-blend-mode: multiply;
}
.pub-card-badge {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  font-size: 11px;
  color: var(--accent);
  margin-bottom: 6px;
}
.pub-card-title {
  font-family: Georgia, serif;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-1);
  margin-bottom: 8px;
}
.pub-card-title a { color: var(--text-1); }
.pub-card-title a:hover { color: var(--accent); text-decoration: none; }
.pub-card-desc {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  font-size: 12px;
  color: var(--text-3);
  line-height: 1.65;
  margin: 0;
  flex: 1;
}

.slider-btn {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 28px;
  height: 28px;
  cursor: pointer;
  font-size: 16px;
  color: var(--text-3);
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  padding: 0;
  transition: border-color 0.12s, color 0.12s;
}
.slider-btn:hover { border-color: var(--accent); color: var(--accent); }

/* ── Publication list (homepage) ─────────── */
.pub-list { display: flex; flex-direction: column; gap: 0; }

.pub {
  padding: 16px 0;
  border-bottom: 1px solid var(--border-lt);
  display: grid;
  grid-template-columns: 40px 1fr auto;
  gap: 0 14px;
  align-items: baseline;
}
.pub:last-child { border-bottom: none; }

.pub-year {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  font-size: 12.5px;
  color: var(--text-4);
  padding-top: 1px;
}
.pub-body { }
.pub-title {
  font-size: 14.5px;
  font-weight: normal;
  color: var(--text-1);
  margin-bottom: 3px;
  line-height: 1.55;
  font-family: Georgia, serif;
}
.pub-title a { color: var(--text-1); }
.pub-title a:hover { color: var(--accent); text-decoration: none; }
.pub-authors {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  font-size: 12.5px;
  color: var(--text-4);
  margin-bottom: 0;
}
.pub-journal {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  font-size: 12.5px;
  color: var(--accent);
  white-space: nowrap;
  align-self: start;
  padding-top: 3px;
}
.pub-links { display: flex; gap: 8px; margin-top: 5px; }
.pub-links a {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  font-size: 12px;
  color: var(--text-4);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 1px 8px;
  text-decoration: none;
}
.pub-links a:hover { color: var(--accent); border-color: var(--accent-md); text-decoration: none; }
.pub-links a.bib-toggle { cursor: pointer; }

/* ── Cite block ──────────────────────────── */
.cite-block {
  display: none;
  margin-top: 8px;
  border: 1px solid var(--border);
  border-left: 2px solid var(--accent);
  border-radius: var(--radius);
  overflow: hidden;
}
.cite-block.open { display: block; }

.cite-section {
  position: relative;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-lt);
}
.cite-section:last-child { border-bottom: none; }

.cite-fmt-label {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--text-4);
  margin-bottom: 6px;
}
.cite-plain {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  font-size: 13px;
  line-height: 1.7;
  color: var(--text-2);
  padding-right: 52px;
}
.cite-pre {
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--text-2);
  background: transparent;
  white-space: pre;
  overflow-x: auto;
  margin: 0;
  padding-right: 52px;
}
.bib-copy {
  position: absolute;
  top: 10px;
  right: 10px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  font-size: 11px;
  padding: 2px 8px;
  border: 1px solid var(--border);
  border-radius: 3px;
  background: var(--bg);
  color: var(--text-3);
  cursor: pointer;
  transition: border-color 0.12s, color 0.12s;
}
.bib-copy:hover { border-color: var(--accent); color: var(--accent); }

/* ── Publication accordion (publications page) */
details.pub-accordion {
  border-bottom: 1px solid var(--border-lt);
}
details.pub-accordion:last-child { border-bottom: none; }

details.pub-accordion > summary {
  list-style: none;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 15px 0;
  cursor: pointer;
  user-select: none;
}
details.pub-accordion > summary::-webkit-details-marker { display: none; }
details.pub-accordion > summary::marker { display: none; }
details.pub-accordion > summary:hover .pub-ttl { color: var(--accent); }

.pub-chev {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  font-size: 15px;
  color: var(--text-4);
  flex-shrink: 0;
  line-height: 1.6;
  transition: transform 0.16s;
}
details.pub-accordion[open] > summary .pub-chev { transform: rotate(90deg); }

.pub-hd { flex: 1; }
.pub-ttl {
  font-size: 14.5px;
  font-weight: normal;
  color: var(--text-1);
  line-height: 1.55;
  margin-bottom: 3px;
  transition: color 0.12s;
  font-family: Georgia, serif;
}
.pub-badge {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  font-size: 12.5px;
  color: var(--accent);
}
.pub-auth-sm {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  font-size: 12.5px;
  color: var(--accent);
  margin-top: 2px;
  line-height: 1.5;
}

.pub-exp {
  padding: 2px 0 20px 24px;
  overflow: hidden;
}
.pub-abs {
  font-size: 14px;
  color: var(--text-3);
  line-height: 1.8;
  margin-bottom: 12px;
  padding: 12px 14px;
  background: var(--bg-soft);
  border-radius: var(--radius);
  border-left: 2px solid var(--border);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  overflow: hidden;
}
.pub-fig {
  float: right;
  width: 48%;
  max-width: 340px;
  border-radius: var(--radius);
  margin: 2px 0 8px 16px;
  display: block;
  mix-blend-mode: multiply;
}

/* ── Year heading for publication sections ─ */
.year-heading {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-4);
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 40px 0 12px;
  border-bottom: 1px solid var(--border-lt);
}
.year-heading:first-child { padding-top: 0; }

/* ── People ──────────────────────────────── */
.people-list { display: flex; flex-direction: column; gap: 0; }

.person-row {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  padding: 18px 0;
  border-bottom: 1px solid var(--border-lt);
}
.person-row:last-child { border-bottom: none; }

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  font-size: 13px;
  font-weight: 600;
  flex-shrink: 0;
  border: 1px solid var(--border);
}
.person-name {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-1);
  margin-bottom: 1px;
}
.person-role {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  font-size: 13px;
  color: var(--text-4);
  margin-bottom: 0;
}

/* ── PI bio ──────────────────────────────── */
.pi-bio {
  display: flex;
  gap: 30px;
  align-items: flex-start;
  margin-bottom: 48px;
}
.pi-photo {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: var(--accent-lt);
  border: 1px solid var(--border);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  font-size: 24px;
  font-weight: 600;
  color: var(--accent);
}
.pi-bio h2 { margin-bottom: 3px; }
.pi-bio .pi-title {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  font-size: 13px;
  color: var(--accent);
  margin-bottom: 14px;
}
.pi-bio p { font-size: 14px; }

/* ── News ────────────────────────────────── */
.news-list { display: flex; flex-direction: column; gap: 0; }
.news-item {
  display: flex;
  gap: 20px;
  padding: 13px 0;
  border-bottom: 1px solid var(--border-lt);
}
.news-item:last-child { border-bottom: none; }
.news-date {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  font-size: 12.5px;
  color: var(--text-4);
  min-width: 64px;
  flex-shrink: 0;
  padding-top: 2px;
}
.news-text {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  font-size: 14px;
  color: var(--text-2);
}

/* ── Join cards (3-column) ───────────────── */
.join-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 4px;
}
.join-card {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
}
.join-card h3 { margin-bottom: 8px; }
.join-card p {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  font-size: 14px;
  flex: 1;
}
.join-card .email-link {
  display: inline-block;
  margin-top: 14px;
  background: var(--accent);
  color: #fff;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  font-size: 13px;
  font-weight: 500;
  padding: 7px 16px;
  border-radius: var(--radius);
  text-decoration: none;
  align-self: flex-start;
}
.join-card .email-link:hover { background: var(--accent-md); text-decoration: none; }
@media (max-width: 700px) { .join-cards { grid-template-columns: 1fr; } }

/* ── Join boxes ──────────────────────────── */
.join-box {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 14px;
}
.join-box h3 { margin-bottom: 8px; }
.join-box p {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  font-size: 14px;
}
.join-box .email-link {
  display: inline-block;
  margin-top: 14px;
  background: var(--accent);
  color: #fff;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  font-size: 13px;
  font-weight: 500;
  padding: 7px 16px;
  border-radius: var(--radius);
  text-decoration: none;
}
.join-box .email-link:hover { background: var(--accent-md); text-decoration: none; }

/* ── Research page sections ──────────────── */
.research-section { padding: 36px 0; border-bottom: 1px solid var(--border-lt); }
.research-section:last-of-type { border-bottom: none; }
.research-section h2 { margin-bottom: 14px; }
.research-pubs { margin-top: 18px; }
.research-pubs-label {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-4);
  margin-bottom: 8px;
}
.research-pubs ul { list-style: none; padding: 0; margin: 0; }
.research-pubs li {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  font-size: 13px;
  color: var(--text-3);
  padding: 4px 0;
  border-top: 1px solid var(--border-lt);
}
.research-pubs li:first-child { border-top: none; }
.research-pubs li a { color: var(--accent); text-decoration: none; }
.research-pubs li a:hover { text-decoration: underline; }
.research-pubs .pub-meta { color: var(--text-4); margin-left: 4px; }

/* ── Footer ──────────────────────────────── */
footer {
  border-top: 1px solid var(--border-lt);
  padding: 22px 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 820px;
  margin: 0 auto;
}
.footer-text {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  font-size: 12px;
  color: var(--text-4);
}

/* ── Responsive ──────────────────────────── */
@media (max-width: 640px) {
  nav { padding: 0 20px; }
  .nav-links { gap: 18px; }
  main { padding: 0 20px 60px; }
  h1 { font-size: 24px; }
  .pi-bio { flex-direction: column; gap: 16px; }
  footer { flex-direction: column; gap: 6px; text-align: center; padding: 18px; }
  .pub { grid-template-columns: 36px 1fr; }
  .pub-journal { display: none; }
}
