/* =========================================================
   SCOPE Research Group — site styles
   Follows the GUST visual identity (gust.edu.kw): electric
   blue primary, midnight ink, warm neutrals, square corners,
   serif display headings and uppercase arrow buttons.
   To re-theme, change the variables in :root only.
   ========================================================= */

:root {
  /* GUST palette */
  --blue: #001df5;
  --blue-120: #0018cc;
  --blue-140: #001299;
  --blue-10: #eef0ff;
  --midnight: #051b1e;
  --midnight-80: #37494b;
  --warm-grey: #505059;
  --beige: #e4e3df;
  --beige-60: #f5f5f4;
  --grey-bg: #efeff2;
  --grey-light: #f5f5f7;
  --ocean: #b4e4dc;
  --sky: #ecf9ef;
  --white: #fff;

  --ink: var(--midnight);
  --ink-soft: #4b5a5c;
  --line: #dcdde2;

  --maxw: 1220px;
  --gutter: 20px;
  --header-h: 84px;
  --serif: "Newsreader", "Signifier", Georgia, "Times New Roman", serif;
  --sans: "Inter", "Untitled Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
/* Smooth scrolling for in-page links is handled in main.js, with an offset that matches the sticky header */
html { scroll-padding-top: calc(var(--header-h) + 16px); }
html:has(.subnav) { scroll-padding-top: calc(var(--header-h) + 72px); }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--blue); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--blue-120); }
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 400; color: var(--midnight); line-height: 1.12; letter-spacing: -.02em; margin: 0 0 .5em; }
h1 { font-size: clamp(2.4rem, 5vw, 3.75rem); }
h2 { font-size: clamp(1.85rem, 3.4vw, 2.75rem); }
h3 { font-size: 1.4rem; }
h4 { font-size: 1.15rem; }
p { margin: 0 0 1em; }
strong, b { font-weight: 600; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }

.container { max-width: var(--maxw); margin: 0 auto; padding-inline: var(--gutter); }
@media (min-width: 1024px) { :root { --gutter: 32px; } }
.section { padding-block: clamp(56px, 8vw, 104px); }
.section.alt { background: var(--grey-light); }
.section.beige { background: var(--beige-60); }
.section-tight { padding-block: clamp(40px, 5vw, 64px); }
.eyebrow {
  display: block; font-size: .75rem; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: var(--blue); margin-bottom: 14px;
}
.lead { font-size: clamp(1.05rem, 1.6vw, 1.25rem); line-height: 1.6; color: var(--ink-soft); max-width: 68ch; letter-spacing: -.01em; }
.prose { max-width: 72ch; }
.prose p { color: var(--ink-soft); }
.muted { color: var(--ink-soft); }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 16px; background: var(--white); padding: 10px 14px; z-index: 200; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Buttons & links (GUST style: square, uppercase, arrow) ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 14px; padding: 14px 22px;
  font: 500 .875rem/1 var(--sans); letter-spacing: .06em; text-transform: uppercase;
  text-decoration: none; border: 1px solid transparent; cursor: pointer;
  transition: background-color .2s, color .2s, border-color .2s;
}
.btn::after {
  content: ""; width: 18px; height: 12px; flex: none; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 12'%3E%3Cpath d='M0 6h16M11 1l5 5-5 5' fill='none' stroke='black' stroke-width='1.6'/%3E%3C/svg%3E") center/contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 12'%3E%3Cpath d='M0 6h16M11 1l5 5-5 5' fill='none' stroke='black' stroke-width='1.6'/%3E%3C/svg%3E") center/contain no-repeat;
  transition: transform .2s var(--ease);
}
.btn:hover::after { transform: translateX(4px); }
.btn-primary { background: var(--blue); color: var(--white); border-color: var(--blue); }
.btn-primary:hover { background: var(--blue-120); border-color: var(--blue-120); color: var(--white); }
.btn-primary:active { background: var(--blue-140); }
.btn-outline { background: transparent; color: var(--blue); border-color: var(--blue); }
.btn-outline:hover { background: var(--blue); color: var(--white); }
.btn-light { background: var(--white); color: var(--blue); border-color: var(--white); }
.btn-light:hover { background: var(--sky); color: var(--blue-140); border-color: var(--sky); }
.btn-ghost { background: transparent; color: var(--white); border-color: rgba(255,255,255,.6); }
.btn-ghost:hover { background: var(--white); color: var(--blue); }

.link-arrow {
  display: inline-flex; align-items: center; gap: 8px; font-weight: 500; text-decoration: none; color: var(--blue);
}
.link-arrow::after {
  content: ""; width: 16px; height: 10px; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 12'%3E%3Cpath d='M0 6h16M11 1l5 5-5 5' fill='none' stroke='black' stroke-width='1.6'/%3E%3C/svg%3E") center/contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 12'%3E%3Cpath d='M0 6h16M11 1l5 5-5 5' fill='none' stroke='black' stroke-width='1.6'/%3E%3C/svg%3E") center/contain no-repeat;
  transition: transform .2s var(--ease);
}
.link-arrow:hover { text-decoration: underline; color: var(--blue-120); }
.link-arrow:hover::after { transform: translateX(3px); }

