/* ============================================================
   Mohammed Lab — design system
   Fonts: Source Serif 4 (display) · Source Sans 3 (body) · IBM Plex Mono (labels)
   ============================================================ */

:root {
  --ink: #0a0f1e;
  --ink-2: #10182f;
  --ink-3: #1a2440;
  --paper: #f7f6f2;
  --card: #ffffff;
  --text: #1c2436;
  --muted: #5c6578;
  --line: #e4e1d8;
  --teal: #0a6f66;
  --teal-bright: #2dd4bf;
  --violet: #7c6cf0;
  --violet-deep: #6052d6;
  --violet-bright: #a78bfa;
  --rose: #f472b6;
  --grad: linear-gradient(96deg, var(--teal-bright), var(--violet-bright));
  --radius: 18px;
  --shadow-sm: 0 1px 2px rgba(10, 15, 30, 0.05), 0 2px 10px rgba(10, 15, 30, 0.04);
  --shadow-md: 0 2px 6px rgba(10, 15, 30, 0.06), 0 14px 36px rgba(10, 15, 30, 0.09);
  --font-display: "Source Serif 4", Georgia, serif;
  --font-body: "Source Sans 3", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", monospace;
}

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

html { scroll-behavior: smooth; scroll-padding-top: 92px; }

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

::selection { background: rgba(45, 212, 191, 0.3); }

img { max-width: 100%; display: block; }
a { color: var(--teal); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

.container { max-width: 1140px; margin: 0 auto; padding: 0 28px; }
.container--narrow { max-width: 880px; }

/* ---------- typography ---------- */

h1, h2, h3 { font-family: var(--font-display); font-weight: 600; line-height: 1.12; letter-spacing: -0.015em; color: var(--ink); }

em { font-family: var(--font-display); font-style: italic; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--teal);
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}
.eyebrow::before { content: ""; width: 34px; height: 1.5px; background: var(--grad); flex: none; }

.section-title { font-size: clamp(30px, 4.2vw, 44px); margin-bottom: 16px; }
.section-lede { font-size: 18.5px; color: var(--muted); max-width: 640px; }

/* ---------- nav ---------- */

.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  background: rgba(10, 15, 30, 0.78);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  transition: background 0.3s ease;
}
.nav--light {
  background: rgba(247, 246, 242, 0.82);
  border-bottom: 1px solid var(--line);
}

.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 72px; }

.brand { display: flex; align-items: center; gap: 12px; text-decoration: none !important; }
.brand-mark { width: 34px; height: 34px; flex: none; }
.brand-name { font-family: var(--font-display); font-size: 19px; font-weight: 600; color: #fff; letter-spacing: 0.01em; }
.brand-name span { color: var(--teal-bright); }
.nav--light .brand-name { color: var(--ink); }
.nav--light .brand-name span { color: var(--teal); }

.nav-links { display: flex; align-items: center; gap: 6px; list-style: none; }
.nav-links a {
  display: block;
  padding: 9px 15px;
  font-size: 14.5px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.75);
  border-radius: 99px;
  text-decoration: none !important;
  transition: color 0.18s, background 0.18s;
}
.nav-links a:hover { color: #fff; background: rgba(255, 255, 255, 0.08); }
.nav-links a.active { color: var(--teal-bright); }
.nav--light .nav-links a { color: var(--muted); }
.nav--light .nav-links a:hover { color: var(--ink); background: rgba(10, 15, 30, 0.05); }
.nav--light .nav-links a.active { color: var(--teal); }

.nav-links a.nav-cta {
  margin-left: 10px;
  color: var(--ink) !important;
  background: var(--grad) !important;
  font-weight: 600;
}
.nav-links a.nav-cta:hover { filter: brightness(1.07); }

.nav-toggle {
  display: none;
  background: none;
  border: 0;
  width: 44px;
  height: 44px;
  cursor: pointer;
  color: #fff;
}
.nav--light .nav-toggle { color: var(--ink); }

@media (max-width: 820px) {
  .nav-toggle { display: grid; place-items: center; }
  .nav-links {
    position: absolute;
    top: 72px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 14px 20px 22px;
    background: rgba(10, 15, 30, 0.97);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: none;
  }
  .nav--light .nav-links { background: rgba(247, 246, 242, 0.98); border-bottom: 1px solid var(--line); }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 13px 16px; font-size: 16px; }
  .nav-links a.nav-cta { margin: 10px 0 0; text-align: center; }
}

/* ---------- hero (dark) ---------- */

