/* ============================================================
   Shams Mehdi — academic website
   Clean academic minimal: serif body, sans nav, muted-blue accent
   ============================================================ */

:root {
  --accent:        #2a5db0;
  --accent-dark:   #1e4488;
  --text:          #1c1e22;
  --text-soft:     #4a4f57;
  --text-faint:    #7b828c;
  --bg:            #ffffff;
  --bg-soft:       #f6f7f9;
  --border:        #e6e8ec;
  --maxw:          760px;
  --radius:        10px;
  --serif:  "Charter", "Georgia", "Times New Roman", serif;
  --sans:   "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
html, body { overflow-x: hidden; }
img { max-width: 100%; height: auto; }

body {
  margin: 0;
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ---------- Layout ---------- */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 22px; }

main { padding: 44px 0 60px; }

section { margin-bottom: 46px; }

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,0.88);
  backdrop-filter: saturate(180%) blur(10px);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.nav {
  display: flex; align-items: center; justify-content: space-between;
  max-width: var(--maxw); margin: 0 auto; padding: 12px 22px;
  font-family: var(--sans);
}
.nav__brand {
  font-weight: 700; font-size: 1.05rem; letter-spacing: -0.01em;
  color: var(--text); text-decoration: none; white-space: nowrap;
}
.nav__brand span { color: var(--accent); }
.nav__links { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }
.nav__links a {
  font-size: 0.9rem; font-weight: 500; color: var(--text-soft);
  text-decoration: none; padding: 6px 10px; border-radius: 7px;
  transition: color .15s, background .15s;
}
.nav__links a:hover { color: var(--accent); background: var(--bg-soft); }
.nav__links a.active { color: var(--accent); font-weight: 600; }

.nav__toggle {
  display: none; background: none; border: 0; cursor: pointer;
  padding: 6px; color: var(--text); font-size: 1.4rem; line-height: 1;
}

/* ---------- Typography ---------- */
h1,h2,h3 { font-family: var(--sans); line-height: 1.25; letter-spacing: -0.02em; color: var(--text); }
h1 { font-size: 2.1rem; margin: 0 0 .25em; }
h2 { font-size: 1.45rem; margin: 0 0 .7em; padding-bottom: .3em; border-bottom: 1px solid var(--border); }
h3 { font-size: 1.15rem; margin: 0 0 .4em; }
p  { margin: 0 0 1em; }
a  { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.lead { font-size: 1.12rem; color: var(--text-soft); }
.eyebrow { font-family: var(--sans); font-size: .78rem; font-weight: 600;
  letter-spacing: .09em; text-transform: uppercase; color: var(--accent); margin-bottom: .5em; }

/* ---------- Home hero ---------- */
.hero { display: flex; gap: 30px; align-items: center; margin: 8px 0 40px; }
.hero__photo {
  flex: 0 0 auto; width: 168px; height: 168px; border-radius: 50%;
  object-fit: cover; border: 4px solid #fff;
  box-shadow: 0 6px 24px rgba(20,30,60,.16); background: var(--bg-soft);
}
.hero__body h1 { margin-bottom: .1em; }
.hero__title { font-family: var(--sans); font-size: 1.02rem; font-weight: 600;
  color: var(--accent); margin: 0 0 .7em; }
.hero__title small { display:block; font-weight:500; color: var(--text-faint); font-size:.86rem; margin-top:2px;}

/* ---------- Icon links row ---------- */
.iconlinks { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.iconlinks a {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--sans); font-size: .86rem; font-weight: 500;
  color: var(--text-soft); text-decoration: none;
  padding: 7px 13px; border: 1px solid var(--border); border-radius: 999px;
  transition: all .15s; background:#fff;
}
.iconlinks a:hover { border-color: var(--accent); color: var(--accent); box-shadow: 0 2px 8px rgba(42,93,176,.12); }
.iconlinks svg { width: 16px; height: 16px; fill: currentColor; }

.hero-banner {
  width: 100%; height: 150px; object-fit: cover;
  border-radius: var(--radius); margin: 6px 0 36px;
  box-shadow: 0 4px 18px rgba(20,30,60,.14);
}

/* ---------- Publications ---------- */
.pub-year { font-family: var(--sans); font-size: 1.05rem; font-weight: 700;
  color: var(--accent); margin: 30px 0 12px; padding-bottom: 4px; border-bottom: 2px solid var(--bg-soft); }
.pub {
  display: flex; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--border);
}
.pub:last-child { border-bottom: 0; }
.pub__num { flex: 0 0 auto; font-family: var(--sans); font-size: .8rem; font-weight: 600;
  color: #fff; background: var(--accent); border-radius: 6px; width: 26px; height: 26px;
  display: flex; align-items: center; justify-content: center; margin-top: 4px; }