/* ---------- Utility bar (GUST global navigation row) ---------- */
.utility-bar { background: var(--midnight); color: #c9d2d3; font-size: .8125rem; }
.utility-bar .container { display: flex; justify-content: space-between; align-items: center; gap: 16px; min-height: 38px; }
.utility-bar ul { list-style: none; display: flex; gap: 22px; margin: 0; padding: 0; }
.utility-bar a { color: var(--white); text-decoration: none; }
.utility-bar a:hover { color: var(--ocean); text-decoration: underline; }
@media (max-width: 760px) { .utility-bar .u-text { display: none; } .utility-bar .container { justify-content: flex-end; } .utility-bar ul { gap: 16px; } }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100; background: var(--white);
  border-bottom: 1px solid var(--line); transition: box-shadow .2s;
}
.site-header.scrolled { box-shadow: 0 6px 24px rgba(5,27,30,.08); }
.header-row { display: flex; align-items: center; gap: 28px; height: var(--header-h); }
.brand { display: flex; flex-direction: column; text-decoration: none; color: var(--midnight); line-height: 1; }
.wordmark { display: inline-flex; align-items: center; font-family: var(--sans); font-weight: 700; font-size: 1.9rem; letter-spacing: .02em; color: var(--midnight); }
.wm-o { width: .95em; height: .95em; margin: 0 .03em; }
.header-affil { display: flex; align-items: center; padding-left: 24px; border-left: 1px solid var(--line); height: 44px; }
.header-affil img { height: 40px; width: auto; }
.nav { margin-left: auto; }
.nav > ul { list-style: none; display: flex; align-items: center; gap: 4px; margin: 0; padding: 0; }
.nav-link {
  display: flex; align-items: center; gap: 6px; height: var(--header-h); padding: 0 14px;
  font: 500 1rem/1 var(--sans); color: var(--midnight); text-decoration: none;
  background: none; border: 0; cursor: pointer; position: relative;
}
.nav-link::before {
  content: ""; position: absolute; left: 14px; right: 14px; bottom: -1px; height: 3px;
  background: var(--blue); transform: scaleX(0); transform-origin: left; transition: transform .25s var(--ease);
}
.nav-link:hover, .nav-link[aria-current="page"], .has-menu:hover > .nav-link { color: var(--blue); }
.nav-link:hover::before, .nav-link[aria-current="page"]::before { transform: scaleX(1); }
.caret { width: 10px; height: 10px; transition: transform .2s; }
.has-menu { position: relative; }
.has-menu:hover .caret, .has-menu.open .caret { transform: rotate(180deg); }
.submenu {
  position: absolute; top: 100%; left: 0; min-width: 300px; background: var(--white);
  border-top: 3px solid var(--blue); box-shadow: 0 18px 40px rgba(5,27,30,.14);
  list-style: none; margin: 0; padding: 12px 0;
  opacity: 0; visibility: hidden; transform: translateY(8px); transition: opacity .2s, transform .2s, visibility .2s;
}
.has-menu:hover .submenu, .has-menu:focus-within .submenu, .has-menu.open .submenu { opacity: 1; visibility: visible; transform: none; }
.submenu a {
  display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 11px 24px;
  font-family: var(--serif); font-size: 1.1rem; color: var(--midnight); text-decoration: none;
}
.submenu a:hover { background: var(--grey-light); color: var(--blue); }
.submenu a::after { content: "→"; font-family: var(--sans); color: var(--blue); opacity: 0; transform: translateX(-4px); transition: .2s; }
.submenu a:hover::after { opacity: 1; transform: none; }
.submenu .sep { border-top: 1px solid var(--line); margin: 8px 0; }
.header-cta { padding: 13px 18px; }
.nav-toggle {
  display: none; width: 48px; height: 48px; background: var(--blue); border: 0; cursor: pointer;
  align-items: center; justify-content: center; flex-direction: column; gap: 5px; margin-left: auto;
}
.nav-toggle span { display: block; width: 20px; height: 2px; background: var(--white); transition: transform .25s, opacity .2s; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 1100px) { .header-cta { display: none; } }
@media (max-width: 960px) {
  :root { --header-h: 72px; }
  .header-affil { display: none; }
  .nav-toggle { display: flex; }
  .nav {
    position: absolute; top: 100%; left: 0; right: 0; height: calc(100vh - var(--header-h)); background: var(--white);
    padding: 12px var(--gutter) 80px; overflow-y: auto; border-top: 1px solid var(--line);
    transform: translateX(100%); visibility: hidden; transition: transform .3s var(--ease), visibility .3s;
  }
  .nav.open { transform: none; visibility: visible; }
  .nav > ul { flex-direction: column; align-items: stretch; gap: 0; }
  .nav-link { height: auto; padding: 18px 0; font-family: var(--serif); font-size: 1.5rem; border-bottom: 1px solid var(--line); width: 100%; justify-content: space-between; }
  .nav-link::before { display: none; }
  .submenu { position: static; opacity: 1; visibility: visible; transform: none; box-shadow: none; border: 0; padding: 0 0 8px; display: none; min-width: 0; }
  .has-menu.open .submenu { display: block; }
  .has-menu:hover .caret { transform: none; }
  .has-menu.open .caret { transform: rotate(180deg); }
  .submenu a { padding: 12px 0 12px 16px; font-size: 1.1rem; }
  .nav .mobile-cta { display: flex; margin-top: 28px; justify-content: space-between; }
}
.nav .mobile-cta { display: none; }

