/* Bhargava Systems Research — site styles */
:root {
  --accent: #c0392b;
  --accent-dark: #a93226;
  --ink: #111111;
  --body: #333333;
  --muted: #666666;
  --line: #e2e2e2;
  --bg: #ffffff;
  --bg-muted: #f7f7f5;
  --radius: 8px;
  --wrap: 1100px;
  --serif: "Source Serif 4", Georgia, serif;
  --sans: "Inter", Arial, Helvetica, sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  color: var(--body);
  background: var(--bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.site-footer { margin-top: auto; }       /* pin footer to bottom on short pages */
.hero { flex: 1 0 auto; }                 /* home: hero fills the gap, no white strip */

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-dark); }
img { max-width: 100%; display: block; }

h1, h2, h3 { font-family: var(--serif); color: var(--ink); line-height: 1.2; }

.container { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 1.5rem; }

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.7rem 1.5rem;
  border-radius: 5px;
  font-weight: 600;
  font-size: 0.9rem;
  border: 1px solid transparent;
  transition: background .2s, color .2s, border-color .2s;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); color: #fff; }
.btn-ghost { border-color: #cfcfcf; color: var(--ink); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

/* Header / nav */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,0.95);
  backdrop-filter: saturate(180%) blur(6px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; min-height: 60px; }
.brand { display: flex; align-items: center; gap: 0.6rem; color: var(--ink); }
.brand:hover { color: var(--ink); }
.brand-logo { height: 34px; width: auto; object-fit: contain; }
.brand-text { font-family: var(--serif); font-weight: 700; font-size: 1rem; white-space: nowrap; }
.site-nav { display: flex; gap: 0.25rem; }
.site-nav a {
  color: var(--body); font-size: 0.86rem; font-weight: 500;
  padding: 0.45rem 0.75rem; border-radius: 5px;
}
.site-nav a:hover { color: var(--ink); background: var(--bg-muted); }
.site-nav a.active { color: var(--accent); }

.nav-toggle {
  display: none; flex-direction: column; gap: 5px;
  background: none; border: 0; cursor: pointer; padding: 6px;
}
.nav-toggle span { width: 24px; height: 2px; background: var(--ink); border-radius: 2px; transition: transform .2s, opacity .2s; }

/* Home banner */
.home-banner { display: block; }
.home-banner img { display: block; width: 100%; height: auto; }

/* Hero (home) */
.hero { position: relative; overflow: hidden; background: var(--bg-muted); }
.hero-bg {
  position: absolute; inset: 0;
  background: radial-gradient(900px 400px at 80% -10%, rgba(192,57,43,0.14), transparent 60%),
              radial-gradient(700px 500px at 0% 120%, rgba(17,17,17,0.05), transparent 55%);
}
.hero .container { position: relative; padding-top: 5.5rem; padding-bottom: 5.5rem; max-width: 820px; }
.hero h1 { font-size: clamp(2.1rem, 5vw, 3.3rem); margin-bottom: 1.25rem; }
.lede { font-size: 1.1rem; color: var(--muted); max-width: 640px; margin-bottom: 2rem; }
.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; }

/* Page header (subpages) */
.page-header { background: var(--bg-muted); border-bottom: 1px solid var(--line); }
.page-header .container { padding-top: 3.5rem; padding-bottom: 3.5rem; }
.page-header h1 { font-size: clamp(1.9rem, 4vw, 2.6rem); margin-bottom: 0.9rem; }

/* Generic sections */
.section { padding: 4.5rem 0; }
.section-muted { background: var(--bg-muted); }
.section h2 { font-size: 1.7rem; margin-bottom: 0.9rem; }
.section p { color: var(--body); margin-bottom: 0.9rem; }
.section-title { font-size: 1.7rem; margin-bottom: 2rem; }

/* Research topics — alternating image / text rows */
.methods { display: flex; flex-direction: column; gap: 0; }
.method { display: flex; align-items: center; gap: 2.5rem; }
.method:nth-child(even) { flex-direction: row-reverse; }
.method-figure {
  flex: 0 0 44%; aspect-ratio: 4 / 3; border-radius: var(--radius); overflow: hidden;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
}
.method-figure img { width: 100%; height: 100%; object-fit: cover; display: block; }
.method-body { flex: 1; }
.method h2 { font-size: 1.4rem; margin-bottom: 0.6rem; }
.method-projects { list-style: none; margin: 0; display: flex; flex-direction: column; gap: 0.4rem; }
.method-projects li { position: relative; padding-left: 1.1rem; font-size: 0.92rem; line-height: 1.5; }
.method-projects li::before { content: "→"; position: absolute; left: 0; color: var(--accent); }
.method-projects a { color: var(--body); }
.method-projects a:hover { color: var(--accent); }
@media (max-width: 720px) {
  .method, .method:nth-child(even) { flex-direction: column; }
  .method-figure { width: 100%; flex: 0 0 auto; }
}

