/* Subhadip Mukherjee — academic homepage */

:root {
  --bg: #ffffff;
  --bg-alt: #f4f5f7;
  --bg-raised: #ffffff;
  --text: #1a1d23;
  --text-muted: #5b6472;
  --border: #e1e4e9;
  --accent: #2f5d8a;
  --accent-soft: #e8eef5;
  --accent-hover: #1f3f61;
  --link: #2f5d8a;
  --link-hover: #1f3f61;
  --card-shadow: 0 1px 2px rgba(20, 25, 35, 0.05);
  --card-shadow-hover: 0 6px 18px rgba(20, 25, 35, 0.08);
  --max-width: 1040px;
  --content-pad: clamp(1.1rem, 4vw, 2.5rem);
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14161a;
    --bg-alt: #1b1e24;
    --bg-raised: #20232a;
    --text: #e6e8eb;
    --text-muted: #9aa3af;
    --border: #2b2f37;
    --accent: #7fa8d9;
    --accent-soft: #24344a;
    --accent-hover: #a8c6ea;
    --link: #7fa8d9;
    --link-hover: #a8c6ea;
    --card-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
    --card-shadow-hover: 0 8px 22px rgba(0, 0, 0, 0.45);
  }
}

:root[data-theme="dark"] {
  --bg: #14161a;
  --bg-alt: #1b1e24;
  --bg-raised: #20232a;
  --text: #e6e8eb;
  --text-muted: #9aa3af;
  --border: #2b2f37;
  --accent: #7fa8d9;
  --accent-soft: #24344a;
  --accent-hover: #a8c6ea;
  --link: #7fa8d9;
  --link-hover: #a8c6ea;
  --card-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
  --card-shadow-hover: 0 8px 22px rgba(0, 0, 0, 0.45);
}

:root[data-theme="light"] {
  --bg: #ffffff;
  --bg-alt: #f4f5f7;
  --bg-raised: #ffffff;
  --text: #1a1d23;
  --text-muted: #5b6472;
  --border: #e1e4e9;
  --accent: #2f5d8a;
  --accent-soft: #e8eef5;
  --accent-hover: #1f3f61;
  --link: #2f5d8a;
  --link-hover: #1f3f61;
  --card-shadow: 0 1px 2px rgba(20, 25, 35, 0.05);
  --card-shadow-hover: 0 6px 18px rgba(20, 25, 35, 0.08);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background:
    radial-gradient(1100px 420px at 15% -10%, var(--accent-soft) 0%, transparent 60%),
    var(--bg);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.55;
  font-size: 16.5px;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--link);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}
a:hover {
  color: var(--link-hover);
  border-bottom-color: currentColor;
}

.topbar {
  height: 4px;
  background: linear-gradient(90deg, var(--accent) 0%, #7fa8d9 50%, var(--accent) 100%);
}

.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--bg-alt);
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: saturate(1.2) blur(6px);
}

.site-header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1rem var(--content-pad) 0;
}

.title-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.8rem;
  margin-bottom: 0.6rem;
}