/* ---------- Home hero carousel ---------- */
.hero { position: relative; overflow: hidden; background: var(--midnight); color: var(--white); min-height: clamp(540px, 78vh, 720px); isolation: isolate; }
.hero-bg, .hero-bg img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero-bg { z-index: -2; will-change: transform; transform: translateZ(0); }
.hero-bg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(5,27,30,.82) 0%, rgba(5,27,30,.45) 55%, rgba(5,27,30,.15) 100%); }
.slides { position: relative; min-height: inherit; }
/* Every slide stays painted on its own compositor layer and is faded by opacity only,
   so a switch never has to repaint or decode anything (no visibility toggling). */
.slide {
  position: absolute; inset: 0; display: flex; align-items: center;
  opacity: 0; pointer-events: none; transition: opacity .9s var(--ease);
  will-change: opacity; transform: translateZ(0);
}
.slide.is-active { opacity: 1; pointer-events: auto; z-index: 1; }
.slide-media { position: absolute; inset: 0; z-index: -1; }
.slide-media img { width: 100%; height: 100%; object-fit: cover; }
.slide-media.city::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(5,27,30,.88) 0%, rgba(5,27,30,.55) 50%, rgba(5,27,30,.1) 100%); }
.slide-media.city img { transform: scale(1.06); transition: transform 8s linear; will-change: transform; }
.slide.is-active .slide-media.city img { transform: scale(1); }
.slide-inner { width: 100%; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 48px; align-items: center; padding-bottom: 72px; }
.slide-copy { max-width: 660px; }
.slide-copy > * { opacity: 0; transform: translateY(18px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.slide.is-active .slide-copy > * { opacity: 1; transform: none; }
.slide.is-active .slide-copy > :nth-child(2) { transition-delay: .1s; }
.slide.is-active .slide-copy > :nth-child(3) { transition-delay: .2s; }
.slide.is-active .slide-copy > :nth-child(4) { transition-delay: .3s; }
.slide .eyebrow { color: var(--ocean); }
.slide-title { color: var(--white); font-size: clamp(2.3rem, 5.4vw, 4.25rem); line-height: 1.05; margin-bottom: 20px; }
.slide-text { font-size: clamp(1.05rem, 1.6vw, 1.25rem); color: #dfe6e7; max-width: 52ch; margin-bottom: 32px; }
.slide-figure { position: relative; width: clamp(170px, 20vw, 250px); margin: 0; }
.slide-figure::before { content: ""; position: absolute; inset: 22px -22px -22px 22px; background: var(--blue); z-index: -1; }
.slide-figure img { width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; }
.slide-figure figcaption { position: absolute; left: 0; bottom: 0; background: var(--white); color: var(--midnight); font-size: .8rem; padding: 8px 12px; font-weight: 500; }
.slide-badge { background: var(--white); padding: 22px 26px; width: clamp(180px, 20vw, 260px); }
.slide-badge img { width: 100%; height: auto; }
.slide-badge span { display: block; color: var(--midnight); font-size: .75rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; margin-bottom: 10px; }

.hero-controls { position: absolute; left: 0; right: 0; bottom: 28px; z-index: 5; }
.hero-controls .container { display: flex; align-items: center; gap: 18px; }
.dots { display: flex; gap: 10px; flex: 1; max-width: 360px; }
.dot { flex: 1; height: 28px; padding: 0; background: none; border: 0; cursor: pointer; position: relative; }
.dot::before, .dot i { content: ""; position: absolute; left: 0; right: 0; top: 13px; height: 2px; background: rgba(255,255,255,.35); }
/* Progress is drawn with transform (compositor only) and set from the slideshow clock in main.js */
.dot i { background: var(--white); transform: scaleX(0); transform-origin: left center; will-change: transform; }
@media (max-width: 760px) {
  .hero { min-height: 600px; }
  .slide { align-items: flex-end; }
  .slide-inner { grid-template-columns: 1fr; gap: 24px; padding-bottom: 100px; }
  .slide-figure { width: 110px; order: -1; }
  .slide-figure::before { inset: 10px -10px -10px 10px; }
  .slide-figure figcaption { display: none; }
  .slide-badge { order: -1; width: 160px; padding: 14px 16px; }
  .hero-bg::after, .slide-media.city::after { background: linear-gradient(0deg, rgba(5,27,30,.92) 0%, rgba(5,27,30,.6) 60%, rgba(5,27,30,.35) 100%); }
}

/* ---------- Intro / stats (GUST "informational block") ---------- */
.intro { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 6vw, 96px); align-items: start; }
.intro h2 { margin-bottom: 0; }
.intro p { color: var(--ink-soft); font-size: 1.0625rem; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); margin-top: clamp(40px, 6vw, 72px); }
.stat { padding: 28px 24px 4px 0; border-right: 1px solid var(--line); margin-right: 24px; }
.stat:last-child { border-right: 0; margin-right: 0; }
.stat .lbl { display: block; font-size: .75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--midnight); }
.stat .num { display: block; font-family: var(--serif); font-size: clamp(2.6rem, 5vw, 3.5rem); line-height: 1.1; color: var(--blue); letter-spacing: -.03em; margin-top: 8px; }
@media (max-width: 860px) { .intro { grid-template-columns: 1fr; } .stats { grid-template-columns: 1fr 1fr; } .stat:nth-child(2) { border-right: 0; margin-right: 0; } .stat:nth-child(n+3) { border-top: 1px solid var(--line); } }

