/* ============================================================
   Kazi Samin Mubasshir — personal academic site
   Palette: ink navy / signal teal / paper
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=Inter:wght@400;500;600&family=IBM+Plex+Mono:wght@400;500&display=swap');

:root {
  --ink: #0d1b2a;          /* deep navy — headers, footer */
  --ink-2: #14283d;        /* slightly lighter navy */
  --teal: #1f9e93;         /* signal teal accent */
  --teal-dim: #157a72;
  --paper: #fafbfc;        /* page background */
  --card: #ffffff;
  --text: #21303f;
  --muted: #5c6b7a;
  --line: #dde4ea;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
  --display: 'Space Grotesk', system-ui, sans-serif;
  --body: 'Inter', system-ui, sans-serif;
}

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

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation: none !important; transition: none !important; }
}

body {
  font-family: var(--body);
  background: var(--paper);
  color: var(--text);
  line-height: 1.65;
  font-size: 16.5px;
}

/* ---------- Header / nav ---------- */
header {
  background: var(--ink);
  background-image:
    radial-gradient(ellipse 90% 140% at 85% -40%, rgba(31,158,147,0.28), transparent 60%),
    radial-gradient(ellipse 60% 100% at 10% 120%, rgba(31,158,147,0.12), transparent 55%);
  color: #eaf1f5;
  border-bottom: 3px solid var(--teal);
}

.nav-wrap {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 64px;
}

.brand {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: 0.01em;
  color: #fff;
  text-decoration: none;
  padding: 14px 0;
}
.brand span { color: var(--teal); }

nav ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
}
nav a {
  display: block;
  padding: 20px 13px;
  color: #c3d2dc;
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
  border-bottom: 3px solid transparent;
  margin-bottom: -3px;
  transition: color .15s, border-color .15s;
}
nav a:hover { color: #fff; }
nav a.active { color: #fff; border-bottom-color: var(--teal); }
nav a:focus-visible, .brand:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
}

/* ---------- Page shell ---------- */
main {
  max-width: 960px;
  margin: 0 auto;
  padding: 48px 24px 80px;
}

.eyebrow {
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--teal-dim);
  margin-bottom: 8px;
}

h1 {
  font-family: var(--display);
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  font-weight: 700;
  color: var(--ink);
  line-height: 1.15;
  margin-bottom: 20px;
}

h2 {
  font-family: var(--display);
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--ink);
  margin: 44px 0 14px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--line);
}
h2:first-of-type { margin-top: 28px; }

h3 {
  font-family: var(--display);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--ink-2);
  margin: 26px 0 8px;
}

p { margin-bottom: 14px; }
p:last-child { margin-bottom: 0; }

a { color: var(--teal-dim); text-decoration: none; border-bottom: 1px solid rgba(31,158,147,.35); }
a:hover { color: var(--teal); border-bottom-color: var(--teal); }
a:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }

ul.plain { list-style: none; }
main ul:not(.plain) { padding-left: 22px; margin-bottom: 14px; }
main li { margin-bottom: 7px; }

/* ---------- Hero (home) ---------- */
.hero {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 36px;
  align-items: start;
  margin-bottom: 8px;
}
.hero img.portrait {
  width: 200px;
  height: 200px;
  object-fit: cover;
  border-radius: 12px;
  border: 3px solid var(--ink);
  box-shadow: 6px 6px 0 var(--teal);
}
.hero .roles { margin-top: 14px; }

.role-card {
  border-left: 3px solid var(--teal);
  background: var(--card);
  border-radius: 0 8px 8px 0;
  padding: 12px 16px;
  margin-bottom: 12px;
  box-shadow: 0 1px 3px rgba(13,27,42,.06);
  transition: box-shadow .15s, transform .15s;
}
.role-card:hover { box-shadow: 0 3px 10px rgba(13,27,42,.12); transform: translateY(-1px); }
.role-card .org {
  font-family: var(--display);
  font-weight: 600;
  color: var(--ink);
}
.role-card .detail { color: var(--muted); font-size: 0.93rem; }

.social {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  flex-wrap: wrap;
}
.social a {
  font-family: var(--mono);
  font-size: 0.78rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px 12px;
  color: var(--ink-2);
  background: var(--card);
  transition: border-color .15s, color .15s;
}
.social a:hover { border-color: var(--teal); color: var(--teal-dim); }

/* ---------- News list ---------- */
.news { list-style: none; }
.news li {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 14px;
  padding: 9px 0;
  border-bottom: 1px dashed var(--line);
}
.news .date {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--teal-dim);
  white-space: nowrap;
  padding-top: 3px;
}