.pub__body { flex: 1 1 auto; }
.pub__title { font-weight: 600; color: var(--text); font-size: 1.02rem; line-height: 1.35; }
.pub__authors { font-size: .92rem; color: var(--text-soft); margin: 2px 0; }
.pub__authors .me { color: var(--text); font-weight: 700; }
.pub__venue { font-size: .9rem; color: var(--text-faint); font-style: italic; }
.pub__venue .featured { font-style: normal; font-family: var(--sans); font-size:.72rem;
  font-weight:600; color:#8a6d00; background:#fff5d6; padding:1px 7px; border-radius:4px; margin-left:6px;}
.pub__links { margin-top: 5px; }
.pub__links a { font-family: var(--sans); font-size: .78rem; font-weight: 600; margin-right: 10px; }

/* ---------- Projects ---------- */
.project {
  display: flex; gap: 22px; padding: 26px 0; border-bottom: 1px solid var(--border); align-items: flex-start;
}
.project:last-child { border-bottom: 0; }
.project__media { flex: 0 0 210px; display:flex; flex-direction:column; gap:10px; }
.project__media img {
  width: 100%; border-radius: 8px; background: var(--bg-soft);
  border: 1px solid var(--border); box-shadow: 0 2px 10px rgba(20,30,60,.08);
}
.project__body { flex: 1 1 auto; }
.project__body h3 { margin-bottom:.35em; }
.project__body p { font-size: .98rem; color: var(--text-soft); margin-bottom:.7em; }
.tag { display:inline-block; font-family:var(--sans); font-size:.72rem; font-weight:600;
  color: var(--accent); background: var(--bg-soft); border:1px solid var(--border);
  padding: 2px 9px; border-radius: 999px; margin: 0 6px 6px 0; }

/* ---------- News ---------- */
.news-item {
  display: flex; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--border);
}
.news-item:last-child { border-bottom: 0; }
.news-item__date {
  flex: 0 0 118px; font-family: var(--sans); font-size: .82rem; font-weight: 600;
  color: var(--accent); padding-top: 2px;
}
.news-item__text { flex: 1 1 auto; color: var(--text-soft); }

/* ---------- Bio ---------- */
.journey { width: 100%; border-radius: var(--radius); border: 1px solid var(--border);
  margin: 18px 0 30px; box-shadow: 0 4px 18px rgba(20,30,60,.08); }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li {
  display: flex; gap: 18px; align-items: center;
  padding: 16px 0; border-bottom: 1px solid var(--border);
}
.timeline li:last-child { border-bottom: 0; }
.timeline__logo {
  flex: 0 0 62px; width: 62px; height: 62px; object-fit: contain;
  background:#fff; border:1px solid var(--border); border-radius: 10px; padding:6px;
}
.timeline__meta h3 { margin: 0 0 2px; font-size: 1.05rem; }
.timeline__meta .where { font-size:.95rem; color: var(--text-soft); }
.timeline__meta .when { font-family: var(--sans); font-size:.8rem; font-weight:600; color: var(--text-faint); }

/* ---------- CV ---------- */
.cv-btn {
  display:inline-flex; align-items:center; gap:8px; font-family:var(--sans); font-weight:600;
  font-size:.92rem; color:#fff; background:var(--accent); padding:10px 18px; border-radius:8px;
  text-decoration:none; box-shadow:0 2px 10px rgba(42,93,176,.28); transition:background .15s;
}
.cv-btn:hover { background:var(--accent-dark); text-decoration:none; }
.cv-block { margin-bottom: 30px; }
.cv-entry { padding: 10px 0; border-bottom: 1px dotted var(--border); }
.cv-entry:last-child { border-bottom: 0; }
.cv-entry .role { font-weight: 700; }
.cv-entry .org  { color: var(--text-soft); }
.cv-entry .date { float: right; font-family: var(--sans); font-size: .82rem; font-weight:600; color: var(--text-faint); }
.cv-entry .note { font-size:.92rem; color: var(--text-soft); margin-top:3px; }
.cv-list { padding-left: 1.1em; margin:.3em 0; }
.cv-list li { margin-bottom:.35em; color: var(--text-soft); font-size:.96rem; }

/* ---------- Contact ---------- */
.contact-card {
  background: var(--bg-soft); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 26px 28px; margin-bottom: 26px;
}
.contact-card p { margin: 0 0 .4em; }
.contact-card .addr { color: var(--text-soft); }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border); padding: 26px 0; margin-top: 40px;
  font-family: var(--sans); font-size: .82rem; color: var(--text-faint);
}
.site-footer .wrap { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.site-footer a { color: var(--text-faint); }
.site-footer a:hover { color: var(--accent); }

/* ---------- Responsive ---------- */
@media (max-width: 620px) {
  body { font-size: 17px; }
  .nav__toggle { display: block; }
  .nav__links {
    display: none; position: absolute; top: 100%; right: 0; left: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: #fff; border-bottom: 1px solid var(--border); padding: 6px 14px 12px;
  }
  .nav__links.open { display: flex; }
  .nav__links a { padding: 10px 8px; border-radius: 0; }
  .hero { flex-direction: column; text-align: center; gap: 18px; }
  .hero__photo { width: 132px; height: 132px; }
  .hero__body { min-width: 0; }
  h1 { font-size: 1.8rem; word-break: break-word; }
  .iconlinks { justify-content: center; }
  .project { flex-direction: column; }
  .project__media { flex-basis: auto; width: 100%; max-width: 320px; }
  .news-item { flex-direction: column; gap: 2px; }
  .news-item__date { flex-basis: auto; }
  .cv-entry .date { float: none; display:block; }
}