/* ---------- Section heading row ---------- */
.section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; margin-bottom: clamp(28px, 4vw, 48px); }
.section-head h2 { margin: 0; max-width: 20ch; }
.section-head p { margin: 12px 0 0; color: var(--ink-soft); max-width: 60ch; }

/* ---------- Area cards ---------- */
.grid { display: grid; gap: 24px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 960px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

.area-card {
  position: relative; display: flex; flex-direction: column; padding: 32px 28px 28px; background: var(--white);
  border: 1px solid var(--line); text-decoration: none; color: var(--ink); min-height: 260px;
  transition: background-color .3s, border-color .3s, color .3s;
}
.area-card .num { font-family: var(--serif); font-size: 1rem; color: var(--blue); margin-bottom: 28px; }
.area-card h3 { margin-bottom: 12px; transition: color .3s; }
.area-card p { color: var(--ink-soft); font-size: .95rem; margin-bottom: 24px; transition: color .3s; }
.area-card .link-arrow { margin-top: auto; }
a.area-card:hover { background: var(--blue); border-color: var(--blue); }
a.area-card:hover h3, a.area-card:hover p, a.area-card:hover .num, a.area-card:hover .link-arrow { color: var(--white); }

.card { background: var(--white); border: 1px solid var(--line); padding: 28px; }
.card h3 { font-size: 1.3rem; margin-bottom: 10px; }
.card p { color: var(--ink-soft); font-size: .95rem; }
.card p:last-child { margin-bottom: 0; }
.card ul { padding-left: 1.1em; margin: .4em 0 0; color: var(--ink-soft); font-size: .94rem; }
.card ul li { margin-bottom: .35em; }
.card ul li::marker { color: var(--blue); }

.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.tag {
  display: inline-block; font-size: .625rem; line-height: 1rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: var(--blue); border: 1px solid var(--blue); padding: 3px 8px; white-space: nowrap;
}
.tag.solid { background: var(--blue); color: var(--white); }

/* ---------- Research area (detailed) ---------- */
.area-detail { display: grid; grid-template-columns: 80px minmax(0, 1fr) minmax(0, .8fr); gap: 32px; padding: 40px 0; border-top: 1px solid var(--line); }
.area-detail:last-child { border-bottom: 1px solid var(--line); }
.area-detail .num { font-family: var(--serif); font-size: 2.5rem; color: var(--blue); line-height: 1; }
.area-detail h3 { font-size: clamp(1.5rem, 2.4vw, 2rem); }
.area-detail p { color: var(--ink-soft); }
.area-detail ul { list-style: none; padding: 0; margin: 0; }
.area-detail li { padding: 10px 0 10px 22px; border-bottom: 1px solid var(--line); position: relative; font-size: .95rem; }
.area-detail li::before { content: ""; position: absolute; left: 0; top: 18px; width: 8px; height: 8px; background: var(--blue); }
.area-detail .side-label { font-size: .75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 6px; }
@media (max-width: 900px) { .area-detail { grid-template-columns: 1fr; gap: 16px; } }

/* ---------- Group lead (GUST banner: image with offset colour block) ---------- */
.lead-block { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: clamp(40px, 7vw, 112px); align-items: start; }
.lead-photo { position: relative; margin: 0 22px 22px 0; }
.lead-photo::after { content: ""; position: absolute; inset: 22px -22px -22px 22px; background: var(--blue); z-index: -1; }
.lead-photo img { width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; position: relative; }
.lead-block .role { color: var(--blue); font-weight: 500; margin-bottom: 20px; }
.lead-block p { color: var(--ink-soft); }
.timeline { list-style: none; padding: 0; margin: 28px 0 0; font-size: .95rem; border-top: 1px solid var(--line); }
.timeline li { display: grid; grid-template-columns: 120px 1fr; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.timeline li span:first-child { color: var(--blue); font-weight: 600; font-variant-numeric: tabular-nums; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.btn-row .btn { padding: 12px 18px; }
@media (max-width: 860px) { .lead-block { grid-template-columns: 1fr; } .lead-photo { max-width: 160px; } }

/* ---------- News cards with date blocks ---------- */
.news-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.news-card {
  display: flex; flex-direction: column; gap: 16px; padding: 28px 24px; min-height: 280px;
  border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--white);
  text-decoration: none; color: var(--ink); transition: background-color .3s, color .3s;
}
.news-card .date { display: flex; align-items: baseline; gap: 10px; }
.news-card .day { font-family: var(--serif); font-size: 2.5rem; line-height: 1; color: var(--blue); letter-spacing: -.02em; transition: color .3s; }
.news-card .yr { font-size: .625rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.news-card h3 { font-size: 1.25rem; margin: 0; transition: color .3s; }
.news-card p { font-size: .9rem; color: var(--ink-soft); margin: 0; transition: color .3s; }
.news-card .tags { margin-top: auto; }
a.news-card:hover { background: var(--blue); color: var(--white); }
a.news-card:hover .day, a.news-card:hover h3, a.news-card:hover p { color: var(--white); }
a.news-card:hover .tag { color: var(--white); border-color: var(--white); }
@media (max-width: 1024px) { .news-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .news-grid { grid-template-columns: 1fr; } .news-card { min-height: 0; } }

/* ---------- Publications ---------- */
.pub { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 24px; padding: 22px 0; border-bottom: 1px solid var(--line); }
.pub .type { justify-self: start; height: fit-content; }
.pub .title { font-family: var(--serif); font-size: 1.25rem; line-height: 1.3; color: var(--midnight); display: block; margin-bottom: 6px; letter-spacing: -.01em; }
.pub a.title { text-decoration: none; }
.pub a.title:hover { color: var(--blue); text-decoration: underline; }
.pub .authors { font-size: .92rem; color: var(--ink-soft); }
.pub .authors b { color: var(--midnight); font-weight: 600; }
.pub .venue { font-size: .92rem; font-style: italic; color: var(--ink-soft); }
.type.journal { background: var(--blue); color: var(--white); }
.type.review { color: var(--midnight-80); border-color: var(--midnight-80); }
.type.patent { color: var(--midnight); border-color: var(--midnight); background: var(--ocean); }
@media (max-width: 600px) { .pub { grid-template-columns: 1fr; gap: 10px; } }

.pub-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 56px; align-items: start; }
.pub-aside { position: sticky; top: calc(var(--header-h) + 24px); }
.pub-aside p { line-height: 2; }
.pub-aside h2 { font-family: var(--sans); font-size: .75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; margin: 0 0 12px; color: var(--midnight); }
.year-nav { list-style: none; padding: 0; margin: 0 0 32px; border-left: 1px solid var(--line); }
.year-nav a { display: flex; justify-content: space-between; padding: 7px 0 7px 16px; text-decoration: none; color: var(--ink-soft); font-family: var(--serif); font-size: 1.2rem; margin-left: -1px; border-left: 2px solid transparent; }
.year-nav a small { font-family: var(--sans); font-size: .75rem; color: var(--ink-soft); align-self: center; }
.year-nav a:hover, .year-nav a.active { color: var(--blue); border-left-color: var(--blue); }
.pub-toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 8px; padding-bottom: 20px; border-bottom: 1px solid var(--midnight); }
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.filter {
  font: 500 .8125rem/1 var(--sans); letter-spacing: .04em; text-transform: uppercase; padding: 11px 14px;
  border: 1px solid var(--line); background: var(--white); color: var(--midnight); cursor: pointer; transition: .2s;
}
.filter:hover { border-color: var(--blue); color: var(--blue); }
.filter[aria-pressed="true"] { background: var(--blue); color: var(--white); border-color: var(--blue); }
.filter .n { opacity: .7; margin-left: 4px; }
.search-wrap { position: relative; flex: 1; min-width: 220px; max-width: 320px; }
.search-wrap svg { position: absolute; left: 14px; top: 50%; width: 16px; height: 16px; transform: translateY(-50%); color: var(--ink-soft); }
.search { width: 100%; font: inherit; font-size: .95rem; padding: 11px 14px 11px 40px; border: 1px solid var(--line); border-radius: 0; background: var(--white); color: var(--ink); }
.search:focus { outline: 2px solid var(--blue); outline-offset: -1px; border-color: var(--blue); }
.pub-count { font-size: .875rem; color: var(--ink-soft); margin: 14px 0 0; }
.pub-year { font-size: clamp(2rem, 3vw, 2.5rem); color: var(--blue); margin: 48px 0 0; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.pub-group:first-child .pub-year { margin-top: 20px; }
.empty { color: var(--ink-soft); padding: 32px 0; }
@media (max-width: 900px) { .pub-layout { grid-template-columns: 1fr; gap: 0; } .pub-aside { position: static; } .year-nav { display: flex; flex-wrap: wrap; border: 0; gap: 4px 16px; } .year-nav a { padding: 4px 0; border: 0; } .year-nav a small { display: none; } }
@media (max-width: 640px) { .search-wrap { max-width: none; } }

/* ---------- Page banner (sub-pages) ---------- */
.page-banner { position: relative; background: var(--midnight); color: var(--white); padding: clamp(56px, 8vw, 96px) 0 clamp(48px, 7vw, 80px); overflow: hidden; isolation: isolate; }
.page-banner .bg { position: absolute; inset: 0; z-index: -1; }
.page-banner .bg img { width: 100%; height: 100%; object-fit: cover; opacity: .55; }
.page-banner .bg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(5,27,30,.92) 0%, rgba(5,27,30,.6) 60%, rgba(5,27,30,.3) 100%); }
.page-banner h1 { color: var(--white); max-width: 20ch; margin-bottom: 18px; }
.page-banner .lead { color: #dfe6e7; }
.page-banner .lead a { color: var(--white); }
.page-banner .lead a:hover { color: var(--ocean); }
.crumbs { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 0 0 24px; font-size: .8125rem; color: #c9d2d3; }
.crumbs li + li::before { content: "/"; margin-right: 8px; color: #7d8b8d; }
.crumbs a { color: var(--white); text-decoration: none; }
.crumbs a:hover { color: var(--ocean); text-decoration: underline; }
.facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; margin-top: 40px; border-top: 1px solid rgba(255,255,255,.25); }
.facts div { padding: 18px 20px 0 0; }
.facts dt { font-size: .7rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ocean); margin-bottom: 4px; }
.facts dd { margin: 0; font-size: .95rem; color: var(--white); }
@media (max-width: 860px) { .facts { grid-template-columns: 1fr 1fr; gap: 0 16px; } }

/* ---------- In-page sub-navigation (sticky) ---------- */
.subnav { position: sticky; top: var(--header-h); z-index: 50; background: var(--white); border-bottom: 1px solid var(--line); }
.subnav ul { list-style: none; display: flex; gap: 4px; margin: 0; padding: 0; overflow-x: auto; scrollbar-width: none; }
.subnav ul::-webkit-scrollbar { display: none; }
.subnav a { display: block; padding: 18px 14px; white-space: nowrap; font-size: .9rem; font-weight: 500; color: var(--ink-soft); text-decoration: none; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.subnav a:hover { color: var(--blue); }
.subnav a.active { color: var(--blue); border-bottom-color: var(--blue); }

/* ---------- Projects ---------- */
.project { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 40px; padding: 40px 0; border-top: 1px solid var(--line); }
.project:last-child { border-bottom: 1px solid var(--line); }
.project .meta { font-size: .9rem; color: var(--ink-soft); }
.project .meta .funder { height: 52px; width: auto; margin-bottom: 14px; }
.project .meta strong { display: block; color: var(--midnight); font-size: .95rem; margin-bottom: 2px; }
.project .meta .period { display: block; font-family: var(--serif); font-size: 1.35rem; color: var(--blue); margin: 6px 0 10px; }
.project h3 { font-size: clamp(1.35rem, 2.2vw, 1.75rem); margin-bottom: 14px; }
.project p { color: var(--ink-soft); }
.project ul { color: var(--ink-soft); padding-left: 1.1em; margin: 0 0 1em; }
.project ul li::marker { color: var(--blue); }
.team-line { font-size: .9rem; color: var(--ink-soft); border-left: 3px solid var(--blue); padding: 4px 0 4px 14px; margin: 18px 0; }
.team-line b { color: var(--midnight); font-weight: 600; }
@media (max-width: 760px) { .project { grid-template-columns: 1fr; gap: 12px; } }

.funder-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; }
.funder-head img { height: 72px; width: auto; }

/* ---------- People ---------- */
.person { display: flex; flex-direction: column; }
.person .avatar { aspect-ratio: 1; background: var(--grey-bg); overflow: hidden; margin-bottom: 18px; }
.person .avatar img { width: 100%; height: 100%; object-fit: cover; }
.person h3 { font-size: 1.35rem; margin-bottom: 4px; }
.person .role { font-size: .85rem; color: var(--blue); font-weight: 600; margin-bottom: 10px; }
.person p { font-size: .92rem; color: var(--ink-soft); margin: 0 0 10px; }
.person .tags { margin-top: auto; padding-top: 6px; }

.collab { display: flex; gap: 18px; align-items: flex-start; padding: 24px; border: 1px solid var(--line); background: var(--white); }
.collab .init { flex: none; width: 52px; height: 52px; background: var(--blue); color: var(--white); font-family: var(--serif); font-size: 1.15rem; display: grid; place-items: center; }
img.init { object-fit: cover; background: var(--grey-bg); }
.collab .init { position: relative; overflow: hidden; }
#partners .collab .init { width: 72px; height: 72px; }
.collab .init img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: var(--grey-bg); }
.collab h3 { font-size: 1.2rem; margin: 2px 0 4px; }
.collab .org { font-size: .8rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--midnight-80); margin-bottom: 6px; }
.collab p { font-size: .92rem; color: var(--ink-soft); margin: 0; }

