/* ========================================
   Usama Ejaz — Academic Personal Website
   ======================================== */

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

:root {
  --bg: #fafafa;
  --card-bg: #ffffff;
  --text: #1c1c1c;
  --text-mid: #444;
  --text-light: #666;
  --accent: #0f4c75;
  --accent-hover: #1b6fa8;
  --border: #e2e2e2;
  --tag-bg: #edf3f8;
  --tag-text: #0f4c75;
  --award-bg: #fff8e1;
  --award-text: #7a5c00;
  --news-date: #0f4c75;
  --font-body: 'Source Sans 3', 'Helvetica Neue', sans-serif;
  --font-heading: 'Playfair Display', 'Georgia', serif;
  --max-w: 800px;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg);
  line-height: 1.72;
  -webkit-font-smoothing: antialiased;
  font-size: 17px;
}

a { color: var(--accent-hover); text-decoration: none; transition: color .15s; }
a:hover { color: var(--accent); text-decoration: underline; }
::selection { background: var(--accent); color: #fff; }

.wrap { max-width: var(--max-w); margin: 0 auto; padding: 0 28px; }

/* ---------- HEADER ---------- */
.header {
  padding: 56px 0 40px;
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  gap: 32px;
  align-items: flex-start;
}

.avatar img {
  width: 170px;
  height: 170px;
  border-radius: 5px;
  object-fit: cover;
  margin-top: 14px;
}

.header-body { flex: 1; }

.header-body h1 {
  font-family: var(--font-heading);
  font-size: 1.9rem;
  font-weight: 700;
  letter-spacing: -.01em;
  margin-bottom: 2px;
}

.header-body .subtitle {
  font-size: .97rem;
  color: var(--text-mid);
  margin-bottom: 14px;
  line-height: 1.55;
}

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 18px;
}

.links a {
  font-size: .82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--accent);
  padding-bottom: 1px;
  border-bottom: 1.5px solid transparent;
}
.links a:hover { border-bottom-color: var(--accent); text-decoration: none; }

.bio {
  font-size: 1rem;
  line-height: 1.75;
  color: var(--text);
}

/* ---------- NAV ---------- */
.topnav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
}
.topnav nav { display: flex; gap: 0; overflow-x: auto; }
.topnav a {
  padding: 13px 16px;
  font-size: .93rem;
  font-weight: 700;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: .06em;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: .15s;
}
.topnav a:hover { color: var(--accent); text-decoration: none; border-bottom-color: var(--accent-hover); }

/* ---------- SECTIONS ---------- */
.sec { padding: 44px 0 28px; }
.sec + .sec { border-top: 1px solid var(--border); }
.sec h2 {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 22px;
  letter-spacing: -.01em;
}

/* ---------- NEWS ---------- */
.news li {
  list-style: none;
  display: flex;
  gap: 14px;
  padding: 9px 0;
  font-size: .95rem;
  border-bottom: 1px solid #f0f0f0;
}
.news li:last-child { border: none; }
.news .nd {
  flex-shrink: 0;
  width: 80px;
  font-size: .82rem;
  font-weight: 700;
  color: var(--news-date);
  padding-top: 2px;
}

/* ---------- INTERESTS ---------- */
.tags { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 8px; }
.tags span {
  background: var(--tag-bg);
  color: var(--tag-text);
  font-size: .85rem;
  font-weight: 700;
  padding: 4px 13px;
  border-radius: 3px;
}

/* ---------- PUBLICATIONS ---------- */
.pubs { counter-reset: pc; list-style: none; }
.pub {
  counter-increment: pc;
  margin-bottom: 22px;
  padding-left: 32px;
  position: relative;
  line-height: 1.6;
}
.pub::before {
  content: counter(pc) ".";
  position: absolute;
  left: 0;
  font-size: .85rem;
  font-weight: 700;
  color: var(--accent);
}
.pub-t { font-weight: 700; font-size: 1rem; }
.pub-t a { color: var(--text); }
.pub-t a:hover { color: var(--accent-hover); }
.pub-a { font-size: .85rem; color: var(--text-mid); margin-top: 1px; }
.pub-a .me { font-weight: 700; color: var(--text); }
.pub-v { font-size: .9rem; color: var(--text-light); margin-top: 1px; }
.pub-v em { font-style: italic; }
.pub-note {
  font-size: .78rem; font-weight: 700;
  margin-top: 1px;
}
.award {
  display: inline-block;
  background: var(--award-bg);
  color: var(--award-text);
  padding: 1px 10px;
  border-radius: 3px;
  margin-top: 3px;
}
.cofirst {
  font-size: .78rem;
  color: var(--text-light);
  font-style: italic;
}
.pub-links { margin-top: 3px; }
.pub-links a {
  font-size: .92rem;
  font-weight: 700;
  margin-right: 10px;
  color: var(--accent-hover);
}
.pub-links a::before { content: '['; }
.pub-links a::after { content: ']'; }

.sub-h {
  font-size: 1rem;
  font-weight: 700;
  margin: 24px 0 10px;
  color: var(--text);
}

/* ---------- EDUCATION ---------- */
.edu { margin-bottom: 18px; }
.edu h3 { font-size: 1rem; font-weight: 700; margin-bottom: 1px; }
.edu .detail { font-size: .92rem; color: var(--text-mid); }

/* ---------- PROJECTS ---------- */
.proj { margin-bottom: 16px; }
.proj h3 { font-size: 1rem; font-weight: 700; margin-bottom: 2px; }
.proj p { font-size: .92rem; color: var(--text-mid); line-height: 1.55; }

/* ---------- LISTS ---------- */
.slist { list-style: none; }
.slist li {
  padding: 5px 0 5px 16px;
  font-size: .9rem;
  position: relative;
}
.slist li::before {
  content: '–';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 700;
}

/* ---------- CONTACT ---------- */
.contact p { font-size: 1rem; line-height: 2; }
.contact strong { display: inline-block; width: 70px; }

/* ---------- FOOTER ---------- */
footer {
  border-top: 1px solid var(--border);
  padding: 22px 0;
  margin-top: 16px;
  text-align: center;
  font-size: .78rem;
  color: var(--text-light);
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 640px) {
  .header-inner { flex-direction: column; align-items: center; text-align: center; }
  .links { justify-content: center; }
  .avatar img { width: 130px; height: 130px; }
  .header-body h1 { font-size: 1.5rem; }
  .topnav a { padding: 11px 10px; font-size: .74rem; }
  .pub { padding-left: 26px; }
  .sec { padding: 30px 0 20px; }
  .bio { text-align: left; }
  .news li { flex-direction: column; gap: 1px; }
  .news .nd { width: auto; }
}

@media print {
  .topnav { display: none; }
  .sec { page-break-inside: avoid; }
}