/* ============================================================
   Chowdhury Mohammad Abid Rahman — academic homepage
   Palette: cool GitHub-flavored neutrals + scholarly blue accent
   Type: Roboto Slab (headings) + Roboto (body)
   ============================================================ */

:root {
  --bg: #ffffff;
  --surface: #f6f8fa;
  --text: #1f2328;
  --muted: #656d76;
  --accent: #0969da;
  --accent-hover: #0550ae;
  --border: #d1d9e0;
  --shadow: 0 1px 3px rgba(31, 35, 40, 0.08), 0 8px 24px rgba(31, 35, 40, 0.06);
  --nav-h: 56px;
  --max: 840px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --bg: #0d1117;
    --surface: #161b22;
    --text: #e6edf3;
    --muted: #8b949e;
    --accent: #58a6ff;
    --accent-hover: #79c0ff;
    --border: #30363d;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.5), 0 8px 24px rgba(0, 0, 0, 0.4);
  }
}
:root[data-theme="dark"] {
  --bg: #0d1117;
  --surface: #161b22;
  --text: #e6edf3;
  --muted: #8b949e;
  --accent: #58a6ff;
  --accent-hover: #79c0ff;
  --border: #30363d;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.5), 0 8px 24px rgba(0, 0, 0, 0.4);
}
:root[data-theme="light"] {
  --bg: #ffffff;
  --surface: #f6f8fa;
  --text: #1f2328;
  --muted: #656d76;
  --accent: #0969da;
  --accent-hover: #0550ae;
  --border: #d1d9e0;
  --shadow: 0 1px 3px rgba(31, 35, 40, 0.08), 0 8px 24px rgba(31, 35, 40, 0.06);
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 12px); }

body {
  margin: 0;
  font-family: "Roboto", system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  transition: background 0.2s ease, color 0.2s ease;
}

h1, h2, h3 {
  font-family: "Roboto Slab", Georgia, serif;
  line-height: 1.2;
  text-wrap: balance;
}

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

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }

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

/* ---------- Navbar ---------- */
.navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--nav-h);
  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(--max);
  margin: 0 auto;
  height: 100%;
  padding: 0 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand {
  font-family: "Roboto Slab", serif;
  font-weight: 700;
  font-size: 1.02rem;
  color: var(--text);
}
.brand:hover { text-decoration: none; color: var(--accent); }
.nav-links {
  display: flex;
  align-items: center;
  gap: 1.35rem;
}
.nav-links a {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 500;
}
.nav-links a:hover { color: var(--accent); text-decoration: none; }
.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  font-size: 1.4rem;
  cursor: pointer;
}
.theme-toggle {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 34px;
  height: 34px;
  font-size: 0.95rem;
  cursor: pointer;
  transition: transform 0.15s ease;
}
.theme-toggle:hover { transform: scale(1.1); }

/* ---------- Hero ---------- */
.hero { padding: 3.5rem 0 2.5rem; border-bottom: 1px solid var(--border); }
.hero-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2.5rem;
  align-items: center;
}
.hero-text h1 { margin: 0 0 0.5rem; font-size: clamp(1.7rem, 4.5vw, 2.35rem); }
.role { margin: 0 0 0.15rem; font-size: 1.1rem; font-weight: 500; }
.affil { margin: 0; color: var(--muted); }
.affil-sub { margin: 0.15rem 0 1.25rem; color: var(--muted); font-size: 0.95rem; }
.social { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.social a {
  padding: 0.38rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  font-size: 0.88rem;
  font-weight: 500;
}
.social a:hover { text-decoration: none; border-color: var(--accent); color: var(--accent); }
.profile {
  width: 190px;
  height: 190px;
  border-radius: 50%;
  object-fit: cover;
  object-position: 50% 16%;
  border: 3px solid var(--border);
  box-shadow: var(--shadow);
}

/* ---------- Sections ---------- */
main { padding: 2.5rem 1.25rem 1rem; }
section { margin-bottom: 2.75rem; scroll-margin-top: calc(var(--nav-h) + 12px); }
section h2 {
  font-size: 1.45rem;
  margin: 0 0 1rem;
  padding-bottom: 0.4rem;
  border-bottom: 2px solid var(--accent);
  display: inline-block;
}
section p { margin: 0 0 1rem; }
section h3 { font-size: 1.02rem; margin: 1.2rem 0 0.5rem; color: var(--text); }
.section-note { color: var(--muted); font-size: 0.9rem; margin: -0.4rem 0 1.1rem; }

/* ---------- Research interest tags ---------- */
.tags { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 0.6rem; }
.tags li {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.4rem 0.9rem;
  font-size: 0.9rem;
}

/* ---------- News ---------- */
.news-list { list-style: none; padding: 0; margin: 0; }
.news-list li {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 1rem;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--border);
}
.news-list li:last-child { border-bottom: none; }
.news-date { color: var(--accent); font-weight: 600; font-size: 0.9rem; }
.news-body { color: var(--text); }

/* ---------- Publications ---------- */
.pub-list { list-style: none; padding: 0; margin: 0; counter-reset: pub; }
.pub {
  position: relative;
  padding: 0.9rem 0 0.9rem 2.2rem;
  border-bottom: 1px solid var(--border);
}
.pub:last-child { border-bottom: none; }
.pub::before {
  counter-increment: pub;
  content: counter(pub);
  position: absolute;
  left: 0;
  top: 0.9rem;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pub-title { display: block; font-weight: 500; }
.pub-authors { display: block; color: var(--muted); font-size: 0.9rem; margin-top: 0.1rem; }
.pub-venue { display: block; font-size: 0.9rem; font-style: italic; color: var(--muted); margin-top: 0.1rem; }
.pub-links { display: inline-flex; gap: 0.5rem; margin-top: 0.45rem; }
.pub-links a {
  font-size: 0.8rem;
  font-weight: 500;
  padding: 0.12rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 6px;
}
.pub-links a:hover { text-decoration: none; border-color: var(--accent); }

/* ---------- Experience timeline ---------- */
.timeline { display: flex; flex-direction: column; }
.tl-item { padding: 0.8rem 0; border-bottom: 1px solid var(--border); }
.tl-item:last-child { border-bottom: none; }
.tl-head { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.tl-role { font-weight: 600; }
.tl-date { color: var(--muted); font-size: 0.9rem; white-space: nowrap; }
.tl-org { display: block; color: var(--muted); font-size: 0.93rem; margin-top: 0.1rem; }

/* ---------- Awards ---------- */
.award-list { margin: 0; padding-left: 1.2rem; }
.award-list li { margin-bottom: 0.5rem; }

/* ---------- Skills ---------- */
.skills-grid { display: flex; flex-direction: column; gap: 0.7rem; }
.skill-row { display: grid; grid-template-columns: 190px 1fr; gap: 1rem; align-items: start; }
.skill-cat { font-weight: 600; color: var(--text); }

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

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
  .nav-toggle { display: block; }
  .nav-links {
    position: absolute;
    top: var(--nav-h);
    right: 0;
    left: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.2rem;
    padding: 0.5rem 1.25rem 1rem;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
    display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 0.4rem 0; }
  .theme-toggle { margin-top: 0.4rem; }

  .hero-grid { grid-template-columns: 1fr; text-align: center; }
  .profile { grid-row: 1; margin: 0 auto; width: 150px; height: 150px; }
  .social { justify-content: center; }

  .news-list li { grid-template-columns: 1fr; gap: 0.15rem; }
  .skill-row { grid-template-columns: 1fr; gap: 0.1rem; }
}