/* Collapsible year groups (home page) */
.news-group {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  margin-bottom: 12px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(13,27,42,.06);
}
.news-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 11px 18px;
  background: #f0f5f4;
  border: none;
  border-left: 3px solid var(--teal);
  cursor: pointer;
  text-align: left;
  transition: background .15s;
}
.news-toggle:hover { background: #e4efec; }
.news-toggle:focus-visible { outline: 2px solid var(--teal); outline-offset: -2px; }
.news-year {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--ink);
}
.news-count {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--teal-dim);
  background: var(--card);
  border: 1px solid #b9dfda;
  border-radius: 999px;
  padding: 1px 10px;
  white-space: nowrap;
}
.news-toggle .chev { margin-left: auto; }
.news-toggle .chev::before {
  content: '▾';
  display: inline-block;
  color: var(--teal-dim);
  transition: transform .15s;
}
.news-group.collapsed .chev::before { transform: rotate(-90deg); }
.news-group.collapsed .news { display: none; }
.news-group .news { padding: 4px 18px 10px; }
.news-group .news li:last-child { border-bottom: none; }

/* ---------- Publications ---------- */
.pub-list { list-style: none; counter-reset: pub; }
.pub-list li {
  counter-increment: pub;
  position: relative;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 18px 20px 18px 62px;
  margin-bottom: 14px;
}
.pub-list li::before {
  content: counter(pub, decimal-leading-zero);
  position: absolute;
  left: 18px;
  top: 18px;
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--teal);
  font-weight: 500;
}
.pub-list .venue {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-2);
  background: #eef4f3;
  border: 1px solid #d5e5e2;
  border-radius: 4px;
  padding: 2px 8px;
  margin-top: 8px;
}
.pub-list strong.me { color: var(--ink); }

/* ---------- Generic cards / service lists ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 18px 22px;
  margin-bottom: 16px;
}
.card .meta { color: var(--muted); font-size: 0.93rem; }

.cards-2col {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  align-items: start;
}
.cards-2col .card { margin-bottom: 0; }

/* ---------- CV page ---------- */
.cv-frame {
  width: 100%;
  height: 78vh;
  border: 1px solid var(--line);
  border-radius: 10px;
  margin-top: 18px;
  background: var(--card);
}
.btn {
  display: inline-block;
  font-family: var(--display);
  font-weight: 600;
  font-size: 0.95rem;
  color: #fff;
  background: var(--ink);
  border: none;
  border-bottom: 3px solid var(--teal);
  border-radius: 8px;
  padding: 10px 20px;
  margin-top: 6px;
}
.btn:hover { background: var(--ink-2); color: #fff; }

/* ---------- Academic services (boxed grid) ---------- */
.svc-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-top: 26px;
}
.svc-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(13,27,42,.06);
}
.svc-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  padding: 12px 20px;
  background: #24405c;
  background-image: radial-gradient(ellipse 90% 160% at 85% -40%, rgba(31,158,147,0.25), transparent 60%);
  border-bottom: 3px solid var(--teal);
}
.svc-head .svc-role {
  margin: 0;
  padding: 0;
  border: none;
  font-size: 1.05rem;
  color: #fff;
}
.svc-count {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: #9fe0d9;
  background: rgba(31,158,147,0.18);
  border: 1px solid rgba(31,158,147,0.55);
  border-radius: 999px;
  padding: 2px 10px;
  white-space: nowrap;
}
.svc-items { list-style: none; padding: 8px 20px 14px; }
.svc-items li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 14px;
  padding: 8px 0;
  margin: 0;
  border-bottom: 1px dashed var(--line);
}
.svc-items li:last-child { border-bottom: none; padding-bottom: 2px; }
.svc-name { font-size: 0.92rem; }
.svc-years {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--teal-dim);
  white-space: nowrap;
}

/* ---------- Footer ---------- */
footer {
  background: var(--ink);
  color: #8fa3b3;
  border-top: 3px solid var(--teal);
  font-size: 0.85rem;
}
.foot-wrap {
  max-width: 960px;
  margin: 0 auto;
  padding: 26px 24px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}
