/* IVAL — Intelligent Visual Analytics Lab @ MBZUAI
   Theme carried over from the original site: MBZUAI navy/indigo,
   the logo's cyan→blue gradient, and an orange accent. Type: Optimistic (fonts/). */

@font-face {
  font-family: "Optimistic";
  src: url("../../fonts/optimistic-variable.woff2") format("woff2"), url("../../fonts/optimistic-variable.ttf") format("truetype");
  font-weight: 300 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Optimistic";
  src: url("../../fonts/optimistic-variable.woff2") format("woff2"), url("../../fonts/optimistic-variable.ttf") format("truetype");
  font-weight: 300 800;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Optimistic Display";
  src: url("../../fonts/optimistic-display-bold.woff2") format("woff2"), url("../../fonts/optimistic-display-bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;
  /* brand (fixed across modes) */
  --navy-950: #030a2b;
  --navy-900: #041141;
  --navy-800: #072382;
  --indigo: #3d4dad;
  --brand-cyan: #00d1e4;
  --brand-blue: #006ce6;
  --brand-deep: #0f2ae0;
  --accent: #e98615;
  --grad: linear-gradient(120deg, var(--brand-cyan) 0%, var(--brand-blue) 55%, var(--brand-deep) 100%);

  /* surfaces & ink */
  --bg: #f4f6fb;
  --surface: #ffffff;
  --surface-2: #eef1f9;
  --text: #0b1230;
  --text-2: #464d6b;
  --muted: #747a95;
  --line: #e1e5f0;
  --link: #1f3fc4;
  --chip-bg: #e9edfb;
  --chip-text: #23307e;
  --shadow: 0 1px 2px rgba(4, 17, 65, .06), 0 8px 24px rgba(4, 17, 65, .06);
  --shadow-lg: 0 2px 4px rgba(4, 17, 65, .06), 0 18px 48px rgba(4, 17, 65, .12);

  --radius: 14px;
  --maxw: 1200px;
  --font-head: "Optimistic Display", "Optimistic", system-ui, sans-serif;
  --font-body: "Optimistic", system-ui, -apple-system, "Segoe UI", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #060b22;
    --surface: #0d1433;
    --surface-2: #121a3e;
    --text: #edf0fa;
    --text-2: #b5bcd6;
    --muted: #8a91ad;
    --line: #1e2752;
    --link: #7fb0ff;
    --chip-bg: #18224f;
    --chip-text: #c5d2ff;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
    --shadow-lg: 0 2px 4px rgba(0, 0, 0, .3), 0 18px 48px rgba(0, 0, 0, .4);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #060b22;
  --surface: #0d1433;
  --surface-2: #121a3e;
  --text: #edf0fa;
  --text-2: #b5bcd6;
  --muted: #8a91ad;
  --line: #1e2752;
  --link: #7fb0ff;
  --chip-bg: #18224f;
  --chip-text: #c5d2ff;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
  --shadow-lg: 0 2px 4px rgba(0, 0, 0, .3), 0 18px 48px rgba(0, 0, 0, .4);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.6 var(--font-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--brand-blue); outline-offset: 3px; border-radius: 4px; }

h1, h2, h3, h4 { font-family: var(--font-body); font-weight: 600; line-height: 1.2; margin: 0; letter-spacing: -.005em; }
/* page and section titles use the display cut */
h1, h2 { font-family: var(--font-head); font-weight: 700; letter-spacing: -.01em; }
/* venue names: true italic from the variable font's "ital" axis (browsers don't switch it on by themselves) */
.work .venue, .pub .v { font-style: italic; font-variation-settings: "ital" 1; }
.container { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
@media (max-width: 600px) { .container { padding: 0 16px; } }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(3, 10, 43, .82);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: 68px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 14px; color: #fff; text-decoration: none !important; min-width: 0; }
.brand img { width: auto; display: block; }
.brand img.mbzuai { height: 40px; }
.brand img.ival { height: 42px; }
.brand .divider { width: 1px; height: 32px; background: rgba(255, 255, 255, .25); }
.nav-links { display: flex; align-items: center; gap: 4px; list-style: none; margin: 0; padding: 0; }
.nav-links a {
  color: rgba(255, 255, 255, .82); font-family: var(--font-body); font-weight: 500;
  font-size: 15px; padding: 8px 12px; border-radius: 8px; text-decoration: none;
}
.nav-links a:hover, .nav-links a[aria-current="page"] { color: #fff; background: rgba(255, 255, 255, .08); }
.theme-toggle, .menu-toggle {
  background: transparent; border: 1px solid rgba(255, 255, 255, .2); color: #fff; border-radius: 8px;
  width: 38px; height: 38px; display: inline-grid; place-items: center; cursor: pointer;
}
.theme-toggle:hover, .menu-toggle:hover { background: rgba(255, 255, 255, .08); }
.menu-toggle { display: none; }
@media (max-width: 900px) {
  .brand { gap: 12px; }
  .menu-toggle { display: inline-grid; }
  .nav-links {
    position: absolute; top: 68px; left: 0; right: 0; flex-direction: column; align-items: stretch;
    background: var(--navy-950); padding: 8px 16px 16px; display: none; border-bottom: 1px solid rgba(255, 255, 255, .08);
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 12px; }
}
@media (max-width: 420px) { .brand img.mbzuai { height: 30px; } .brand img.ival { height: 26px; } .brand { gap: 10px; } }

/* ---------- hero ---------- */
.hero {
  position: relative; overflow: hidden; color: #fff;
  /* campus photo under a navy wash: darkest behind the text, lighter on the right so the building shows */
  background: radial-gradient(1200px 600px at 85% 20%, rgba(0, 108, 230, .30), transparent 60%),
              linear-gradient(90deg, rgba(3, 10, 43, .95) 0%, rgba(3, 10, 43, .86) 42%, rgba(3, 10, 43, .58) 100%),
              url("../img/hero.jpg") center 40% / cover no-repeat,
              var(--navy-950);
  margin-top: -68px; padding-top: 68px;
}
.hero canvas { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .9; }
.hero-inner { position: relative; padding: 120px 0 96px; max-width: 780px; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px; font-family: var(--font-body); font-weight: 500;
  font-size: 14.5px; color: var(--brand-cyan);
}
.eyebrow::before { content: ""; width: 28px; height: 2px; background: var(--grad); }
.hero h1 { font-size: clamp(40px, 6vw, 70px); line-height: 1.08; margin: 18px 0 18px; }
.hero h1 .grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p.lead { font-size: clamp(17px, 2vw, 20px); color: rgba(255, 255, 255, .78); max-width: 640px; margin: 0 0 32px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-body); font-weight: 600;
  font-size: 15px; padding: 12px 20px; border-radius: 10px; text-decoration: none !important;
  border: 1px solid transparent; transition: transform .15s ease, background .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--grad); color: #fff; }
.btn-ghost { color: #fff; border-color: rgba(255, 255, 255, .3); }
.btn-ghost:hover { background: rgba(255, 255, 255, .08); }
.btn-outline { color: var(--text); border-color: var(--line); background: var(--surface); }
.btn-outline:hover { border-color: var(--brand-blue); }

@media (max-width: 760px) { .hero-inner { padding: 72px 0 56px; } }

/* ---------- sections ---------- */
section.block { padding: 96px 0; }
section.block.alt { background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
@media (max-width: 600px) { section.block { padding: 64px 0; } }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 40px; flex-wrap: wrap; }
.section-head .eyebrow { color: var(--brand-blue); }
.section-head h2 { font-size: clamp(30px, 4vw, 42px); margin-top: 10px; }
.section-head p { color: var(--text-2); max-width: 620px; margin: 12px 0 0; }

/* themes */
.themes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
@media (max-width: 960px) { .themes { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .themes { grid-template-columns: 1fr; } }
.theme-card {
  position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px 24px 22px; box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column;
}
.theme-card::before { content: ""; position: absolute; left: 0; top: 0; right: 0; height: 3px; background: var(--c, var(--brand-blue)); }
.theme-card .head { display: flex; align-items: center; gap: 14px; }
.theme-card .icon { width: 44px; height: 44px; flex: none; border-radius: 12px; display: grid; place-items: center; background: var(--surface-2); color: var(--c); }
.theme-card h3 { font-size: 20px; }
.theme-card p { color: var(--text-2); font-size: 15px; margin: 10px 0 16px; flex: 1; }
.theme-card .examples { display: flex; flex-wrap: wrap; gap: 6px; }
.theme-card .more { display: inline-flex; align-items: center; gap: 6px; margin-top: 16px; font-size: 13.5px; font-weight: 600; }

.chip {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 500; padding: 4px 10px;
  border-radius: 999px; background: var(--chip-bg); color: var(--chip-text); white-space: nowrap; text-decoration: none !important;
}
a.chip:hover { outline: 1px solid var(--brand-blue); }
.chip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c); }

/* featured work */
.featured { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
@media (max-width: 960px) { .featured { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .featured { grid-template-columns: 1fr; } }
.work {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px;
  display: flex; flex-direction: column; gap: 10px; box-shadow: var(--shadow); transition: transform .18s ease, box-shadow .18s ease;
}
.work:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.work .top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.work .venue { font-size: 14px; color: var(--muted); }
.work h3 { font-size: 24px; }
.work .title { font-size: 14.5px; color: var(--text-2); margin: 0; font-weight: 500; flex: 1; }
.work .links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.work .links a {
  font-size: 13px; font-weight: 500; padding: 6px 10px; border-radius: 8px; border: 1px solid var(--line);
  color: var(--text); text-decoration: none; display: inline-flex; align-items: center; gap: 6px;
}
.work .links a:hover { border-color: var(--brand-blue); color: var(--link); }
.stars { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: var(--text-2); font-weight: 500; }
.stars svg { color: var(--accent); }

/* theme colour tokens (validated categorical palette, light/dark steps) */
.viz-root {
  --viz-grid: #e6e8f0; --viz-axis: #c3c7d6; --viz-muted: #7b8098; --viz-gap: var(--surface);
  --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100; --s5: #e87ba4; --s6: #008300; --s7: #6250d6;
}
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) .viz-root {
    --viz-grid: #1d2550; --viz-axis: #2c3566; --viz-muted: #8a91ad;
    --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181; --s6: #008300; --s7: #9085e9;
  }
}
:root[data-theme="dark"] .viz-root {
  --viz-grid: #1d2550; --viz-axis: #2c3566; --viz-muted: #8a91ad;
  --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181; --s6: #008300; --s7: #9085e9;
}

/* team: 2 x 2 cards, small rounded-square photo beside name and role */
.team { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
@media (max-width: 900px) { .team { grid-template-columns: 1fr; } }
.person { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; display: flex; flex-direction: column; gap: 12px; }
.person .head { display: flex; gap: 18px; align-items: center; }
.person .photo { width: 112px; height: 112px; flex: none; border-radius: 18px; object-fit: cover; object-position: center 20%; background: var(--surface-2); }
.person h3 { font-size: 20px; }
.person .role { color: var(--text-2); font-size: 14px; font-weight: 500; line-height: 1.45; margin-top: 2px; white-space: pre-line; }
.person .bio { color: var(--text-2); font-size: 14.5px; margin: 0; }
.person .tags { display: flex; flex-wrap: wrap; gap: 6px; }
.person .honours { font-size: 13px; color: var(--muted); margin: 0; padding-left: 16px; }
.person .plinks { display: flex; gap: 6px; margin-top: 8px; }
.person .plinks a { width: 32px; height: 32px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 8px; color: var(--text-2); }
.person .plinks a:hover { border-color: var(--brand-blue); color: var(--link); }
@media (max-width: 460px) { .person .photo { width: 88px; height: 88px; border-radius: 14px; } .person .head { gap: 14px; } }

/* research team: compact cards */
.subhead { margin: 56px 0 20px; }
.subhead h3 { font-family: var(--font-head); font-weight: 700; font-size: 24px; }
.subhead p { color: var(--text-2); margin: 6px 0 0; }
.members { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.member { display: flex; align-items: center; gap: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px; box-shadow: var(--shadow); min-width: 0; }
.member .photo { width: 64px; height: 64px; flex: none; border-radius: 12px; object-fit: cover; object-position: center 25%; background: var(--surface-2); }
.member .initials { display: grid; place-items: center; font-weight: 600; font-size: 20px; color: var(--chip-text); background: var(--chip-bg); }
.member .info { min-width: 0; }
.member .name { font-weight: 600; font-size: 15px; line-height: 1.3; }
.member .role { color: var(--muted); font-size: 13px; margin-top: 1px; }
.member .mlinks { display: flex; gap: 6px; margin-top: 6px; }
.member .mlinks a { width: 28px; height: 28px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 7px; color: var(--text-2); }
.member .mlinks a:hover { border-color: var(--brand-blue); color: var(--link); }

/* news */
.news { list-style: none; margin: 0; padding: 0; max-width: 920px; }
.news li { display: grid; grid-template-columns: 110px 1fr; gap: 20px; padding: 16px 0; border-bottom: 1px solid var(--line); }
@media (max-width: 560px) { .news li { grid-template-columns: 1fr; gap: 4px; } }
.news time { font-weight: 600; font-size: 14.5px; color: var(--brand-blue); padding-top: 2px; }
.news .txt { color: var(--text); font-size: 15.5px; }
.news .txt a { font-size: 13px; margin-left: 6px; white-space: nowrap; }

/* publications page */
.page-hero { background: var(--navy-950); color: #fff; margin-top: -68px; padding: 140px 0 56px; position: relative; overflow: hidden; }
.page-hero::after { content: ""; position: absolute; inset: 0; background: radial-gradient(800px 400px at 90% 0%, rgba(0, 108, 230, .35), transparent 60%); pointer-events: none; }
.page-hero .container { position: relative; z-index: 1; }
.page-hero h1 { font-size: clamp(36px, 5vw, 54px); margin-top: 12px; }
.page-hero p { color: rgba(255, 255, 255, .75); max-width: 680px; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 20px 0; position: sticky; top: 68px; background: var(--bg); z-index: 10; border-bottom: 1px solid var(--line); }
.filters input[type="search"], .filters select {
  font: 14px var(--font-body); color: var(--text); background: var(--surface); border: 1px solid var(--line);
  border-radius: 10px; padding: 9px 12px; min-width: 0;
}
.filters input[type="search"] { flex: 1 1 260px; }
.filters select { flex: 0 1 auto; }
.filters .count { color: var(--muted); font-size: 13.5px; margin-left: auto; }
@media (max-width: 600px) { .filters { position: static; } .filters select { flex: 1 1 45%; } .filters .count { margin-left: 0; } }
.year-group h2 { font-size: 30px; margin: 36px 0 8px; color: var(--text); display: flex; align-items: center; gap: 12px; }
.year-group h2 span { font-family: var(--font-body); font-size: 13px; color: var(--muted); font-weight: 500; letter-spacing: 0; }
.pub { display: grid; grid-template-columns: 140px 1fr; gap: 18px; padding: 16px 0; border-bottom: 1px solid var(--line); }
@media (max-width: 640px) { .pub { grid-template-columns: 1fr; gap: 6px; } }
.pub .v { font-size: 15px; font-weight: 500; color: var(--brand-blue); }
.pub .pt { font-weight: 600; font-size: 15.5px; line-height: 1.45; }
.pub .pt a { color: var(--text); }
.pub .pa { color: var(--text-2); font-size: 13.5px; margin-top: 3px; }
.pub .pa b { color: var(--text); font-weight: 600; }
.pub .pm { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; align-items: center; }
.pub .pm .cit { font-size: 12.5px; color: var(--muted); }
.empty { padding: 48px 0; color: var(--muted); text-align: center; }

/* footer */
.site-footer { background: var(--navy-950); color: rgba(255, 255, 255, .78); padding: 64px 0 28px; }
.site-footer a { color: #fff; }
.foot-grid { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 40px; }
@media (max-width: 820px) { .foot-grid { grid-template-columns: 1fr; } }
.site-footer h4 { color: #fff; font-size: 16px; margin-bottom: 14px; }
.site-footer p { margin: 0 0 8px; font-size: 14.5px; }
.foot-logos { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; }
.foot-logos img { height: 40px; width: auto; }
.foot-logos img + .divider + img { height: 42px; }
.foot-logos .divider { width: 1px; height: 32px; background: rgba(255, 255, 255, .25); }
.foot-bottom { border-top: 1px solid rgba(255, 255, 255, .1); margin-top: 40px; padding-top: 20px; font-size: 13px; color: rgba(255, 255, 255, .5); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }

.reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
