/* ===========================================================
   Abhigyan Acherjee — portfolio
   Minimalist academic style (al-folio inspired)
   =========================================================== */

:root {
  --bg: #ffffff;
  --text: #1c1c1e;
  --muted: #6b7280;
  --accent: #b31b1b;          /* Georgetown / academic red accent */
  --accent-hover: #8a1414;
  --border: #e6e6e6;
  --card: #fafafa;
  --link: #b31b1b;
  --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 4px 16px rgba(0,0,0,0.04);
  --maxw: 820px;
}

:root[data-theme="dark"] {
  --bg: #15171a;
  --text: #e8e8ea;
  --muted: #9aa0a6;
  --accent: #ff6b6b;
  --accent-hover: #ff8787;
  --border: #2a2d31;
  --card: #1c1f23;
  --link: #ff8080;
  --shadow: 0 1px 3px rgba(0,0,0,0.4), 0 4px 16px rgba(0,0,0,0.3);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  transition: background 0.25s ease, color 0.25s ease;
}

a {
  color: var(--link);
  text-decoration: none;
  transition: color 0.15s ease;
}
a:hover { color: var(--accent-hover); text-decoration: underline; }

.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Navigation ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand {
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -0.01em;
  color: var(--text);
}
.brand:hover { color: var(--text); text-decoration: none; }
.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
}
.nav-links a {
  color: var(--muted);
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.98rem;
  font-weight: 500;
}
.nav-links a:hover {
  color: var(--text);
  background: var(--card);
  text-decoration: none;
}
.nav-links a.active {
  color: var(--accent);
  font-weight: 600;
}
.theme-toggle {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 8px;
  width: 36px;
  height: 34px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  padding: 0;
}
.theme-toggle:hover { color: var(--text); border-color: var(--muted); }
.theme-toggle svg { width: 18px; height: 18px; }

/* ---------- About / profile ---------- */
main { padding: 48px 0 80px; }

.profile {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 40px;
  align-items: start;
}
.profile-side { text-align: center; }
.profile-img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 14px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}
.profile-position {
  margin: 14px 0 2px;
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text);
}
.profile-position span {
  font-weight: 500;
  color: var(--muted);
}
.profile-email {
  display: block;
  margin-top: 8px;
  font-size: 0.92rem;
  color: var(--muted);
  word-break: break-word;
}
.profile-email a { color: var(--muted); }
.profile-email a:hover { color: var(--accent); }

.socials {
  margin-top: 26px;
  display: flex;
  justify-content: flex-start;
  gap: 14px;
}
.socials a {
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--border);
  transition: all 0.15s ease;
}
.socials a:hover {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
  transform: translateY(-2px);
  text-decoration: none;
}
.socials svg { width: 19px; height: 19px; }

.profile-main h1 {
  font-size: 2.1rem;
  margin: 0 0 4px;
  letter-spacing: -0.02em;
  line-height: 1.15;
}
.tagline {
  color: var(--accent);
  font-weight: 600;
  margin: 0 0 20px;
  font-size: 1.05rem;
}
.bio p { margin: 0 0 16px; }
.bio p:last-child { margin-bottom: 0; }

/* ---------- Research ---------- */
.page-title {
  font-size: 1.9rem;
  margin: 0 0 6px;
  letter-spacing: -0.02em;
}
.page-sub {
  color: var(--muted);
  margin: 0 0 36px;
}
.section-head {
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  margin: 36px 0 4px;
  color: var(--text);
}
.section-head:first-of-type { margin-top: 0; }

.pub {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 24px;
  align-items: start;
  padding: 22px 0;
  border-top: 1px solid var(--border);
}
.pub:last-child { border-bottom: 1px solid var(--border); }
.pub-thumb {
  width: 150px;
  height: 110px;
  border-radius: 10px;
  background: var(--card);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.pub-thumb img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.pub-title {
  font-size: 1.12rem;
  font-weight: 600;
  margin: 0 0 4px;
  line-height: 1.35;
  color: var(--text);
}
.pub-authors {
  font-size: 0.95rem;
  font-style: italic;
  color: var(--text);
  margin: 0 0 3px;
  line-height: 1.45;
}
.pub-authors .me { text-decoration: underline; }
.pub-venue {
  color: var(--muted);
  font-style: italic;
  font-size: 0.96rem;
  margin: 0 0 12px;
}
.pub-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}
.pub-links a, .pub-links button {
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 4px 12px;
  border-radius: 20px;
  border: 1px solid var(--accent);
  color: var(--accent);
  background: transparent;
  cursor: pointer;
  transition: all 0.15s ease;
}
.pub-links a:hover, .pub-links button:hover {
  background: var(--accent);
  color: #fff;
  text-decoration: none;
}
.pub-abstract {
  margin-top: 14px;
  padding: 14px 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 0.95rem;
  color: var(--text);
  line-height: 1.6;
  display: none;
}
.pub-abstract.open { display: block; }

/* ---------- Footer ---------- */
footer {
  border-top: 1px solid var(--border);
  padding: 26px 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.88rem;
}

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
  body { font-size: 16px; }
  .profile {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .profile-side {
    max-width: 220px;
    margin: 0 auto;
  }
  .profile-main { text-align: center; }
  .bio { text-align: left; }
  .socials { justify-content: center; }
  .pub {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .pub-thumb { width: 100%; height: 150px; }
  .nav-links a { padding: 6px 8px; font-size: 0.92rem; }
  .brand { font-size: 1rem; }
}