.social-links {
  display: flex;
  gap: 0.4rem;
  flex-shrink: 0;
}
.social-links a {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  color: var(--text-muted);
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.social-links a:hover {
  border-color: currentColor;
  filter: brightness(1.08);
}
.social-links svg { width: 21px; height: 21px; fill: currentColor; }
.social-links a.icon-scholar { color: #4285f4; }
.social-links a.icon-scholar:hover { background: #eaf1fd; }
.social-links a.icon-linkedin { color: #0a66c2; }
.social-links a.icon-linkedin:hover { background: #e8f1fa; }
.social-links a.icon-institute { color: var(--accent); }
.social-links a.icon-institute:hover { background: var(--accent-soft); }
.social-links a.icon-lab { color: var(--accent); }
.social-links a.icon-lab:hover { background: var(--accent-soft); }

@media (prefers-color-scheme: dark) {
  .social-links a.icon-scholar:hover { background: #1c2b42; }
  .social-links a.icon-linkedin:hover { background: #16273a; }
}
:root[data-theme="dark"] .social-links a.icon-scholar:hover { background: #1c2b42; }
:root[data-theme="dark"] .social-links a.icon-linkedin:hover { background: #16273a; }

nav.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem;
  font-size: 0.9rem;
}

nav.site-nav .nav-item { position: relative; }

nav.site-nav a.nav-link {
  display: inline-block;
  padding: 0.5rem 0.8rem;
  color: var(--text-muted);
  border: none;
  border-bottom: 2px solid transparent;
}
nav.site-nav a.nav-link:hover {
  color: var(--accent);
  border-bottom-color: var(--border);
}
nav.site-nav a.nav-link.active {
  color: var(--accent);
  font-weight: 700;
  border-bottom-color: var(--accent);
}

.nav-submenu {
  list-style: none;
  margin: 0;
  padding: 0.3rem 0 0.6rem 1.05rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.1rem 0.3rem;
  border-top: 1px dashed var(--border);
  margin-top: 0.1rem;
}
.nav-submenu a.nav-link {
  font-size: 0.82rem;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
}

main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1.9rem var(--content-pad) 3.2rem;
}

h1 {
  font-size: clamp(1.4rem, 3vw, 1.75rem);
  margin: 0 0 0.9rem;
  letter-spacing: -0.01em;
}
h2 {
  font-size: 1.14rem;
  margin: 1.8rem 0 0.8rem;
  padding-bottom: 0.35rem;
  border-bottom: 2px solid var(--border);
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
h2::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 2px;
  background: var(--accent);
  display: inline-block;
  flex-shrink: 0;
}
h3 {
  font-size: 1.02rem;
  margin: 1.4rem 0 0.4rem;
}

p { margin: 0 0 0.85rem; }

ul, ol {
  margin: 0 0 0.85rem;
  padding-left: 1.25rem;
}
li { margin-bottom: 0.4rem; }

.hero {
  display: flex;
  gap: 1.5rem;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 1.1rem;
  padding-bottom: 1.2rem;
  border-bottom: 1px solid var(--border);
}
.hero img {
  width: 140px;
  height: 140px;
  object-fit: cover;
  border-radius: 12px;
  border: 3px solid var(--bg-raised);
  outline: 1px solid var(--border);
  box-shadow: var(--card-shadow);
}
.hero-text { flex: 1; min-width: 280px; }
.hero-text h1 {
  font-size: clamp(1.3rem, 2vw, 1.6rem);
  font-weight: 700;
  letter-spacing: -0.01em;
  text-transform: none;
  margin-bottom: 0.3rem;
}
.hero-text .subtitle {
  color: var(--text-muted);
  font-size: 0.94rem;
  margin-bottom: 0.7rem;
}
.tags-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin: 0.7rem 0 0;
}
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0.35rem 0 0;
}
.tags span {
  font-size: 0.78rem;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 999px;
  padding: 0.28rem 0.7rem;
  font-weight: 600;
}

.callout {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  padding: 0.8rem 1.05rem;
  margin: 1.1rem 0;
  font-size: 0.95rem;
  box-shadow: var(--card-shadow);
}

.entry {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.65rem 1rem;
  margin-bottom: 0.5rem;
  box-shadow: var(--card-shadow);
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.entry:hover {
  box-shadow: var(--card-shadow-hover);
  transform: translateY(-1px);
}
.entry .meta {
  font-size: 0.76rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.2rem;
  font-weight: 700;
}

.timeline { margin-top: 0.3rem; }
.timeline .item {
  display: grid;
  grid-template-columns: 136px 1fr;
  gap: 0.8rem;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  transition: background 0.15s ease;
}
.timeline .item:hover { background: var(--bg-alt); }
.timeline .item:nth-child(odd) { background: color-mix(in srgb, var(--bg-alt) 55%, transparent); }
.timeline .item:nth-child(odd):hover { background: var(--bg-alt); }
.timeline .date {
  font-size: 0.8rem;
  color: var(--accent);
  font-weight: 600;
  white-space: nowrap;
  padding-top: 0.1rem;
}
@media (max-width: 620px) {
  .timeline .item { grid-template-columns: 1fr; gap: 0.15rem; }
}

.pub {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.8rem 1.05rem;
  margin-bottom: 0.6rem;
  box-shadow: var(--card-shadow);
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.pub:hover {
  box-shadow: var(--card-shadow-hover);
  transform: translateY(-1px);
}
.pub .cite { margin-bottom: 0.45rem; }
.pub .links {
  font-size: 0.85rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.pub .links a {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.3rem 0.85rem;
  color: var(--text);
  font-weight: 600;
}
.pub .links a:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-soft);
}

.muted {
  color: var(--text-muted);
  font-weight: 400;
  font-size: 0.75em;
  text-transform: none;
  letter-spacing: 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.6rem 0 1.6rem;
  font-size: 0.89rem;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--card-shadow);
}
th, td {
  text-align: left;
  padding: 0.42rem 0.8rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  line-height: 1.35;
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--bg-alt); }
th {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  background: var(--bg-alt);
  padding: 0.5rem 0.8rem;
}

tr.group-row td {
  background: var(--bg-alt);
  color: var(--accent);
  font-weight: 700;
  font-size: 0.85rem;
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
  border-left: 3px solid var(--accent);
}
tr.group-row:hover td { background: var(--bg-alt); }
tr.group-row .muted { color: var(--text-muted); opacity: 1; }

.contact-block {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem 1.2rem;
  margin: 0.9rem 0;
  box-shadow: var(--card-shadow);
}
.contact-block dt {
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
  font-weight: 700;
  margin-top: 0.8rem;
}
.contact-block dt:first-child { margin-top: 0; }
.contact-block dd { margin: 0.25rem 0 0; }

.site-footer {
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.82rem;
  text-align: center;
  padding: 1.6rem var(--content-pad) 2.4rem;
}

@media (max-width: 480px) {
  main { padding-top: 1.9rem; }
  .hero { gap: 1.2rem; }
  .hero img { width: 128px; height: 128px; }
}