.hero {
  position: relative;
  background: var(--ink);
  color: #fff;
  overflow: hidden;
}
.hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 140px;
  background: linear-gradient(to bottom, transparent, var(--ink));
  pointer-events: none;
}
.hero--home::after { background: linear-gradient(to bottom, transparent, rgba(10,15,30,0.4)); }

.hero-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }

.hero-glow {
  position: absolute;
  width: 720px;
  height: 720px;
  border-radius: 50%;
  filter: blur(130px);
  opacity: 0.22;
  pointer-events: none;
}
.hero-glow--teal { background: var(--teal-bright); top: -280px; right: -160px; }
.hero-glow--violet { background: var(--violet); bottom: -340px; left: -200px; }

.hero-inner {
  position: relative;
  z-index: 2;
  padding: 196px 28px 150px;
}
.hero--sub .hero-inner { padding: 168px 28px 96px; }

.hero .eyebrow { color: var(--teal-bright); }

.hero h1 {
  color: #fff;
  font-size: clamp(40px, 6.4vw, 76px);
  max-width: 17ch;
  margin-bottom: 26px;
}
.hero--sub h1 { font-size: clamp(36px, 5vw, 58px); }

.hero h1 em {
  font-style: italic;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.hero-sub {
  font-size: 19px;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.66);
  max-width: 600px;
  margin-bottom: 40px;
}

.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; }

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 14px 28px;
  border-radius: 99px;
  font-size: 15.5px;
  font-weight: 600;
  font-family: var(--font-body);
  cursor: pointer;
  border: 0;
  text-decoration: none !important;
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}
.btn svg { width: 17px; height: 17px; flex: none; }
.btn:hover { transform: translateY(-2px); }

.btn--primary { background: var(--grad); color: var(--ink); box-shadow: 0 8px 28px rgba(45, 212, 191, 0.28); }
.btn--primary:hover { filter: brightness(1.06); }