/* People */
.people-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.75rem; }
.person { text-align: center; }
.avatar {
  width: 90px; height: 90px; border-radius: 50%;
  margin: 0 auto 1rem; background: var(--bg-muted);
  border: 1px solid var(--line); overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.person h3 { font-size: 1.05rem; margin-bottom: 0.2rem; }
.person-role { color: var(--accent); font-size: 0.82rem; font-weight: 600; margin-bottom: 0.2rem; }
.person-tenure { font-size: 0.78rem; color: var(--muted); }
.person-links { display: flex; gap: 0.7rem; justify-content: center; margin-top: 0.5rem; }

/* Lead mentor (PI) card */
.pi-card {
  display: grid; grid-template-columns: 180px 1fr; gap: 1.5rem; align-items: center;
  background: var(--bg-muted); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 2.25rem;
}
.pi-card img { width: 180px; height: 180px; border-radius: var(--radius); object-fit: cover; object-position: top; border: 1px solid var(--line); }
.pi-info h2 { font-size: 1.5rem; margin-bottom: 0.2rem; }
.pi-role { font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--accent); margin-bottom: 0.9rem; }
.pi-bio { color: var(--body); font-size: 0.95rem; line-height: 1.8; margin: 0; }
.pi-card + .pi-card { margin-top: 3rem; }
.pi-links { display: flex; flex-wrap: wrap; gap: 0.9rem; margin-top: 1.1rem; }
.pi-links .icon-link svg { width: 24px; height: 24px; }
.icon-link { color: var(--muted); display: inline-flex; }
.icon-link:hover { color: var(--accent); }
.icon-link svg { width: 20px; height: 20px; fill: currentColor; display: block; }
@media (max-width: 640px) { .pi-card { grid-template-columns: 1fr; text-align: center; gap: 1.5rem; } .pi-card img { margin: 0 auto; } }

/* Publications */
.pubs { max-width: 820px; }
.pub-year { margin-bottom: 2.5rem; }
.pub-year h2 { font-size: 1.3rem; padding-bottom: 0.5rem; border-bottom: 2px solid var(--accent); margin-bottom: 1.25rem; }
.pub-list { list-style: none; }
.pub { padding: 1rem 0; border-bottom: 1px solid var(--line); }
.pub-title { font-weight: 600; color: var(--ink); margin-bottom: 0.2rem; }
.pub-title a { color: var(--ink); }
.pub-title a:hover { color: var(--accent); }
.pub-authors { font-size: 0.9rem; color: var(--body); margin-bottom: 0.1rem; }
.pub-venue { font-size: 0.9rem; color: var(--muted); margin-bottom: 0.3rem; }
.pub-type {
  display: inline-block; font-size: 0.68rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.05em; padding: 0.15rem 0.55rem; border-radius: 999px; margin-bottom: 0.45rem;
}
.pub-type-oral { background: var(--accent); color: #fff; }
.pub-type-poster { background: var(--bg-muted); color: var(--muted); border: 1px solid var(--line); }

/* Footer */
.site-footer { background: var(--bg-muted); border-top: 1px solid var(--line); padding: 2.5rem 0 1.5rem; }
.footer-inner { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 1.5rem; }
.footer-brand { font-family: var(--serif); font-weight: 700; color: var(--ink); }
.footer-meta { font-size: 0.85rem; color: var(--muted); }
.footer-links { display: flex; flex-direction: column; gap: 0.35rem; text-align: right; }
.footer-links a { font-size: 0.88rem; color: var(--body); }
.footer-links a:hover { color: var(--accent); }
.footer-bottom { margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.footer-bottom small { font-size: 0.78rem; color: var(--muted); }

/* Responsive */
@media (max-width: 820px) {
  .people-grid { grid-template-columns: repeat(2, 1fr); }
  .nav-toggle { display: flex; }
  .site-nav {
    display: none; position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; gap: 0; background: #fff;
    border-bottom: 1px solid var(--line); padding: 0.5rem 1.5rem 1rem;
  }
  .site-nav.open { display: flex; }
  .site-nav a { padding: 0.6rem 0.25rem; }
  .site-header { position: relative; }
}
@media (max-width: 520px) {
  .people-grid { grid-template-columns: 1fr; }
}

/* Tools group in the primary nav (PaperAtlas / PocketScope) */
.nav-tools-label {
  align-self: center;
  margin-left: 0.4rem;
  padding-left: 0.85rem;
  border-left: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
}
.site-nav { align-items: center; }
.site-nav a.tool-link {
  border: 1px solid var(--accent);
  color: var(--accent);
  border-radius: 999px;
  padding: 0.28rem 0.64rem;
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.3;
}
.site-nav a.tool-link:hover { background: var(--accent); color: #fff; }
@media (max-width: 820px) {
  .nav-tools-label { border-left: 0; padding-left: 0.25rem; margin: 0.5rem 0 0.1rem; }
  .site-nav a.tool-link { display: inline-block; margin: 0.15rem 0; }
}