.lead-strip { display: flex; align-items: center; gap: 24px; padding: 20px; border: 1px solid var(--line); background: var(--white); text-decoration: none; color: var(--ink); margin-bottom: 40px; transition: border-color .2s; }
.lead-strip:hover { border-color: var(--blue); color: var(--ink); }
.lead-strip img { width: 80px; height: 100px; flex: none; object-fit: cover; }
.lead-strip strong { display: block; font-family: var(--serif); font-weight: 400; font-size: 1.5rem; color: var(--midnight); }
.lead-strip div span { color: var(--ink-soft); font-size: .92rem; }
.lead-strip .link-arrow { margin-left: auto; white-space: nowrap; }
@media (max-width: 560px) { .lead-strip { flex-wrap: wrap; } .lead-strip .link-arrow { margin-left: 0; } }
.subhead { font-family: var(--sans); font-size: .75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--midnight); margin: 0 0 20px; }

/* ---------- Patents / methods ---------- */
.patent { border-top: 3px solid var(--blue); }
.patent .num { font-family: var(--serif); color: var(--blue); font-size: 1rem; margin-bottom: 8px; display: block; }
.method { border-top: 1px solid var(--midnight); padding-top: 20px; }
.method h3 { font-size: 1.35rem; }
.method p { color: var(--ink-soft); font-size: .95rem; }