.btn--ghost { background: rgba(255, 255, 255, 0.07); color: #fff; border: 1px solid rgba(255, 255, 255, 0.22); }
.btn--ghost:hover { background: rgba(255, 255, 255, 0.13); }

.btn--dark { background: var(--ink); color: #fff; }
.btn--dark:hover { background: var(--ink-3); }

.btn--outline { background: transparent; color: var(--ink); border: 1.5px solid var(--ink); }
.btn--outline:hover { background: var(--ink); color: #fff; }

/* ---------- stats band ---------- */

.stats {
  position: relative;
  z-index: 3;
  margin-top: -64px;
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}
.stat {
  padding: 30px 26px;
  border-left: 1px solid var(--line);
}
.stat:first-child { border-left: 0; }
.stat-num {
  font-family: var(--font-display);
  font-size: 38px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.1;
}
.stat-num span { color: var(--teal); }
.stat-label { font-size: 13.5px; color: var(--muted); margin-top: 5px; }

@media (max-width: 820px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .stat:nth-child(odd) { border-left: 0; }
  .stat:nth-child(n + 3) { border-top: 1px solid var(--line); }
}

/* ---------- sections ---------- */

.section { padding: 104px 0; }
.section--tight { padding: 84px 0; }
.section-head { margin-bottom: 56px; }

.section--dark { background: var(--ink); color: rgba(255, 255, 255, 0.72); }
.section--dark h2, .section--dark h3 { color: #fff; }
.section--dark .eyebrow { color: var(--teal-bright); }
.section--dark .section-lede { color: rgba(255, 255, 255, 0.6); }

/* ---------- research area cards ---------- */

.areas { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; }
@media (max-width: 820px) { .areas { grid-template-columns: 1fr; } }

.area-card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 38px 36px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  overflow: hidden;
}
.area-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.area-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--grad);
}
.area-num {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.18em;
  color: var(--violet-deep);
  margin-bottom: 16px;
  display: block;
}
.area-card h3 { font-size: 24px; margin-bottom: 14px; }
.area-card p { color: var(--muted); font-size: 15.5px; }
.area-refs { margin-top: 22px; padding-top: 18px; border-top: 1px dashed var(--line); font-size: 14px; color: var(--muted); }
.area-refs a { font-weight: 500; }

/* ---------- technology cards ---------- */

.tech-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
@media (max-width: 940px) { .tech-grid { grid-template-columns: 1fr; } }

.tech-card {
  background: var(--ink-2);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: var(--radius);
  padding: 34px 30px;
  transition: transform 0.25s ease, border-color 0.25s ease;
}
.tech-card:hover { transform: translateY(-4px); border-color: rgba(45, 212, 191, 0.45); }
.tech-abbr {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--ink);
  background: var(--grad);
  padding: 5px 13px;
  border-radius: 99px;
  margin-bottom: 18px;
}
.tech-card h3 { font-size: 19.5px; color: #fff; margin-bottom: 10px; line-height: 1.35; }
.tech-card p { font-size: 14.5px; color: rgba(255, 255, 255, 0.58); }
.tech-card .tech-link { display: inline-flex; align-items: center; gap: 7px; margin-top: 18px; font-size: 14px; font-weight: 600; color: var(--teal-bright); }
.tech-card .tech-link svg { width: 14px; height: 14px; transition: transform 0.18s; }
.tech-card .tech-link:hover svg { transform: translateX(3px); }

/* ---------- featured publications (home) ---------- */

.featured-pubs { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
@media (max-width: 820px) { .featured-pubs { grid-template-columns: 1fr; } }

.fpub {
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 30px 30px 26px;
  box-shadow: var(--shadow-sm);
  text-decoration: none !important;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.fpub:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.fpub-meta { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.fpub-journal {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--teal);
  background: rgba(13, 148, 136, 0.09);
  border: 1px solid rgba(13, 148, 136, 0.22);
  padding: 4px 11px;
  border-radius: 99px;
}
.fpub-year { font-family: var(--font-mono); font-size: 12.5px; color: var(--muted); }
.fpub h3 { font-size: 19px; line-height: 1.4; margin-bottom: 10px; }
.fpub p { font-size: 14px; color: var(--muted); margin-top: auto; }

/* ---------- team ---------- */

.team-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 26px; }
@media (max-width: 880px) {
  .team-grid { grid-template-columns: 1fr; }
  .member-top { align-items: flex-start; }
}

.member {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 34px 32px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.member:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }

.member-top { display: flex; align-items: center; gap: 20px; margin-bottom: 18px; }
.member-photo {
  width: 92px;
  height: 92px;
  flex: none;
  border-radius: 50%;
  object-fit: cover;
  background: #e9e6dd;
  border: 3px solid #fff;
  outline: 2.5px solid transparent;
  outline-offset: 2px;
  transition: outline-color 0.25s ease;
}
.member:hover .member-photo { outline-color: var(--teal-bright); }
.member-name { font-size: 21px; margin-bottom: 3px; }
.member-role { font-size: 13.5px; color: var(--teal); font-weight: 600; letter-spacing: 0.015em; }

.member-bio { font-size: 14.8px; color: var(--muted); }
.member-bio.clamped {
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.bio-toggle {
  margin-top: 10px;
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--violet-deep);
  cursor: pointer;
}
.bio-toggle:hover { text-decoration: underline; text-underline-offset: 3px; }

.member-links { display: flex; gap: 8px; margin-top: 18px; }
.member-links a {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--line);
  color: var(--muted);
  transition: color 0.18s, border-color 0.18s, background 0.18s, transform 0.18s;
}
.member-links a:hover { color: var(--teal); border-color: var(--teal); background: rgba(13, 148, 136, 0.06); transform: translateY(-2px); }
.member-links svg { width: 16px; height: 16px; }

.alumni-note { font-size: 14px; color: var(--muted); font-style: italic; margin-top: -34px; margin-bottom: 46px; }

/* ---------- publications page ---------- */

.pub-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  margin-bottom: 46px;
}
.pub-search {
  flex: 1;
  min-width: 240px;
  position: relative;
}
.pub-search svg {
  position: absolute;
  left: 17px;
  top: 50%;
  translate: 0 -50%;
  width: 17px;
  height: 17px;
  color: var(--muted);
  pointer-events: none;
}
.pub-search input {
  width: 100%;
  padding: 14px 20px 14px 46px;
  font: inherit;
  font-size: 15.5px;
  color: var(--text);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 99px;
  outline: none;
  transition: border-color 0.18s, box-shadow 0.18s;
}
.pub-search input:focus { border-color: var(--teal); box-shadow: 0 0 0 3.5px rgba(13, 148, 136, 0.14); }

.year-jump { display: flex; flex-wrap: wrap; gap: 7px; }
.year-jump a {
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--muted);
  border: 1px solid var(--line);
  background: var(--card);
  padding: 6px 12px;
  border-radius: 99px;
  text-decoration: none !important;
  transition: all 0.16s;
}
.year-jump a:hover { color: var(--teal); border-color: var(--teal); }

