/* ==========================================================
   Dr Shahid Latif — site styles
   Colours come from the logo: navy #0B2545, teal #0D9488.
   ========================================================== */

/* Fonts are stored with the site (SIL Open Font Licence) */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/inter-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/inter-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/inter-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/inter-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Space Grotesk"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/space-grotesk-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Space Grotesk"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/space-grotesk-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Space Grotesk"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/space-grotesk-latin-700-normal.woff2") format("woff2"); }

:root {
  --navy: #0B2545;
  --teal: #0D9488;
  --gold: #D99A1E;

  --bg: #F7F9FC;
  --bar: rgba(247, 249, 252, 0.86);
  --surface: #FFFFFF;
  --heading: #0B2545;
  --text: #1F2933;
  --muted: #52606D;
  --border: #DDE4EE;
  --accent-text: #0F766E;
  --chip: #E8EEF6;
  --chip-gold: #FBF0D5;
  --icon: #52606D;
  --photo: #E8EEF6;
  --shadow: 0 12px 32px rgba(11, 37, 69, 0.12);

  --font-head: "Space Grotesk", "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --radius: 14px;
}

[data-theme="dark"] {
  --bg: #07152A;
  --bar: rgba(7, 21, 42, 0.86);
  --surface: #0F223D;
  --heading: #F1F5FA;
  --text: #DCE4EE;
  --muted: #A9B6C6;
  --border: #22395C;
  --accent-text: #2DD4BF;
  --chip: #16304F;
  --chip-gold: #3A2F12;
  --icon: #C9D4E2;
  --photo: #0F223D;
  --shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background-color .3s, color .3s;
  overflow-x: clip;
}
[hidden] { display: none !important; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }
h1, h2, h3 { font-family: var(--font-head); color: var(--heading); }
:focus-visible { outline: 3px solid var(--teal); outline-offset: 3px; border-radius: 6px; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 32px; }
.skip-link { position: absolute; left: -9999px; top: 8px; background: var(--navy); color: #fff; padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip-link:focus { left: 8px; }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: var(--bar);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.topbar__inner { display: flex; align-items: center; gap: 24px; min-height: 68px; }
.brand { display: flex; align-items: center; gap: 12px; margin-right: auto; }
.brand__mark { width: 34px; height: auto; }
/* Name lettering in the bar: hidden while the big logo is on screen, fades in after */
.brand__name { opacity: 0; transform: translateY(4px); transition: opacity .3s, transform .3s; }
.brand__name img { height: 22px; width: auto; }
.brand__name .logo-light { display: block; }
[data-theme="dark"] .brand__name .logo-light { display: none; }
[data-theme="dark"] .brand__name .logo-dark { display: block; }
.topbar.show-name .brand__name { opacity: 1; transform: none; }
.nav { display: flex; gap: 22px; font-size: 14px; font-weight: 500; white-space: nowrap; }
.nav a { position: relative; padding: 6px 0; }
.nav a:hover, .mobile-nav a:hover { color: var(--accent-text); }
.nav a.is-active { color: var(--heading); font-weight: 600; }
.nav a.is-active::after { content: ""; position: absolute; left: 0; right: 0; bottom: -4px; height: 2px; border-radius: 2px; background: var(--teal); }
.mobile-nav a.is-active { color: var(--accent-text); font-weight: 600; }
.topbar__actions { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  width: 44px; height: 44px; border-radius: 12px;
  border: 1px solid var(--border); background: var(--surface); color: var(--heading);
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
}
.icon-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.i-sun { display: none; }
[data-theme="dark"] .i-sun { display: block; }
[data-theme="dark"] .i-moon { display: none; }
.menu-btn { display: none; }
.mobile-nav { display: flex; flex-direction: column; padding: 8px 32px 20px; border-top: 1px solid var(--border); font-weight: 500; }
.mobile-nav[hidden] { display: none; }
.mobile-nav a { padding: 12px 0; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  height: 48px; padding: 0 22px; border-radius: 12px;
  font-weight: 600; font-size: 15px; border: 1px solid transparent;
  transition: transform .2s, box-shadow .2s, background-color .2s;
}
.btn:hover { transform: translateY(-2px); }
.btn--sm { height: 44px; padding: 0 16px; font-size: 14px; }
.btn--primary { background: var(--navy); color: #fff; border-color: var(--teal); }
.btn--primary:hover { box-shadow: 0 8px 20px rgba(13, 148, 136, 0.25); }
.btn--ghost { background: var(--surface); color: var(--heading); border-color: var(--border); }
.btn--link { color: var(--accent-text); padding: 0 8px; background: transparent; border-color: transparent; cursor: pointer; font-family: var(--font-body); }
.btn--link:hover { text-decoration: underline; text-underline-offset: 4px; }

.ic { width: 18px; height: 18px; flex: none; }
.ic--fill { fill: currentColor; }
.ic--stroke { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Hero ---------- */
.hero { padding: 64px 0 56px; }
.hero__grid {
  display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  grid-template-areas: "head side" "body side";
  column-gap: 64px; align-items: start;
}
.hero__head { grid-area: head; }
.hero__body { grid-area: body; }
.hero__side { grid-area: side; }
.hero__visual { grid-area: visual; }
.hero__tools { grid-area: tools; }
.hero__logo { margin: 0 0 8px; max-width: 600px; }
.hero__logo img { width: 100%; }
.logo-dark, .logo-compact, .hero__tagline { display: none; }
[data-theme="dark"] .logo-full.logo-light { display: none; }
[data-theme="dark"] .logo-full.logo-dark { display: block; }
.hero__tagline { margin: 10px 0 0; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; font-weight: 600; color: var(--muted); line-height: 1.6; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.hero__role { margin: 24px 0 0; font-size: 18px; line-height: 1.5; color: var(--heading); }
.hero__bio { margin-top: 26px; max-width: 640px; }
.hero__bio p { margin: 0 0 14px; color: var(--text); line-height: 1.7; text-align: left; }
.hero__bio p:last-child { margin-bottom: 0; }
.eyebrow--bio { margin: 0 0 10px !important; color: var(--accent-text) !important; }

.badges { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 999px;
  background: var(--chip); color: var(--heading);
  font-size: 13px; font-weight: 500; line-height: 1.4;
}
.badge .ic { width: 14px; height: 14px; }
.badge--award { background: var(--chip-gold); font-weight: 600; }
.badge--award .ic { fill: var(--gold); }

.cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }

.eyebrow { margin: 30px 0 10px; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; font-weight: 600; color: var(--muted); }
.links { display: flex; flex-wrap: wrap; gap: 8px; }
.link-pill {
  height: 44px; padding: 0 14px; border-radius: 12px;
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--border); background: var(--surface);
  color: var(--heading); font-size: 14px; font-weight: 500;
  transition: border-color .2s, transform .2s;
}
.link-pill .ic { color: var(--icon); transition: color .2s; }
.link-pill:hover { border-color: var(--teal); transform: translateY(-2px); }
.link-pill--scholar:hover .ic { color: #4285F4; }
.link-pill--orcid:hover .ic { color: #A6CE39; }
.link-pill--linkedin:hover .ic { color: #0A66C2; }
.link-pill--researchgate:hover .ic { color: #00CCBB; }
.link-pill--github:hover .ic { color: var(--heading); }
.link-pill--email:hover .ic { color: var(--teal); }

/* Photo side */
.hero__visual { position: relative; width: 100%; max-width: 280px; margin: 0 auto; }
.photo {
  position: relative; aspect-ratio: 4 / 5; border-radius: 28px; overflow: hidden;
  background: var(--photo); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
}
.photo > img:not(.photo__fallback) { width: 100%; height: 100%; object-fit: cover; }
.photo__fallback { width: 42%; opacity: .9; }
.chip {
  position: absolute; display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow);
  font-size: 13px; font-weight: 600; color: var(--heading);
}
.chip .ic { width: 15px; height: 15px; color: var(--teal); }
.chip--location { top: 20px; right: -14px; }
.project-card {
  position: relative; margin: -44px 20px 0 -20px;  /* overlaps only the lower edge of the photo */
  padding: 16px 18px; border-radius: 16px;
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow);
}
.project-card p { margin: 0; }
.project-card__label { font-size: 11.5px; letter-spacing: .12em; text-transform: uppercase; font-weight: 600; color: var(--accent-text); }
.project-card__title { margin-top: 6px !important; font-family: var(--font-head); font-size: 16px; font-weight: 600; line-height: 1.35; color: var(--heading); }
.project-card__meta { margin-top: 6px !important; font-size: 13px; color: var(--muted); }

/* Technical tools */
.hero__tools { width: 100%; max-width: 360px; margin: 48px auto 0; }
.tools__title { margin: 0 0 12px; font-family: var(--font-body); }
.tools { display: flex; flex-direction: column; gap: 14px; }
.tool {
  display: block; border-radius: 16px; overflow: hidden;
  background: var(--surface); border: 1px solid var(--border);
  transition: border-color .2s, box-shadow .2s, transform .2s;
}
.tool:hover { border-color: var(--teal); box-shadow: var(--shadow); transform: translateY(-2px); color: inherit; }
.tool__logo { display: flex; align-items: center; justify-content: center; height: 104px; padding: 0 16px; background: #FFFFFF; }
.tool__logo img { height: 76px; width: auto; max-width: 100%; object-fit: contain; }  /* both logos the same height */
.tool__foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--border); }
.tool__name { font-weight: 600; font-size: 15px; color: var(--heading); }
.tool__open { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; color: var(--accent-text); }
.tool__open .ic { width: 15px; height: 15px; }

/* Key numbers */
.stats {
  margin-top: 88px;
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 1px;
  background: var(--border); border: 1px solid var(--border); border-radius: 18px; overflow: hidden;
}
.stat { background: var(--surface); padding: 22px 24px; display: flex; flex-direction: column; }
.stat__value { font-family: var(--font-head); font-size: 40px; font-weight: 700; line-height: 1.1; color: var(--heading); }
.stat__label { margin-top: 4px; font-size: 14px; color: var(--muted); line-height: 1.4; }

/* ---------- Google Scholar badge (Home page) ---------- */
.scholar {
  margin-top: 20px; display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 28px;
  padding: 20px 26px; border-radius: 18px; background: var(--surface); border: 1px solid var(--border);
  transition: border-color .2s, box-shadow .2s, transform .2s;
}
.scholar:hover { border-color: #4285F4; box-shadow: var(--shadow); transform: translateY(-2px); color: inherit; }
.scholar__brand { display: flex; align-items: center; gap: 14px; }
.scholar__logo {
  flex: none; width: 52px; height: 52px; border-radius: 14px; display: inline-flex; align-items: center; justify-content: center;
  background: #FFFFFF; border: 1px solid #E5EAF1;
}
.scholar__logo .ic { width: 30px; height: 30px; color: #4285F4; }
.scholar__head { display: flex; flex-direction: column; line-height: 1.25; }
.scholar__name { font-family: var(--font-head); font-weight: 700; font-size: 18px; color: var(--heading); }
.scholar__updated { font-size: 12.5px; color: var(--muted); }
.scholar__metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; padding-left: 28px; border-left: 1px solid var(--border); }
.scholar__metric { display: flex; flex-direction: column; }
.scholar__value { font-family: var(--font-head); font-size: 32px; font-weight: 700; line-height: 1.1; color: var(--heading); }
.scholar__label { font-size: 13.5px; font-weight: 600; color: var(--heading); }
.scholar__since { font-size: 12px; color: var(--muted); }
.scholar__chart { display: flex; align-items: flex-end; gap: 5px; height: 64px; }
.scholar__bar { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 3px; height: 100%; width: 18px; }
.scholar__bar > span { width: 100%; border-radius: 4px 4px 0 0; background: #4285F4; opacity: .85; }
.scholar__bar:last-child > span { opacity: .45; }   /* current year so far */
.scholar__bar small { font-size: 10px; color: var(--muted); line-height: 1; }
.scholar__cta { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; color: var(--accent-text); white-space: nowrap; }
.scholar__cta .ic { width: 15px; height: 15px; }

/* ---------- Technical skills (Home page) ---------- */
.skills { padding: 72px 0 88px; border-top: 1px solid var(--border); }
.skills__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.skill-card {
  padding: 22px 22px 24px; border-radius: 18px; background: var(--surface); border: 1px solid var(--border);
  transition: border-color .2s, box-shadow .2s, transform .2s;
}
.skill-card:hover { border-color: var(--teal); box-shadow: var(--shadow); transform: translateY(-2px); }
.skill-card__title { margin: 0 0 16px; display: flex; align-items: center; gap: 12px; font-size: 17px; }
.skill-card__icon {
  flex: none; width: 40px; height: 40px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center;
  background: rgba(13, 148, 136, 0.12); color: var(--accent-text);
}
.skill-card__icon .ic { width: 22px; height: 22px; }
.skill-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.skill-chip {
  display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 4px 12px 4px 4px;
  border-radius: 999px; background: var(--bg); border: 1px solid var(--border);
  font-size: 13.5px; font-weight: 500; color: var(--heading); line-height: 1.2;
  transition: border-color .2s;
}
.skill-chip:hover { border-color: var(--teal); }
.skill-chip__logo {   /* white disc keeps every brand colour readable in light and dark mode */
  flex: none; width: 28px; height: 28px; border-radius: 50%; background: #FFFFFF; border: 1px solid #E5EAF1;
  display: inline-flex; align-items: center; justify-content: center;
}
.skill-chip__logo img { width: 18px; height: 18px; object-fit: contain; }
.skill-chip__logo .ic { width: 16px; height: 16px; color: #0B2545; }
.skill-chip--wide { padding: 4px 14px; background: #FFFFFF; height: 38px; }
.skill-chip__word { height: 13px; width: auto; }

/* ---------- Inner pages ---------- */
.page { padding: 72px 0 96px; }
.page__head { margin-bottom: 40px; }
.page__title { margin: 0; font-size: 44px; line-height: 1.1; letter-spacing: -0.01em; }

/* ---------- Sections (shared) ---------- */
.section { padding: 96px 0; border-top: 1px solid var(--border); scroll-margin-top: 68px; }
.section--alt { background: var(--surface); }
.section__head { margin-bottom: 32px; }
.section__title { margin: 0; font-size: 40px; line-height: 1.15; letter-spacing: -0.01em; }
.eyebrow--accent { margin: 0 0 8px; color: var(--accent-text); }

/* ---------- Timeline ---------- */
.timeline { position: relative; display: flex; flex-direction: column; gap: 20px; margin: 0; padding: 0 0 0 28px; list-style: none; }
.timeline::before {
  content: ""; position: absolute; left: 7px; top: 12px; bottom: 12px;
  width: 2px; background: var(--border); border-radius: 2px;
}
.timeline__item { position: relative; }
.timeline__item::before {
  content: ""; position: absolute; left: -28px; top: 34px;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--bg); border: 3px solid var(--teal);
}
.timeline__item:first-child::before { background: var(--teal); box-shadow: 0 0 0 5px rgba(13, 148, 136, 0.18); }

.entry {
  display: flex; gap: 24px; align-items: flex-start;
  padding: 24px; border-radius: 18px;
  background: var(--surface); border: 1px solid var(--border);
  transition: border-color .2s, box-shadow .2s, transform .2s;
}
.entry:hover { border-color: var(--teal); box-shadow: var(--shadow); transform: translateY(-2px); }
.entry__logo {
  flex: none; width: 184px; height: 84px; padding: 0 8px;
  display: flex; align-items: center; justify-content: center;
  background: #FFFFFF; border: 1px solid var(--border); border-radius: 14px;
}
.entry__logo img { height: 52px; width: auto; max-width: 100%; object-fit: contain; }  /* every logo is 52px tall */
.entry__body { flex: 1; min-width: 0; }
.entry__top { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 16px; }
.entry__title { margin: 0; font-size: 21px; line-height: 1.3; }
.entry__dates {
  display: inline-flex; align-items: center; gap: 6px; flex: none;
  font-size: 13.5px; font-weight: 600; color: var(--accent-text); white-space: nowrap;
}
.entry__dates .ic { width: 15px; height: 15px; }
.entry__org { margin: 6px 0 0; color: var(--text); }
.entry__org strong { color: var(--heading); }
.entry__meta { margin: 8px 0 0; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; font-size: 14px; color: var(--muted); }
.entry__meta > span:first-child { display: inline-flex; align-items: center; gap: 5px; }
.entry__meta .ic { width: 15px; height: 15px; }
.tag {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: 999px;
  background: var(--chip); color: var(--heading); font-size: 12.5px; font-weight: 500;
}
.tag--current { background: rgba(13, 148, 136, 0.14); color: var(--accent-text); font-weight: 600; }
.tag--award { background: var(--chip-gold); font-weight: 600; }
.tag--award .ic { width: 13px; height: 13px; fill: var(--gold); }
.entry__points { margin: 14px 0 0; padding-left: 0; display: flex; flex-direction: column; gap: 8px; }
.entry__points li { position: relative; padding-left: 18px; color: var(--text); line-height: 1.6; font-size: 15px; }
.entry__points li::before { content: ""; position: absolute; left: 2px; top: 10px; width: 6px; height: 6px; border-radius: 50%; background: var(--teal); }
.entry__thesis { margin: 14px 0 0; padding: 12px 14px; border-radius: 12px; background: var(--chip); color: var(--heading); font-weight: 500; line-height: 1.5; }
.entry__thesis span { display: block; margin-bottom: 2px; font-size: 11.5px; letter-spacing: .12em; text-transform: uppercase; font-weight: 600; color: var(--accent-text); }
.honours { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- Publications ---------- */
.page__head--row { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 20px; }
.page__intro { margin: 12px 0 0; max-width: 620px; color: var(--muted); }
.block-title { margin: 0 0 16px; font-size: 22px; }
.pub-logo {
  display: inline-flex; align-items: center; justify-content: center;
  height: 36px; padding: 0 10px; border-radius: 10px;
  background: #FFFFFF; border: 1px solid var(--border);
}
.pub-logo img { height: 20px; width: auto; max-width: 110px; object-fit: contain; }

.featured { margin-bottom: 48px; }
.featured__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.fcard {
  height: 100%; display: flex; flex-direction: column; gap: 10px; padding: 18px 20px;
  border-radius: 16px; background: var(--surface); border: 1px solid var(--border);
  transition: border-color .2s, box-shadow .2s, transform .2s;
}
.fcard:hover { border-color: var(--teal); box-shadow: var(--shadow); transform: translateY(-2px); color: inherit; }
.fcard__top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.fcard__meta { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; font-weight: 600; color: var(--accent-text); }
.fcard__title { font-family: var(--font-head); font-weight: 600; font-size: 17px; line-height: 1.35; color: var(--heading); }
.fcard__venue { font-size: 14px; font-style: italic; color: var(--muted); }
.fcard__more { margin-top: auto; display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; color: var(--accent-text); }
.fcard__more .ic { width: 16px; height: 16px; }

.pub-toolbar {
  position: sticky; top: 68px; z-index: 20;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 0; background: var(--bg); border-bottom: 1px solid var(--border);
}
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-btn {
  min-height: 40px; padding: 0 16px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface); color: var(--heading);
  font: 500 14px/1 var(--font-body); transition: background-color .2s, border-color .2s, color .2s;
}
.chip-btn:hover { border-color: var(--teal); }
.chip-btn[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: #fff; }
[data-theme="dark"] .chip-btn[aria-pressed="true"] { background: var(--teal); border-color: var(--teal); }
.search {
  display: flex; align-items: center; gap: 8px; min-width: 280px; height: 44px; padding: 0 14px;
  border-radius: 12px; border: 1px solid var(--border); background: var(--surface); color: var(--muted);
}
.search:focus-within { border-color: var(--teal); }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text); font: 400 15px var(--font-body); }
.year-jump { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 18px 0 8px; font-size: 14px; font-weight: 600; color: var(--muted); }
.year-jump a:hover { color: var(--accent-text); }

.year { padding-top: 32px; scroll-margin-top: 150px; }
.year__title { margin: 0 0 6px; font-size: 32px; color: var(--heading); display: flex; align-items: center; gap: 16px; }
.year__title::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.pub-group { margin-top: 18px; }
.pub-group__title { margin: 0 0 10px; font-family: var(--font-body); font-size: 13px; letter-spacing: .12em; text-transform: uppercase; color: var(--accent-text); }
.pubs { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.pub {
  display: flex; gap: 20px; align-items: flex-start; justify-content: space-between;
  padding: 16px 20px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border);
  transition: border-color .2s;
}
.pub:hover { border-color: var(--teal); }
.pub__main { min-width: 0; }
.pub__title { margin: 0; font-family: var(--font-head); font-size: 17px; font-weight: 600; line-height: 1.4; }
.pub__title a { color: var(--heading); background-image: linear-gradient(var(--teal), var(--teal)); background-size: 0 2px; background-position: 0 100%; background-repeat: no-repeat; transition: background-size .25s, color .2s; }
.pub__title a:hover { color: var(--accent-text); background-size: 100% 2px; }
.pub__authors { margin: 6px 0 0; font-size: 14px; color: var(--muted); line-height: 1.5; }
.pub__authors strong { color: var(--heading); }
.pub__role { font-weight: 600; color: var(--heading); }
.pub__venue { margin: 4px 0 0; font-size: 14px; color: var(--text); }
.pub__badges { margin: 8px 0 0; }
.pub__side { flex: none; }
.pub-empty { margin: 40px 0; text-align: center; color: var(--muted); }

/* Detail panel */
html.no-scroll { overflow: hidden; }
.pub-dialog {
  width: min(760px, calc(100vw - 32px)); max-height: calc(100vh - 48px); padding: 0;
  border: 1px solid var(--border); border-radius: 20px; background: var(--surface); color: var(--text);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25);
}
.pub-dialog[open] { animation: fade-in .25s ease; }
.pub-dialog::backdrop { background: rgba(7, 21, 42, 0.55); backdrop-filter: blur(3px); }
.pd { display: flex; flex-direction: column; }
.pd__head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 22px; background: #FFFFFF; border-bottom: 1px solid var(--border); }
.pd__logo img { height: 48px; width: auto; max-width: 260px; object-fit: contain; }
.pd__close { background: #FFFFFF; color: #0B2545; border-color: #DDE4EE; }
.pd__close svg { width: 18px; height: 18px; }
.pd__body { padding: 22px 26px 8px; }
.pd__meta { margin: 0; font-size: 12.5px; letter-spacing: .1em; text-transform: uppercase; font-weight: 600; color: var(--accent-text); }
.pd__title { margin: 8px 0 0; font-size: 24px; line-height: 1.3; }
.pd__authors { margin: 10px 0 0; color: var(--muted); }
.pd__authors strong { color: var(--heading); }
.pd__label { display: block; margin-bottom: 4px; font-size: 11.5px; letter-spacing: .12em; text-transform: uppercase; font-weight: 600; color: var(--muted); }
.pd__venue { margin-top: 18px; padding: 12px 14px; border-radius: 12px; background: var(--chip); }
.pd__venue p { margin: 0; color: var(--heading); }
.pd__award { margin: 14px 0 0; display: inline-block; padding: 4px 12px; border-radius: 999px; background: var(--chip-gold); color: var(--heading); font-size: 13px; font-weight: 600; }
.pd__abstract { margin-top: 18px; }
.pd__abstract p { margin: 0 0 10px; line-height: 1.7; text-align: justify; }
.pd__muted { color: var(--muted); text-align: left !important; }
.pd__muted a { color: var(--accent-text); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.pd__actions { display: flex; flex-wrap: wrap; gap: 10px; padding: 16px 26px 24px; }
.pd__actions .ic { width: 16px; height: 16px; }

/* ---------- Conference presentations ---------- */
.talks { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.talk {
  height: 100%; display: flex; flex-direction: column; overflow: hidden;
  border-radius: 20px; background: var(--surface); border: 1px solid var(--border);
  transition: border-color .2s, box-shadow .2s, transform .2s;
}
.talk:hover { border-color: var(--teal); box-shadow: var(--shadow); transform: translateY(-3px); }
.talk__media { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: var(--navy); }
.talk__media > img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease; }
.talk:hover .talk__media > img { transform: scale(1.04); }
.talk__media::after {   /* soft shade so the labels stay readable on any photo */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(to bottom, rgba(7, 21, 42, 0.45) 0%, rgba(7, 21, 42, 0) 30%, rgba(7, 21, 42, 0) 60%, rgba(7, 21, 42, 0.65) 100%);
}
.talk__placeholder {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  background: radial-gradient(circle at 30% 20%, rgba(13, 148, 136, 0.35), transparent 55%), var(--navy);
}
.talk__placeholder img { width: 64px; opacity: .9; }
.talk__placeholder span { font-family: var(--font-head); font-size: 34px; font-weight: 700; color: #FFFFFF; letter-spacing: .02em; }
.talk__badge {
  position: absolute; top: 14px; left: 14px; z-index: 1;
  padding: 6px 12px; border-radius: 999px; background: rgba(255, 255, 255, 0.94); color: var(--navy);
  font-size: 13px; font-weight: 700; letter-spacing: .02em;
}
.talk__city {
  position: absolute; left: 16px; bottom: 12px; z-index: 1;
  display: inline-flex; align-items: center; gap: 6px; color: #FFFFFF; font-weight: 600; font-size: 15px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}
.talk__city .ic { width: 16px; height: 16px; }
.talk__body { display: flex; flex-direction: column; gap: 12px; padding: 20px 22px 22px; flex: 1; }
.talk__name { margin: 0; font-size: 19px; line-height: 1.35; }
.talk__meta { margin: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 14px; color: var(--muted); }
.talk__meta span { display: inline-flex; align-items: center; gap: 6px; }
.talk__meta .ic { width: 15px; height: 15px; color: var(--accent-text); }
.talk__papers { margin-top: auto; padding: 14px 16px; border-radius: 14px; background: var(--chip); }
.talk__label { display: block; margin-bottom: 6px; font-size: 11.5px; letter-spacing: .12em; text-transform: uppercase; font-weight: 600; color: var(--accent-text); }
.talk__papers ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.talk__papers li { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.talk__paper { font-weight: 600; line-height: 1.45; color: var(--heading); }
a.talk__paper { text-decoration: underline; text-decoration-color: rgba(13, 148, 136, 0.45); text-underline-offset: 3px; }
a.talk__paper:hover { color: var(--accent-text); text-decoration-color: var(--teal); }
.talk__papers .tag:not(.tag--award) { background: var(--surface); border: 1px solid var(--border); }

/* ---------- Research projects ---------- */
.projects { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 24px; }
.project {
  padding: 26px 28px; border-radius: 20px; background: var(--surface); border: 1px solid var(--border);
  transition: border-color .2s, box-shadow .2s;
}
.project:hover { border-color: var(--teal); box-shadow: var(--shadow); }
.project__head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 16px; }
.project__logos { display: flex; flex-wrap: wrap; gap: 16px 28px; }
.logo-group { display: flex; flex-direction: column; gap: 6px; }
.logo-group__label { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; font-weight: 600; color: var(--muted); }
.logo-group__tiles { display: flex; flex-wrap: wrap; gap: 10px; }
.logo-tile {
  display: inline-flex; align-items: center; justify-content: center;
  height: 76px; min-width: 120px; padding: 0 14px; border-radius: 14px;
  background: #FFFFFF; border: 1px solid var(--border);
}
.logo-tile img { height: 48px; width: auto; max-width: 220px; object-fit: contain; }   /* every logo the same height */
.logo-tile--sm { height: 56px; min-width: 96px; padding: 0 12px; border-radius: 12px; }
.logo-tile--sm img { height: 32px; max-width: 160px; }
.project__short { margin: 22px 0 0; font-size: 13px; letter-spacing: .12em; text-transform: uppercase; font-weight: 700; color: var(--accent-text); }
.project__title { margin: 6px 0 0; font-size: 22px; line-height: 1.35; }
.project__short + .project__title { margin-top: 6px; }
.project__head + .project__title { margin-top: 22px; }
.facts { margin: 16px 0 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 24px; }
.facts div { min-width: 0; }
.facts dt { font-size: 11.5px; letter-spacing: .12em; text-transform: uppercase; font-weight: 600; color: var(--muted); }
.facts dd { margin: 2px 0 0; color: var(--heading); font-weight: 500; line-height: 1.5; }
.project__role { margin: 18px 0 0; padding: 14px 16px; border-radius: 14px; background: var(--chip); color: var(--text); line-height: 1.65; }
.project__role span { display: block; margin-bottom: 4px; font-size: 11.5px; letter-spacing: .12em; text-transform: uppercase; font-weight: 600; color: var(--accent-text); }
.project__partners { margin-top: 18px; display: flex; flex-direction: column; gap: 8px; }
.project__partners-text { margin: 0; font-size: 14px; color: var(--muted); }

/* ---------- Service & Awards ---------- */
.page__head .year-jump { margin-top: 18px; }
.svc { padding-top: 40px; scroll-margin-top: 80px; }
.svc + .svc { margin-top: 16px; border-top: 1px solid var(--border); }
.svc__title { margin: 0 0 18px; display: flex; align-items: center; gap: 10px; font-size: 26px; }
.svc__title .ic { width: 24px; height: 24px; color: var(--teal); }
#awards .svc__title .ic { fill: var(--gold); }
.svc__intro { margin: -6px 0 16px; color: var(--muted); }
.svc__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.scard {
  display: flex; flex-direction: column; align-items: flex-start; gap: 8px;
  padding: 22px 24px; border-radius: 18px; background: var(--surface); border: 1px solid var(--border);
  transition: border-color .2s, box-shadow .2s;
}
.scard:hover { border-color: var(--teal); box-shadow: var(--shadow); }
.scard .logo-tile { margin-bottom: 6px; }
.scard__role { margin: 0; font-size: 12.5px; letter-spacing: .12em; text-transform: uppercase; font-weight: 700; color: var(--accent-text); }
.scard__title { margin: 0; font-size: 18px; line-height: 1.4; }
.scard__venue { margin: 0; color: var(--text); }
.scard__link { margin-top: auto; padding-top: 6px; display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 14.5px; color: var(--accent-text); }
.scard__link:hover { text-decoration: underline; text-underline-offset: 3px; }
.scard__link .ic { width: 15px; height: 15px; }
.scard--media { padding: 0; overflow: hidden; gap: 0; }
.scard__media { position: relative; width: 100%; aspect-ratio: 16 / 7; overflow: hidden; background: var(--navy); }
.scard__media > img { width: 100%; height: 100%; object-fit: cover; }
.scard__body { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 18px 22px 22px; flex: 1; width: 100%; }
.scard__body .talk__meta { margin-top: 4px; }

.review { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.review__group { padding: 20px 22px; border-radius: 18px; background: var(--surface); border: 1px solid var(--border); }
.review__group ul { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.review__group li { position: relative; padding-left: 18px; line-height: 1.5; color: var(--heading); }
.review__group li::before { content: ""; position: absolute; left: 2px; top: 9px; width: 6px; height: 6px; border-radius: 50%; background: var(--teal); }

.awards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.acard {
  display: flex; flex-direction: column; overflow: hidden;
  border-radius: 18px; background: var(--surface); border: 1px solid var(--border);
  transition: border-color .2s, box-shadow .2s;
}
.acard:hover { border-color: var(--gold); box-shadow: var(--shadow); }
.acard__media { position: relative; display: block; aspect-ratio: 16 / 10; overflow: hidden; background: #F1F4F8; }
.acard__media > img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.acard:hover .acard__media > img { transform: scale(1.03); }
.acard__badge { position: absolute; left: 14px; bottom: 14px; width: 64px; height: 64px; padding: 6px; border-radius: 50%; background: #FFFFFF; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2); }
.acard__badge img { width: 100%; height: 100%; object-fit: contain; }
.acard__body { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 20px 22px 22px; }
.acard__year { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px; background: var(--chip-gold); color: var(--heading); font-size: 13px; font-weight: 700; }
.acard__year .ic { width: 14px; height: 14px; fill: var(--gold); }
.acard__title { margin: 0; font-size: 19px; line-height: 1.35; }
.acard__by { margin: 0; color: var(--text); font-weight: 500; }
.acard__note { margin: 0; font-size: 14px; color: var(--muted); }
.acard__paper { margin: 4px 0 0; padding: 12px 14px; border-radius: 12px; background: var(--chip); width: 100%; }
.acard__paper span { display: block; margin-bottom: 4px; font-size: 11.5px; letter-spacing: .12em; text-transform: uppercase; font-weight: 600; color: var(--accent-text); }
.acard:not(.acard--image) .logo-tile { margin-bottom: 6px; }

/* ---------- Contact ---------- */
.contact { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.contact__emails { display: flex; flex-direction: column; gap: 20px; }
.ccard {
  display: flex; align-items: center; gap: 18px; padding: 22px 24px;
  border-radius: 18px; background: var(--surface); border: 1px solid var(--border);
}
.ccard__icon {
  flex: none; width: 52px; height: 52px; border-radius: 14px; display: inline-flex; align-items: center; justify-content: center;
  background: rgba(13, 148, 136, 0.12); color: var(--accent-text);
}
.ccard__icon .ic { width: 24px; height: 24px; }
.ccard__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.ccard__label { margin: 0; font-size: 11.5px; letter-spacing: .12em; text-transform: uppercase; font-weight: 600; color: var(--muted); }
.ccard__value { font-family: var(--font-head); font-size: 19px; font-weight: 600; color: var(--heading); word-break: break-all; }
.ccard__value:hover { color: var(--accent-text); }
.ccard--address { align-items: flex-start; }
.ccard__address { font-style: normal; line-height: 1.7; color: var(--heading); }
.ccard__logo { flex: none; }
.ccard--profiles { grid-column: 1 / -1; }
.ccard--profiles .links { margin-top: 8px; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--border); margin-top: 40px; }
.footer__inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; padding-top: 20px; padding-bottom: 20px; font-size: 13px; color: var(--muted); }
.footer p { margin: 0; }

/* ---------- Tablet and phone ---------- */
@media (max-width: 1180px) {
  .nav { display: none; }
  .menu-btn { display: inline-flex; }
}
@media (max-width: 920px) {
  .container { padding: 0 20px; }
  .nav, .topbar__cv { display: none; }
  .menu-btn { display: inline-flex; }
  .mobile-nav { padding: 8px 20px 20px; }
  .hero { padding: 40px 0 40px; }
  .hero__grid { grid-template-columns: minmax(0, 1fr); grid-template-areas: "head" "visual" "body" "tools"; row-gap: 0; }
  .hero__side { display: contents; }
  .hero__visual { margin: 36px auto 64px; max-width: 260px; }
  .hero__tools { max-width: none; margin-top: 40px; }
  .chip--location { right: -6px; }
  .project-card { margin: -40px 8px 0 -8px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat:last-child { grid-column: span 2; }
  .stat__value { font-size: 34px; }
  .section { padding: 64px 0; }
  .section__title { font-size: 32px; }
}
@media (max-width: 640px) {
  .timeline { padding-left: 20px; }
  .timeline::before { left: 4px; }
  .timeline__item::before { left: -20px; top: 26px; width: 12px; height: 12px; border-width: 2px; }
  .entry { flex-direction: column; gap: 14px; padding: 18px; }
  .entry__logo { width: 184px; height: 76px; }
  .page__title { font-size: 34px; }
  .page { padding: 48px 0 64px; }
  .entry__title { font-size: 18px; }
  .entry__dates { white-space: normal; }
  .pub { flex-direction: column; gap: 10px; padding: 14px 16px; }
  .pub-toolbar { position: static; }
  .search { min-width: 0; width: 100%; }
  .pd__body { padding: 18px 18px 4px; }
  .pd__actions { padding: 14px 18px 20px; }
  .pd__title { font-size: 20px; }
  .featured__grid { grid-template-columns: minmax(0, 1fr); }
  .talk__body { padding: 16px 16px 18px; }
  .project { padding: 18px; }
  .project__title { font-size: 19px; }
  .facts { grid-template-columns: minmax(0, 1fr); }
  .logo-tile { height: 64px; min-width: 100px; }
  .logo-tile img { height: 40px; max-width: 180px; }
  .talk__name { font-size: 17px; }
}
@media (max-width: 1080px) {
  .skills__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .scholar { grid-template-columns: auto 1fr; }
  .scholar__chart { grid-column: 1; }
  .scholar__cta { justify-self: end; }
}
@media (max-width: 900px) {
  .talks, .svc__grid, .awards, .contact { grid-template-columns: minmax(0, 1fr); }
  .review { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .ccard { flex-wrap: wrap; padding: 18px; }
  .ccard__logo { display: none; }
  .skills { padding: 48px 0 64px; }
  .scholar { grid-template-columns: minmax(0, 1fr); gap: 18px; padding: 18px; }
  .scholar__metrics { padding-left: 0; border-left: 0; padding-top: 16px; border-top: 1px solid var(--border); }
  .scholar__value { font-size: 26px; }
  .scholar__cta { justify-self: start; }
  .skills__grid { grid-template-columns: minmax(0, 1fr); }
  .ccard__value { font-size: 16px; }
  .svc__title { font-size: 22px; }
}
@media (max-width: 560px) {
  .hero__logo { max-width: 340px; }
  .logo-full { display: none !important; }
  .logo-compact.logo-light { display: block; }
  [data-theme="dark"] .logo-compact.logo-light { display: none; }
  [data-theme="dark"] .logo-compact.logo-dark { display: block; }
  .hero__tagline { display: block; }
}
@media (max-width: 420px) {
  .hero__role { font-size: 16px; }
  .hero__bio p { font-size: 15px; }
  .btn { height: 46px; padding: 0 18px; }
}

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

@media print {
  .topbar, .chip, .cta, .skip-link { display: none !important; }
  body { background: #fff; color: #000; }
}