/* ---------- IoT security project ---------- */
.split { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: clamp(32px, 6vw, 80px); align-items: start; }
.split-even { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
@media (max-width: 900px) { .split, .split-even { grid-template-columns: 1fr; } }
.panel { background: var(--grey-light); padding: 32px; border-top: 3px solid var(--blue); }
.panel h3 { font-family: var(--sans); font-size: .75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 16px; }
.panel dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 0 20px; font-size: .95rem; }
.panel dt, .panel dd { padding: 10px 0; border-bottom: 1px solid var(--line); }
.panel dt { color: var(--ink-soft); }
.panel dd { margin: 0; color: var(--midnight); font-weight: 500; }

.rq-list { counter-reset: rq; list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.rq-list li { counter-increment: rq; padding: 28px; background: var(--white); border: 1px solid var(--line); }
.rq-list li::before { content: "RQ" counter(rq); display: block; font-family: var(--serif); font-size: 2rem; color: var(--blue); line-height: 1; margin-bottom: 16px; }
.rq-list strong { display: block; font-family: var(--serif); font-weight: 400; font-size: 1.3rem; color: var(--midnight); margin-bottom: 8px; }
.rq-list p { margin: 0; color: var(--ink-soft); font-size: .95rem; }
@media (max-width: 760px) { .rq-list { grid-template-columns: 1fr; } }

.pipeline { list-style: none; padding: 0; margin: 40px 0 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); counter-reset: st; }
.pipeline li { position: relative; padding: 0 20px 0 0; counter-increment: st; }
.pipeline li::before { content: ""; display: block; height: 2px; background: var(--blue); margin-bottom: 20px; }
.pipeline li::after { content: ""; position: absolute; top: -5px; left: 0; width: 12px; height: 12px; background: var(--blue); }
.pipeline .abbr { font-family: var(--serif); color: var(--blue); font-size: 1.6rem; line-height: 1; margin-bottom: 8px; }
.pipeline h3 { font-family: var(--sans); font-size: .95rem; font-weight: 600; letter-spacing: 0; margin: 0 0 6px; }
.pipeline p { font-size: .88rem; color: var(--ink-soft); margin: 0; }
@media (max-width: 960px) { .pipeline { grid-template-columns: 1fr 1fr; row-gap: 32px; } }
@media (max-width: 560px) { .pipeline { grid-template-columns: 1fr; } }