.pub-year-group { margin-bottom: 54px; }
.pub-year-head {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 24px;
}
.pub-year-head h2 {
  font-size: 30px;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
.pub-year-head::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.pub {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 24px 28px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.pub:hover { transform: translateX(4px); border-color: rgba(13, 148, 136, 0.4); box-shadow: var(--shadow-md); }
.pub-title { font-family: var(--font-body); font-size: 16.5px; font-weight: 650; color: var(--ink); line-height: 1.45; margin-bottom: 8px; }
.pub-title a { color: inherit; }
.pub-title a:hover { color: var(--teal); text-decoration: none; }
.pub-authors { font-size: 14px; color: var(--muted); margin-bottom: 10px; }
.pub-authors strong { color: var(--text); font-weight: 600; }
.pub-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.pub-journal { font-family: var(--font-mono); font-size: 12.5px; font-weight: 600; color: var(--violet-deep); }
.pub-note { font-size: 12.5px; color: var(--muted); font-style: italic; }
.pub-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  font-size: 13px;
  font-weight: 600;
  color: var(--teal);
}
.pub-link svg { width: 13px; height: 13px; }

.pub-empty { text-align: center; color: var(--muted); padding: 60px 0; font-size: 16px; display: none; }

/* ---------- CTA band ---------- */

.cta-band {
  position: relative;
  background: var(--ink);
  border-radius: calc(var(--radius) + 6px);
  padding: 72px 64px;
  overflow: hidden;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}
.cta-band::before {
  content: "";
  position: absolute;
  width: 480px;
  height: 480px;
  border-radius: 50%;
  background: var(--teal-bright);
  filter: blur(150px);
  opacity: 0.25;
  top: -200px;
  right: -100px;
}
.cta-band h2 { color: #fff; font-size: clamp(26px, 3.4vw, 38px); max-width: 18ch; position: relative; }
.cta-band p { color: rgba(255, 255, 255, 0.62); margin-top: 12px; max-width: 44ch; position: relative; }
.cta-band .btn { position: relative; }
@media (max-width: 720px) { .cta-band { padding: 52px 32px; } }

/* ---------- group photo strip ---------- */

.photo-strip { border-radius: calc(var(--radius) + 6px); overflow: hidden; box-shadow: var(--shadow-md); }
.photo-strip img { width: 100%; height: 460px; object-fit: cover; }
@media (max-width: 720px) { .photo-strip img { height: 280px; } }

/* ---------- contact ---------- */

.contact-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 28px; align-items: start; }
@media (max-width: 880px) { .contact-grid { grid-template-columns: 1fr; } }

.contact-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 38px 36px;
  box-shadow: var(--shadow-sm);
}
.contact-card h2 { font-size: 22px; margin-bottom: 20px; }

.addr { display: flex; gap: 16px; padding: 16px 0; border-top: 1px solid var(--line); }
.addr:first-of-type { border-top: 0; padding-top: 0; }
.addr-icon {
  width: 40px;
  height: 40px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: rgba(13, 148, 136, 0.08);
  color: var(--teal);
}
.addr-icon svg { width: 18px; height: 18px; }
.addr h3 { font-family: var(--font-body); font-size: 14px; font-weight: 600; letter-spacing: 0; color: var(--ink); margin-bottom: 2px; }
.addr p { font-size: 14.5px; color: var(--muted); }

.contact-photo { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); border: 1px solid var(--line); }
.contact-photo img { width: 100%; height: 240px; object-fit: cover; }
.contact-photo figcaption { font-size: 13px; color: var(--muted); padding: 12px 18px; background: var(--card); }

/* ---------- footer ---------- */

.footer {
  background: var(--ink);
  color: rgba(255, 255, 255, 0.55);
  padding: 64px 0 36px;
  margin-top: 104px;
}
.footer a { color: rgba(255, 255, 255, 0.75); }
.footer a:hover { color: var(--teal-bright); }

.footer-grid { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 40px; margin-bottom: 48px; }
.footer-brand { max-width: 320px; }
.footer-brand .brand { margin-bottom: 14px; }
.footer-brand p { font-size: 14px; line-height: 1.7; }

.footer-col h2 {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.4);
  margin-bottom: 16px;
}
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 10px; font-size: 14.5px; }

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 26px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
}

/* ---------- reveal animations ---------- */

/* hidden state only when JS is running (html.js set by inline head script) */
.js .reveal { opacity: 0; transform: translateY(26px); transition: opacity 0.7s cubic-bezier(0.2, 0.6, 0.2, 1), transform 0.7s cubic-bezier(0.2, 0.6, 0.2, 1); }
.js .reveal.visible { opacity: 1; transform: none; }
.reveal-d1 { transition-delay: 0.08s; }
.reveal-d2 { transition-delay: 0.16s; }
.reveal-d3 { transition-delay: 0.24s; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .area-card, .fpub, .member, .pub, .tech-card, .btn { transition: none; }
}