footer a { color: #c3d2dc; border-bottom-color: rgba(195,210,220,.3); }
footer a:hover { color: #fff; }

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
  .hero { grid-template-columns: 1fr; }
  .hero img.portrait { width: 160px; height: 160px; }
  nav a { padding: 12px 10px; }
  .news li { grid-template-columns: 1fr; gap: 2px; }
}


/* ============================================================
   Publications — scholar-profile layout, light theme
   ============================================================ */
.pub-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 6px 0 30px;
}
.pub-stats .stat {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 16px;
  min-width: 110px;
  box-shadow: 0 1px 3px rgba(13,27,42,.05);
}
.pub-stats .num {
  font-family: var(--display);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.2;
}
.pub-stats .lbl {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.pub-stats .note {
  flex-basis: 100%;
  font-size: 0.78rem;
  color: var(--muted);
}

.pub-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 18px;
}
.filter-btn {
  font-family: var(--mono);
  font-size: 0.74rem;
  color: var(--ink-2);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 14px;
  cursor: pointer;
  transition: border-color .15s, color .15s, background .15s;
}
.filter-btn:hover { border-color: var(--teal); color: var(--teal-dim); }
.filter-btn:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
.filter-btn.is-active {
  color: #fff;
  background: var(--teal-dim);
  border-color: var(--teal-dim);
}

.pub-empty { padding: 24px 18px; color: var(--muted); font-style: italic; }

.pub-table-head {
  display: grid;
  grid-template-columns: 1fr 84px 64px;
  gap: 16px;
  padding: 8px 20px;
  margin-bottom: 14px;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 2px solid var(--line);
}

.pub-table-head .sort-btn {
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  color: inherit;
  background: none;
  border: none;
  padding: 0;
  text-align: right;
  cursor: pointer;
  transition: color .15s;
}
.pub-table-head .sort-btn:hover { color: var(--teal-dim); }
.pub-table-head .sort-btn:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
.pub-table-head .sort-btn.is-active { color: var(--teal-dim); font-weight: 500; }
.pub-table-head .sort-btn .arrow::before { content: '↕'; opacity: .45; }
.pub-table-head .sort-btn.desc .arrow::before { content: '↓'; opacity: 1; }
.pub-table-head .sort-btn.asc .arrow::before { content: '↑'; opacity: 1; }

.pub-row {
  display: grid;
  grid-template-columns: 1fr 84px 64px;
  gap: 16px;
  padding: 18px 20px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  margin-bottom: 14px;
  box-shadow: 0 1px 3px rgba(13,27,42,.06);
  align-items: start;
  transition: border-color .15s, box-shadow .15s;
}
.pub-row:hover { border-color: var(--teal); box-shadow: 0 2px 8px rgba(13,27,42,.10); }

.pub-row .title {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.02rem;
  color: var(--ink);
  margin-bottom: 5px;
}
.pub-row .title a { color: var(--ink); border-bottom: 1px solid transparent; }
.pub-row .title a:hover { color: var(--teal-dim); border-bottom-color: var(--teal); }

.pub-row .authors { font-size: 0.88rem; color: var(--muted); margin-bottom: 3px; }
.pub-row .authors .me {
  color: #fff;
  background: var(--teal-dim);
  border-radius: 4px;
  padding: 0 5px;
  font-weight: 600;
}
.pub-row .venue-line { font-size: 0.85rem; color: var(--muted); font-style: italic; margin-bottom: 10px; }

.badges { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.badge {
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.05em;
  border-radius: 4px;
  padding: 2px 8px;
  border: 1px solid;
}
.badge.rank  { color: #8a6100; border-color: #e3c980; background: #fdf6e3; }
.badge.era   { color: #1d5d8f; border-color: #a9cbe6; background: #eaf3fa; }
.badge.type  { color: #5a4494; border-color: #c4b5ec; background: #f3effc; }
.badge.topic { color: var(--teal-dim); border-color: #b9dfda; background: #edf7f5; }

.res { display: flex; flex-wrap: wrap; gap: 8px; }
.res a {
  font-family: var(--mono);
  font-size: 0.74rem;
  color: var(--ink-2);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 4px 12px;
  transition: border-color .15s, color .15s;
}
.res a:hover { border-color: var(--teal); color: var(--teal-dim); }

.pub-row .cited {
  font-family: var(--mono);
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--teal-dim);
  text-align: right;
  padding-top: 2px;
}
.pub-row .cited small { display:block; font-size: 0.62rem; color: var(--muted); letter-spacing: 0.08em; }
.pub-row .year {
  font-family: var(--mono);
  font-size: 0.92rem;
  color: var(--muted);
  text-align: right;
  padding-top: 2px;
}

@media (max-width: 640px) {
  .pub-table-head { display: flex; justify-content: flex-end; gap: 18px; }
  .pub-table-head > span { display: none; }
  .pub-row { grid-template-columns: 1fr; gap: 8px; }
  .pub-row .cited, .pub-row .year { text-align: left; }
}