.figure { background: var(--white); border: 1px solid var(--line); padding: 24px; margin: 0; }
.figure svg { width: 100%; height: auto; display: block; }
.figure figcaption { font-size: .85rem; color: var(--ink-soft); margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.stack h3 { font-size: 1.4rem; margin-top: 28px; }
.stack h3:first-child { margin-top: 0; }
.stack p { color: var(--ink-soft); }

.table-wrap { overflow-x: auto; }
.kpis { width: 100%; border-collapse: collapse; font-size: .94rem; background: var(--white); }
.kpis th, .kpis td { text-align: left; padding: 14px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
.kpis th { background: var(--midnight); color: var(--white); font-weight: 600; font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; }
.kpis td:first-child { color: var(--blue); font-weight: 600; white-space: nowrap; }
.kpis td:last-child { font-family: var(--serif); font-size: 1.1rem; color: var(--midnight); white-space: nowrap; }
@media (max-width: 640px) { .kpis td:first-child, .kpis td:last-child { white-space: normal; } .kpis th, .kpis td { padding: 10px; } }

.deliv { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--line); }
.deliv li { display: flex; gap: 16px; align-items: baseline; padding: 14px 0; border-bottom: 1px solid var(--line); font-size: .97rem; }
.deliv li::before { content: ""; flex: none; width: 8px; height: 8px; background: var(--blue); transform: translateY(-1px); }

.phases { list-style: none; padding: 0; margin: 0; border-left: 1px solid var(--line); }
.phases li { position: relative; padding: 0 0 32px 32px; }
.phases li:last-child { padding-bottom: 0; }
.phases li::before { content: ""; position: absolute; left: -7px; top: 4px; width: 13px; height: 13px; background: var(--white); border: 2px solid var(--blue); }
.phases li.now::before { background: var(--blue); box-shadow: 0 0 0 5px var(--blue-10); }
.phases .when { font-size: .75rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-soft); }
.phases .now-tag { margin-left: 8px; }
.phases h3 { font-size: 1.3rem; margin: 6px 0 6px; }
.phases p { margin: 0; font-size: .94rem; color: var(--ink-soft); }
.phases p.gate { font-size: .875rem; margin-top: 8px; padding: 8px 12px; background: var(--grey-light); }
.phases p.gate b { color: var(--blue); }

.ack { display: flex; align-items: center; gap: 18px; margin-top: 32px; padding: 20px; border: 1px solid var(--line); font-size: .9rem; color: var(--ink-soft); }
.ack img { height: 52px; width: auto; flex: none; }

/* ---------- Partners strip (GUST accreditation row) ---------- */
/* Partners: one compact band of equal-height logo tiles, grouped by role */
.partners-section { padding-block: clamp(40px, 5vw, 56px); }
.partners-head { display: flex; align-items: baseline; gap: 8px 20px; flex-wrap: wrap; margin-bottom: 20px; }
.partners-head .eyebrow { order: 2; margin: 0; }
.partners-head h2 { margin: 0; font-size: clamp(1.6rem, 2.6vw, 2.1rem); }
.partner-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.partner-group { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.partner-group .lbl { font-size: .6875rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--midnight-80); }
.tiles { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); flex: 1; }
.tile { display: flex; align-items: center; justify-content: center; gap: 28px; padding: 32px 24px; min-height: 190px; background: var(--white); text-decoration: none; transition: background-color .2s; }
.tile:hover { background: var(--blue-10); }
/* Logos differ in shape, so each gets a height that makes them look the same size */
.tile img { height: 30px; width: auto; max-width: 100%; object-fit: contain; }
.tile img.logo-tall { height: 50px; }
.tile-wide img { height: 76px; }
.tile img[src*="mcgill"] { height: 28px; }
.tile img[src*="uottawa"] { height: 24px; }
.tile img[src*="usc"] { height: 34px; }
.tile img[src*="kfas"] { height: 100px; }
.dept-mark { font-family: var(--serif); font-size: 1.5rem; line-height: 1.2; color: var(--midnight); padding-left: 24px; border-left: 1px solid var(--line); }
@media (max-width: 560px) {
  .partner-grid { grid-template-columns: 1fr; }
  .tile { min-height: 130px; gap: 18px; padding: 24px 16px; }
  .tile-wide img { height: 54px; }
  .tile img[src*="kfas"] { height: 76px; }
  .dept-mark { font-size: 1.1rem; }
}

/* ---------- CTA banner ---------- */
.cta-band { background: var(--blue); color: var(--white); padding-block: clamp(56px, 7vw, 88px); position: relative; overflow: hidden; }
.cta-band::after { content: ""; position: absolute; right: -160px; top: -160px; width: 320px; height: 320px; border: 1px solid rgba(255,255,255,.25); }
.cta-band::before { content: ""; position: absolute; right: -100px; top: -100px; width: 200px; height: 200px; border: 1px solid rgba(255,255,255,.18); }
.cta-band .container { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 32px; align-items: end; position: relative; z-index: 1; }
.cta-band h2 { color: var(--white); margin-bottom: 14px; }
.cta-band p { color: #dfe3ff; margin: 0; max-width: 60ch; font-size: 1.0625rem; }
.cta-band a:not(.btn) { color: var(--white); }
@media (max-width: 760px) { .cta-band .container { grid-template-columns: 1fr; } }

/* ---------- Footer ---------- */
.site-footer { background: var(--midnight); color: #c9d2d3; padding: clamp(56px, 7vw, 80px) 0 32px; font-size: .9375rem; }
.site-footer a { color: var(--white); text-decoration: none; }
.site-footer a:hover { color: var(--ocean); text-decoration: underline; }
.footer-top { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 40px; }
.footer-brand .wordmark { color: var(--white); font-size: 1.7rem; }
.footer-brand p { margin-top: 18px; max-width: 34ch; }
.footer-label { color: #6d83ff; font-size: .875rem; font-weight: 500; margin: 0 0 16px; font-family: var(--sans); letter-spacing: 0; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 10px; }
.footer-logos { display: flex; gap: 20px; align-items: center; margin-top: 24px; }
.footer-logos a { background: var(--white); padding: 10px 14px; display: block; }
.footer-logos img { height: 36px; width: auto; }
.footer-bottom { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; border-top: 1px solid rgba(255,255,255,.14); margin-top: 48px; padding-top: 24px; font-size: .8125rem; }
@media (max-width: 960px) { .footer-top { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .footer-top { grid-template-columns: 1fr; } }

/* ---------- Scroll to top (GUST) ---------- */
.to-top {
  position: fixed; right: 20px; bottom: 20px; z-index: 90; width: 54px; height: 54px; display: grid; place-items: center;
  background: var(--white); color: var(--blue); border: 1px solid var(--blue); cursor: pointer;
  opacity: 0; visibility: hidden; transform: translateY(10px); transition: opacity .25s, transform .25s, visibility .25s, background .2s, color .2s;
}
.to-top.show { opacity: 1; visibility: visible; transform: none; }
.to-top:hover { background: var(--blue); color: var(--white); }
.to-top svg { width: 18px; height: 18px; }

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .5s var(--ease), transform .5s var(--ease); }
.reveal.instant { transition: none; }
.reveal.in { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .reveal { opacity: 1; transform: none; }
}

@media print {
  .utility-bar, .site-header, .hero-controls, .to-top, .subnav, .nav-toggle { display: none !important; }
  .hero, .page-banner { background: none; color: var(--ink); min-height: 0; }
  .slide { position: static; opacity: 1; visibility: visible; }
}
@media (max-width: 900px) { .pub-aside h2:nth-of-type(2), .pub-aside p { display: none; } }
.project-next { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 24px; }
.project-next .eyebrow { margin: 0; }
.project-next .link-arrow { font-family: var(--serif); font-size: 1.35rem; }
