/* ==========================================================================
   El Arbi Abdellaoui Alaoui — site design system
   main.css: tokens, base, layout, shared components (header, hero, footer)
   pages.css: page modules (publications, teaching, research, team)
   ========================================================================== */

/* ---------- Fonts (self-hosted, SIL OFL — see assets/fonts/LICENSE-*.txt) */
@font-face {
  font-family: "Fraunces";
  src: url("../fonts/fraunces-var.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("../fonts/inter-var.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* ---------- Design tokens ---------------------------------------------- */
:root {
  color-scheme: light;
  --font-sans:
    "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Fraunces", ui-serif, Georgia, Cambria, "Times New Roman", serif;
  --font-mono: ui-monospace, "SFMono-Regular", "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --c-bg: #f6f7f9;
  --c-surface: #ffffff;
  --c-surface-2: #eef2f6;
  --c-surface-3: #e3e9f0;
  --c-border: #dce3eb;
  --c-border-strong: #c3cfdb;
  --c-text: #0f1e2e;
  --c-text-2: #3c4e60;
  --c-text-3: #5a6c7e;
  --c-link: #0a6fa0;
  --c-brand: #0a7db2;
  --c-brand-strong: #075f88;
  --c-brand-soft: #e2f1f9;
  --c-on-brand: #ffffff;
  --c-accent: #e87722;
  --c-accent-text: #a64b08;
  --c-accent-soft: #fdeee2;
  --c-success: #157a3f;
  --c-success-soft: #e2f4e9;
  --c-mark: #ffe7a3;

  /* Always-dark "ink" band used by heroes, CTA and footer */
  --c-ink: #07131f;
  --c-ink-2: #0c1e30;
  --c-ink-3: #12304a;
  --c-on-ink: #eaf2fa;
  --c-on-ink-2: #a9bdd0;
  --c-on-ink-brand: #5cc4f2;
  --c-on-ink-accent: #ff9a4d;

  /* Chart series (validated: light surface #fff) */
  --series-journal: #0a7db2;
  --series-chapter: #e87722;
  --series-conference: #6250d6;
  --series-book: #1baf7a;

  /* Research-area accents (decorative) */
  --area-ml: #0a7db2;
  --area-xai: #6250d6;
  --area-networks: #0e8f84;
  --area-smart: #d9661a;
  --area-game: #c53d70;
  --area-security: #1b7f45;

  --shadow-sm: 0 1px 2px rgb(15 30 46 / 0.06), 0 1px 3px rgb(15 30 46 / 0.08);
  --shadow-md: 0 4px 10px -2px rgb(15 30 46 / 0.08), 0 12px 28px -8px rgb(15 30 46 / 0.14);
  --shadow-lg: 0 10px 24px -6px rgb(15 30 46 / 0.12), 0 32px 64px -20px rgb(15 30 46 / 0.28);

  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 24px;
  --radius-pill: 999px;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --container: 1180px;
  --gutter: clamp(16px, 4vw, 32px);
  --header-h: 72px;
  --header-h-compact: 64px; /* header height once scrolled */
  --section-pad: clamp(64px, 9vw, 120px);
}

/* Dark tokens, applied by OS preference unless the visitor chose light ... */
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
    --c-bg: #08111b;
    --c-surface: #0f1b2a;
    --c-surface-2: #142335;
    --c-surface-3: #1b2d43;
    --c-border: #1f3249;
    --c-border-strong: #2d4762;
    --c-text: #e8eef5;
    --c-text-2: #bac8d6;
    --c-text-3: #93a6b9;
    --c-link: #62bfea;
    --c-brand: #2a9bd4;
    --c-brand-strong: #74c8ef;
    --c-brand-soft: #0f2a3f;
    --c-on-brand: #04121d;
    --c-accent: #f08a3c;
    --c-accent-text: #ffa465;
    --c-accent-soft: #35210f;
    --c-success: #4cc483;
    --c-success-soft: #10301f;
    --c-mark: #5a4512;
    --c-ink: #050d16;
    --c-ink-2: #0a1726;
    --c-ink-3: #10283f;
    --series-journal: #2a9bd4;
    --series-chapter: #d96a22;
    --series-conference: #9085e9;
    --series-book: #199e70;
    --area-ml: #3fa9de;
    --area-xai: #9a8ff0;
    --area-networks: #2fbcae;
    --area-smart: #f08a3c;
    --area-game: #ec6c9c;
    --area-security: #4cc483;
    --shadow-sm: 0 1px 2px rgb(0 0 0 / 0.4);
    --shadow-md: 0 6px 16px -4px rgb(0 0 0 / 0.5);
    --shadow-lg: 0 18px 48px -12px rgb(0 0 0 / 0.65);
  }
}
/* ... and always when the visitor picked dark with the toggle. */
:root[data-theme="dark"] {
  color-scheme: dark;
  --c-bg: #08111b;
  --c-surface: #0f1b2a;
  --c-surface-2: #142335;
  --c-surface-3: #1b2d43;
  --c-border: #1f3249;
  --c-border-strong: #2d4762;
  --c-text: #e8eef5;
  --c-text-2: #bac8d6;
  --c-text-3: #93a6b9;
  --c-link: #62bfea;
  --c-brand: #2a9bd4;
  --c-brand-strong: #74c8ef;
  --c-brand-soft: #0f2a3f;
  --c-on-brand: #04121d;
  --c-accent: #f08a3c;
  --c-accent-text: #ffa465;
  --c-accent-soft: #35210f;
  --c-success: #4cc483;
  --c-success-soft: #10301f;
  --c-mark: #5a4512;
  --c-ink: #050d16;
  --c-ink-2: #0a1726;
  --c-ink-3: #10283f;
  --series-journal: #2a9bd4;
  --series-chapter: #d96a22;
  --series-conference: #9085e9;
  --series-book: #199e70;
  --area-ml: #3fa9de;
  --area-xai: #9a8ff0;
  --area-networks: #2fbcae;
  --area-smart: #f08a3c;
  --area-game: #ec6c9c;
  --area-security: #4cc483;
  --shadow-sm: 0 1px 2px rgb(0 0 0 / 0.4);
  --shadow-md: 0 6px 16px -4px rgb(0 0 0 / 0.5);
  --shadow-lg: 0 18px 48px -12px rgb(0 0 0 / 0.65);
}

/* ---------- Base ------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 16px);
}
@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}
body {
  margin: 0;
  min-height: 100vh;
  background: var(--c-bg);
  color: var(--c-text);
  font: 400 1.0625rem/1.65 var(--font-sans);
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}
img,
svg,
video,
canvas,
picture {
  display: block;
  max-width: 100%;
}
img {
  height: auto;
}
a {
  color: var(--c-link);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
a:hover {
  color: var(--c-brand-strong);
}
button {
  font: inherit;
  color: inherit;
}
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
p {
  margin: 0 0 1em;
}
h1,
h2,
h3,
h4 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.015em;
  font-optical-sizing: auto;
  text-wrap: balance;
  color: var(--c-text);
}
h3 {
  font-size: 1.25rem;
}
strong {
  font-weight: 650;
}
::selection {
  background: color-mix(in srgb, var(--c-accent) 35%, transparent);
}
:focus-visible {
  outline: 2px solid var(--c-accent);
  outline-offset: 3px;
  border-radius: 4px;
}
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
.skip-link {
  position: fixed;
  left: 16px;
  top: -100px;
  z-index: 1000;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  background: var(--c-accent);
  color: #111;
  font-weight: 600;
  text-decoration: none;
  transition: top 0.2s var(--ease-out);
}
.skip-link:focus {
  top: 12px;
}
.icon {
  width: 1.15em;
  height: 1.15em;
  flex: none;
  display: inline-block;
  vertical-align: -0.18em;
}

/* ---------- Layout ----------------------------------------------------- */
.container {
  width: min(100% - 2 * var(--gutter), var(--container));
  margin-inline: auto;
}
.section {
  padding-block: var(--section-pad);
  position: relative;
}
.section--tint {
  background: var(--c-surface-2);
}
.section--surface {
  background: var(--c-surface);
}
.section-head {
  display: grid;
  gap: 14px;
  max-width: 760px;
  margin-bottom: clamp(32px, 5vw, 56px);
}
.section-head--split {
  max-width: none;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 16px 32px;
}
.section-head--split > .section-head {
  margin-bottom: 0;
}
.section-head h2 {
  font-size: clamp(2rem, 1.35rem + 2.4vw, 3rem);
}
.section-head .lead {
  margin: 0;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font: 600 0.75rem/1 var(--font-mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--c-accent-text);
}
.eyebrow::before {
  content: "";
  width: 28px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
}
.lead {
  font-size: clamp(1.06rem, 1rem + 0.35vw, 1.2rem);
  color: var(--c-text-2);
  line-height: 1.6;
}
.muted {
  color: var(--c-text-3);
}
.grid {
  display: grid;
  gap: clamp(16px, 2vw, 24px);
}
.grid--2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.grid--3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
@media (max-width: 960px) {
  .grid--3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 640px) {
  .grid--2,
  .grid--3 {
    grid-template-columns: minmax(0, 1fr);
  }
  .section-head--split {
    grid-template-columns: 1fr;
  }
}

/* ---------- Buttons, chips, badges ------------------------------------ */
.btn {
  --btn-bg: var(--c-surface);
  --btn-fg: var(--c-text);
  --btn-bd: var(--c-border-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 22px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--btn-bd);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-weight: 600;
  font-size: 0.98rem;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition:
    transform 0.25s var(--ease-out),
    box-shadow 0.25s var(--ease-out),
    background-color 0.2s,
    border-color 0.2s,
    color 0.2s;
}
.btn:hover {
  color: var(--btn-fg);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.btn:active {
  transform: translateY(0);
}
.btn .icon {
  transition: transform 0.25s var(--ease-out);
}
.btn:hover .icon--nudge {
  transform: translateX(3px);
}
.btn:hover .icon--nudge-down {
  transform: translateY(2px);
}
.btn--primary {
  --btn-bg: var(--c-accent);
  --btn-fg: #1a0d02;
  --btn-bd: transparent;
}
.btn--primary:hover {
  --btn-bg: #f3893a;
}
.btn--brand {
  --btn-bg: var(--c-brand);
  --btn-fg: var(--c-on-brand);
  --btn-bd: transparent;
}
.btn--brand:hover {
  --btn-bg: var(--c-brand-strong);
}
.btn--ghost-ink {
  --btn-bg: rgb(255 255 255 / 0.06);
  --btn-fg: var(--c-on-ink);
  --btn-bd: rgb(255 255 255 / 0.22);
  backdrop-filter: blur(6px);
}
.btn--ghost-ink:hover {
  --btn-bg: rgb(255 255 255 / 0.12);
  --btn-bd: rgb(255 255 255 / 0.4);
}
.btn--sm {
  min-height: 38px;
  padding: 0 16px;
  font-size: 0.9rem;
  gap: 8px;
}
.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--c-border);
  background: var(--c-surface);
  color: var(--c-text-2);
  cursor: pointer;
  text-decoration: none;
  transition:
    transform 0.25s var(--ease-out),
    background-color 0.2s,
    color 0.2s,
    border-color 0.2s;
}
.icon-btn:hover {
  transform: translateY(-2px);
  color: var(--c-brand);
  border-color: var(--c-brand);
}
.icon-btn .icon {
  width: 20px;
  height: 20px;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 14px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--c-border);
  background: var(--c-surface);
  color: var(--c-text-2);
  font-size: 0.9rem;
  font-weight: 550;
  cursor: pointer;
  user-select: none;
  transition:
    background-color 0.2s,
    color 0.2s,
    border-color 0.2s,
    box-shadow 0.2s;
}
.chip:hover {
  border-color: var(--c-border-strong);
  color: var(--c-text);
}
.chip[aria-pressed="true"] {
  background: var(--c-text);
  border-color: var(--c-text);
  color: var(--c-bg);
}
.chip .count {
  font: 600 0.75rem/1 var(--font-mono);
  padding: 4px 7px;
  border-radius: var(--radius-pill);
  background: var(--c-surface-2);
  color: var(--c-text-3);
}
.chip[aria-pressed="true"] .count {
  background: color-mix(in srgb, var(--c-bg) 22%, transparent);
  color: var(--c-bg);
}
.chip .swatch {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: var(--swatch, var(--c-brand));
}
.chip[disabled],
.chip[aria-disabled="true"] {
  opacity: 0.45;
  cursor: not-allowed;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  border-radius: var(--radius-pill);
  font: 600 0.72rem/1.1 var(--font-mono);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: var(--c-surface-2);
  color: var(--c-text-2);
  white-space: nowrap;
}
.badge--q1 {
  background: var(--c-accent-soft);
  color: var(--c-accent-text);
}
.badge--if {
  background: var(--c-brand-soft);
  color: var(--c-brand-strong);
}
.badge--active {
  background: var(--c-success-soft);
  color: var(--c-success);
}
.badge--dot::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}
.badge--active.badge--dot::before {
  animation: pulse-dot 2s ease-in-out infinite;
}
@keyframes pulse-dot {
  50% {
    opacity: 0.35;
  }
}
.text-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  text-decoration: none;
  color: var(--c-link);
}
.text-link .icon {
  transition: transform 0.25s var(--ease-out);
}
.text-link:hover .icon {
  transform: translate(2px, -2px);
}
.text-link:hover .icon--nudge {
  transform: translateX(3px);
}

/* ---------- Header ----------------------------------------------------- */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  height: var(--header-h);
  color: var(--c-on-ink);
  transition:
    background-color 0.3s,
    color 0.3s,
    box-shadow 0.3s,
    height 0.3s var(--ease-out);
}
.site-header:not(.is-scrolled) {
  /* soft scrim keeps the nav legible over the animated hero */
  background: linear-gradient(180deg, rgb(7 19 31 / 0.6), rgb(7 19 31 / 0));
}
.site-header::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2px;
  width: calc(var(--scroll-progress, 0) * 100%);
  background: linear-gradient(90deg, var(--c-brand), var(--c-accent));
  opacity: 0;
  transition: opacity 0.3s;
}
.site-header.is-scrolled {
  --header-h: var(--header-h-compact);
  color: var(--c-text);
  background: color-mix(in srgb, var(--c-bg) 82%, transparent);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  box-shadow: 0 1px 0 var(--c-border);
}
.site-header.is-scrolled::after {
  opacity: 1;
}
.site-header .container {
  height: 100%;
  display: flex;
  align-items: center;
  gap: 16px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-right: auto;
  color: inherit;
  text-decoration: none;
  min-width: 0;
}
.brand:hover {
  color: inherit;
}
.brand-mark {
  width: 34px;
  height: 34px;
  flex: none;
  color: var(--c-accent);
  transition: transform 0.6s var(--ease-out);
}
.brand:hover .brand-mark {
  transform: rotate(45deg);
}
.brand-name {
  font: 600 1.06rem/1.1 var(--font-display);
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.brand-name span {
  font-weight: 400;
  opacity: 0.8;
}
.nav {
  display: flex;
  align-items: center;
  gap: 4px;
}
.nav a {
  position: relative;
  padding: 10px 14px;
  border-radius: var(--radius-pill);
  color: inherit;
  font-size: 0.95rem;
  font-weight: 550;
  text-decoration: none;
  opacity: 0.86;
  transition:
    opacity 0.2s,
    background-color 0.2s;
}
.nav a:hover {
  opacity: 1;
  background: color-mix(in srgb, currentColor 9%, transparent);
}
.nav a[aria-current="page"] {
  opacity: 1;
}
.nav a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 3px;
  width: 5px;
  height: 5px;
  margin-left: -2.5px;
  border-radius: 50%;
  background: var(--c-accent);
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.header-actions .icon-btn {
  width: 42px;
  height: 42px;
  background: transparent;
  color: inherit;
  border-color: color-mix(in srgb, currentColor 22%, transparent);
}
.header-actions .icon-btn:hover {
  color: inherit;
  border-color: color-mix(in srgb, currentColor 45%, transparent);
}
.btn-cv {
  min-height: 42px;
  padding: 0 18px;
  font-size: 0.92rem;
}
.theme-toggle .icon-sun {
  display: none;
}
:root[data-theme="dark"] .theme-toggle .icon-sun {
  display: block;
}
:root[data-theme="dark"] .theme-toggle .icon-moon {
  display: none;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-sun {
    display: block;
  }
  :root:not([data-theme="light"]) .theme-toggle .icon-moon {
    display: none;
  }
}
.menu-toggle {
  display: none !important;
}
.menu-toggle .icon-close,
.menu-toggle[aria-expanded="true"] .icon-menu {
  display: none;
}
.menu-toggle[aria-expanded="true"] .icon-close {
  display: block;
}
.brand-dot {
  fill: var(--c-on-ink-brand);
}
.site-header.is-scrolled .brand-dot {
  fill: var(--c-brand);
}
body.menu-open .site-header .brand-dot {
  fill: var(--c-on-ink-brand);
}
@media (max-width: 980px) {
  .nav,
  .header-actions .btn-cv {
    display: none;
  }
  .menu-toggle {
    display: inline-grid !important;
  }
}
@media (max-width: 400px) {
  .brand-name {
    font-size: 0.95rem;
  }
  .brand-mark {
    width: 28px;
    height: 28px;
  }
}

/* Mobile menu overlay */
.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 99;
  display: grid;
  align-content: start;
  padding: calc(var(--header-h) + 24px) var(--gutter) 32px;
  background: var(--c-ink);
  color: var(--c-on-ink);
  overflow-y: auto;
  visibility: hidden;
  opacity: 0;
  transition:
    opacity 0.3s var(--ease-out),
    visibility 0s linear 0.3s;
}
.mobile-menu.is-open {
  visibility: visible;
  opacity: 1;
  transition: opacity 0.3s var(--ease-out);
}
.mobile-menu nav {
  display: grid;
  gap: 4px;
}
.mobile-menu nav a {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid rgb(255 255 255 / 0.08);
  color: var(--c-on-ink);
  text-decoration: none;
  font: 600 clamp(1.7rem, 7vw, 2.4rem) / 1.15 var(--font-display);
  transform: translateY(16px);
  opacity: 0;
  transition:
    transform 0.5s var(--ease-out),
    opacity 0.5s var(--ease-out),
    color 0.2s;
  transition-delay: calc(var(--i, 0) * 50ms);
}
.mobile-menu nav a small {
  font: 600 0.75rem/1 var(--font-mono);
  color: var(--c-on-ink-accent);
}
.mobile-menu nav a[aria-current="page"] {
  color: var(--c-on-ink-accent);
}
.mobile-menu.is-open nav a {
  transform: none;
  opacity: 1;
}
.mobile-menu .mobile-menu-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}
body.menu-open {
  overflow: hidden;
}
body.menu-open .site-header {
  color: var(--c-on-ink);
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

/* ---------- Hero (home) ------------------------------------------------ */
.hero {
  position: relative;
  isolation: isolate;
  min-height: min(100svh, 980px);
  display: grid;
  align-items: center;
  padding: calc(var(--header-h) + 40px) 0 190px;
  background:
    radial-gradient(60% 55% at 85% 20%, rgb(10 125 178 / 0.35), transparent 70%),
    radial-gradient(45% 50% at 10% 95%, rgb(232 119 34 / 0.18), transparent 70%),
    linear-gradient(180deg, var(--c-ink) 0%, #0a1b2c 100%);
  color: var(--c-on-ink);
  overflow: hidden;
}
.hero-canvas {
  position: absolute;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
}
.hero::before {
  /* readability veil behind the text column */
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(90deg, rgb(7 19 31 / 0.75) 0%, rgb(7 19 31 / 0.35) 45%, transparent 70%);
  pointer-events: none;
}
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  align-items: center;
  gap: clamp(32px, 6vw, 88px);
}
.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 7px 14px 7px 8px;
  border-radius: var(--radius-pill);
  border: 1px solid rgb(255 255 255 / 0.14);
  background: rgb(255 255 255 / 0.05);
  backdrop-filter: blur(8px);
  font-size: 0.86rem;
  color: var(--c-on-ink-2);
  text-decoration: none;
  transition:
    border-color 0.2s,
    color 0.2s,
    background-color 0.2s;
}
.hero-kicker:hover {
  color: #fff;
  border-color: rgb(255 154 77 / 0.5);
  background: rgb(255 255 255 / 0.08);
}
.hero-kicker .icon {
  width: 14px;
  height: 14px;
  transition: transform 0.25s var(--ease-out);
}
.hero-kicker:hover .icon {
  transform: translateX(3px);
}
.hero-kicker b {
  display: inline-grid;
  place-items: center;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  background: var(--c-on-ink-accent);
  color: #1a0d02;
  font: 700 0.7rem/1.2 var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.hero h1 {
  margin: 22px 0 18px;
  color: #fff;
  font-size: clamp(2.7rem, 1.4rem + 5.4vw, 5.6rem);
  font-weight: 560;
  line-height: 0.98;
  letter-spacing: -0.03em;
}
.hero h1 .line {
  display: block;
}
.hero h1 .line--light {
  font-weight: 300;
  font-style: normal;
  color: var(--c-on-ink-2);
}
.hero-role {
  max-width: 34em;
  margin: 0 0 10px;
  font-size: clamp(1.1rem, 1rem + 0.5vw, 1.32rem);
  line-height: 1.55;
  color: var(--c-on-ink);
}
.rotator {
  position: relative;
  display: inline-block;
  color: var(--c-on-ink-accent);
  font-weight: 600;
  white-space: nowrap;
}
.rotator::after {
  content: "";
  display: inline-block;
  width: 2px;
  height: 1.05em;
  margin-left: 3px;
  vertical-align: -0.15em;
  background: currentColor;
  animation: caret 1s steps(1) infinite;
}
@keyframes caret {
  50% {
    opacity: 0;
  }
}
.hero-place {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0 0 32px;
  color: var(--c-on-ink-2);
  font-size: 0.98rem;
}
.hero-place .icon {
  margin-top: 4px;
  color: var(--c-on-ink-brand);
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 28px;
}
.profile-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.hero .profile-links .icon-btn {
  background: rgb(255 255 255 / 0.05);
  color: var(--c-on-ink);
  border-color: rgb(255 255 255 / 0.16);
}
.hero .profile-links .icon-btn:hover {
  color: #fff;
  border-color: var(--c-on-ink-accent);
  background: rgb(255 255 255 / 0.1);
}

/* Portrait in an arch, with an offset outline and floating facts */
.portrait {
  position: relative;
  justify-self: center;
  width: min(100%, 420px);
}
.portrait-frame {
  position: relative;
  aspect-ratio: 4 / 5;
  border-radius: 999px 999px 28px 28px;
  overflow: hidden;
  background: #eceeef;
  box-shadow: 0 40px 80px -30px rgb(0 0 0 / 0.7);
}
.portrait-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.portrait::before {
  content: "";
  position: absolute;
  inset: 18px -18px -18px 18px;
  border-radius: 999px 999px 28px 28px;
  border: 1.5px solid rgb(255 154 77 / 0.55);
  z-index: -1;
}
.portrait-star {
  position: absolute;
  top: -30px;
  left: -34px;
  width: 92px;
  height: 92px;
  color: var(--c-on-ink-accent);
  opacity: 0.9;
}
@media (prefers-reduced-motion: no-preference) {
  .portrait-star {
    animation: spin 40s linear infinite;
  }
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.fact-chip {
  position: absolute;
  display: grid;
  gap: 2px;
  padding: 10px 16px;
  border-radius: 14px;
  background: rgb(12 30 48 / 0.72);
  border: 1px solid rgb(255 255 255 / 0.14);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 18px 40px -16px rgb(0 0 0 / 0.6);
  color: var(--c-on-ink);
  font-size: 0.78rem;
  line-height: 1.2;
}
.fact-chip strong {
  font: 650 1.35rem/1.1 var(--font-sans);
  color: #fff;
}
.fact-chip--a {
  top: 18%;
  left: -14%;
}
.fact-chip--b {
  top: 52%;
  right: -12%;
}
.fact-chip--c {
  bottom: 7%;
  left: -8%;
}
.fact-chip--b strong {
  color: var(--c-on-ink-accent);
}
@media (prefers-reduced-motion: no-preference) {
  .fact-chip {
    animation: float 7s var(--ease-in-out) infinite alternate;
  }
  .fact-chip--b {
    animation-delay: -2.5s;
  }
  .fact-chip--c {
    animation-delay: -4.5s;
  }
}
@keyframes float {
  to {
    transform: translateY(-10px);
  }
}
.hero-foot {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 92px; /* clears the stats card that overlaps the hero by 64px */
}
.hero-foot .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
/* White logo, always shown on the dark hero/footer (a plain <img>, so it also
   works when the page is opened straight from disk) */
.affil-logo {
  display: block;
  width: 190px;
  height: auto;
}
.hero-foot .affil-logo {
  opacity: 0.75;
  width: 170px;
}
.scroll-cue {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--c-on-ink-2);
  font: 600 0.68rem/1 var(--font-mono);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-decoration: none;
}
.scroll-cue:hover {
  color: #fff;
}
.scroll-cue span {
  width: 22px;
  height: 34px;
  border-radius: 12px;
  border: 1.5px solid currentColor;
  position: relative;
}
.scroll-cue span::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 7px;
  width: 3px;
  height: 7px;
  margin-left: -1.5px;
  border-radius: 2px;
  background: currentColor;
}
@media (prefers-reduced-motion: no-preference) {
  .scroll-cue span::after {
    animation: wheel 1.8s var(--ease-in-out) infinite;
  }
}
@keyframes wheel {
  0% {
    transform: translateY(0);
    opacity: 1;
  }
  80% {
    transform: translateY(11px);
    opacity: 0;
  }
  100% {
    opacity: 0;
  }
}
.anim-caption {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 330px;
  color: var(--c-on-ink-2);
  font-size: 0.74rem;
  line-height: 1.35;
  text-align: right;
}
.anim-caption .legend-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin: 0 4px 0 6px;
  vertical-align: 0;
}
.anim-toggle {
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgb(255 255 255 / 0.25);
  background: rgb(255 255 255 / 0.06);
  color: var(--c-on-ink);
  display: inline-grid;
  place-items: center;
  cursor: pointer;
}
.anim-toggle:hover {
  border-color: var(--c-on-ink-accent);
}
.anim-toggle[hidden] {
  display: none;
}
.anim-toggle .icon {
  width: 15px;
  height: 15px;
}
.anim-toggle .icon-play {
  display: none;
}
.anim-toggle[aria-pressed="true"] .icon-play {
  display: block;
}
.anim-toggle[aria-pressed="true"] .icon-pause {
  display: none;
}
@media (max-width: 900px) {
  .hero {
    padding-bottom: 170px;
  }
  .hero-grid {
    grid-template-columns: 1fr;
  }
  .portrait {
    width: min(64%, 290px);
    order: -1;
    margin-top: 12px;
  }
  .hero::before {
    background: linear-gradient(180deg, rgb(7 19 31 / 0.2) 0%, rgb(7 19 31 / 0.7) 60%);
  }
  .fact-chip--a {
    left: -18%;
  }
  .fact-chip--b {
    right: -18%;
  }
  .anim-caption .caption-text,
  .scroll-cue {
    display: none;
  }
}
@media (max-width: 520px) {
  .fact-chip {
    padding: 8px 12px;
  }
  .fact-chip strong {
    font-size: 1.1rem;
  }
  .fact-chip--c {
    display: none;
  }
  .hero-foot .affil-logo {
    width: 140px;
  }
}

/* ---------- Page hero (sub-pages) -------------------------------------- */
.page-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: calc(var(--header-h) + clamp(48px, 8vw, 96px)) 0 clamp(56px, 8vw, 96px);
  background:
    radial-gradient(55% 80% at 90% 0%, rgb(10 125 178 / 0.38), transparent 70%),
    radial-gradient(40% 60% at 0% 100%, rgb(232 119 34 / 0.16), transparent 70%), var(--c-ink);
  color: var(--c-on-ink);
}
.page-hero-art {
  position: absolute;
  right: -40px;
  top: 50%;
  width: min(620px, 70vw);
  transform: translateY(-46%);
  z-index: -1;
  color: var(--c-on-ink-brand);
  opacity: 0.55;
  pointer-events: none;
}
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 22px;
  padding: 0;
  list-style: none;
  font: 600 0.75rem/1 var(--font-mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--c-on-ink-2);
}
.breadcrumb a {
  color: var(--c-on-ink-2);
  text-decoration: none;
}
.breadcrumb a:hover {
  color: #fff;
}
.breadcrumb li + li::before {
  content: "/";
  margin-right: 8px;
  opacity: 0.5;
}
.breadcrumb [aria-current] {
  color: var(--c-on-ink-accent);
}
.page-hero h1 {
  max-width: 14em;
  color: #fff;
  font-size: clamp(2.6rem, 1.6rem + 4.2vw, 4.6rem);
  font-weight: 560;
  letter-spacing: -0.03em;
  line-height: 1;
}
.page-hero .lead {
  max-width: 40em;
  margin: 20px 0 0;
  color: var(--c-on-ink-2);
}
.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 32px;
}
.hero-stat {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 14px;
  border: 1px solid rgb(255 255 255 / 0.12);
  background: rgb(255 255 255 / 0.05);
  backdrop-filter: blur(8px);
  color: var(--c-on-ink-2);
  font-size: 0.86rem;
}
.hero-stat strong {
  font: 650 1.4rem/1 var(--font-sans);
  color: #fff;
}

.page-hero + .section {
  padding-top: clamp(40px, 5vw, 64px);
}

/* ---------- Stats band ------------------------------------------------- */
.stats {
  position: relative;
  z-index: 2;
  margin-top: -64px;
}
.stats-card {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  border-radius: var(--radius-lg);
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.stat {
  position: relative;
  display: grid;
  gap: 6px;
  padding: clamp(20px, 3vw, 30px) clamp(16px, 2vw, 24px);
}
.stat + .stat {
  border-left: 1px solid var(--c-border);
}
.stat .icon {
  width: 22px;
  height: 22px;
  color: var(--c-brand);
}
.stat:nth-child(even) .icon {
  color: var(--c-accent);
}
.stat-value {
  font: 650 clamp(2rem, 1.5rem + 1.6vw, 2.75rem) / 1 var(--font-sans);
  letter-spacing: -0.03em;
  color: var(--c-text);
}
.stat-label {
  font-size: 0.86rem;
  color: var(--c-text-3);
  line-height: 1.3;
}
@media (max-width: 900px) {
  .stats-card {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .stat:nth-child(4) {
    border-left: 0;
  }
  .stat:nth-child(n + 4) {
    border-top: 1px solid var(--c-border);
  }
}
@media (max-width: 560px) {
  .stats-card {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .stat:nth-child(odd) {
    border-left: 0;
  }
  .stat:nth-child(4) {
    border-left: 1px solid var(--c-border);
  }
  .stat:nth-child(n + 3) {
    border-top: 1px solid var(--c-border);
  }
}

/* ---------- Cards ------------------------------------------------------ */
.card {
  position: relative;
  border-radius: var(--radius);
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  box-shadow: var(--shadow-sm);
}
/* Spotlight: a soft glow that follows the pointer (set by main.js) */
.spotlight {
  --mx: 50%;
  --my: 50%;
  isolation: isolate;
  overflow: hidden;
}
.spotlight::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: 0;
  background: radial-gradient(
    420px circle at var(--mx) var(--my),
    color-mix(in srgb, var(--tone, var(--c-brand)) 14%, transparent),
    transparent 60%
  );
  transition: opacity 0.35s;
}
.spotlight:hover::before {
  opacity: 1;
}

/* Research interest cards */
.area-card {
  --tone: var(--area-ml);
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: 12px;
  padding: 26px;
  color: inherit;
  text-decoration: none;
  transition:
    transform 0.35s var(--ease-out),
    box-shadow 0.35s var(--ease-out),
    border-color 0.35s;
}
.area-card:hover {
  color: inherit;
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--tone) 45%, var(--c-border));
  box-shadow: var(--shadow-md);
}
.area-card .area-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.area-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--tone) 13%, transparent);
  color: var(--tone);
  transition:
    transform 0.35s var(--ease-out),
    background-color 0.35s,
    color 0.35s;
}
.area-icon .icon {
  width: 26px;
  height: 26px;
}
.area-card:hover .area-icon {
  transform: rotate(-6deg) scale(1.06);
  background: var(--tone);
  color: #fff;
}
.area-num {
  font: 600 0.78rem/1 var(--font-mono);
  color: var(--c-text-3);
}
.area-card h3 {
  font-size: 1.32rem;
}
.area-card p {
  margin: 0;
  color: var(--c-text-2);
  font-size: 0.97rem;
}
.area-card .area-more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--c-link);
}
.area-card:hover .area-more .icon {
  transform: translateX(3px);
}
.area-more .icon {
  transition: transform 0.3s var(--ease-out);
}
.tone-ml {
  --tone: var(--area-ml);
}
.tone-xai {
  --tone: var(--area-xai);
}
.tone-networks {
  --tone: var(--area-networks);
}
.tone-smart {
  --tone: var(--area-smart);
}
.tone-game {
  --tone: var(--area-game);
}
.tone-security {
  --tone: var(--area-security);
}

/* About */
.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.85fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: start;
}
.prose p {
  color: var(--c-text-2);
  font-size: 1.07rem;
}
.prose strong {
  color: var(--c-text);
}
.glance {
  padding: 28px;
  position: sticky;
  top: calc(var(--header-h) + 24px);
}
.glance h3 {
  font-size: 1.2rem;
  margin-bottom: 18px;
}
.facts {
  display: grid;
  gap: 16px;
  margin: 0 0 24px;
}
.facts div {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 12px;
  align-items: start;
}
.facts dt {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--c-brand-soft);
  color: var(--c-brand);
}
.facts dt .icon {
  width: 18px;
  height: 18px;
}
.facts dd {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.45;
  color: var(--c-text-2);
}
.facts dd b {
  display: block;
  color: var(--c-text);
  font-weight: 650;
}
.career {
  margin-top: clamp(28px, 4vw, 44px);
}
.career h3 {
  font-size: 1.35rem;
  margin-bottom: 18px;
}
.glance .btn {
  width: 100%;
}
.timeline {
  position: relative;
  margin: 0;
  padding: 0 0 0 22px;
  list-style: none;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  border-radius: 2px;
  background: linear-gradient(var(--c-accent), var(--c-brand) 60%, var(--c-border));
}
.timeline li {
  position: relative;
  padding-bottom: 16px;
}
.timeline li::before {
  content: "";
  position: absolute;
  left: -22px;
  top: 6px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--c-surface);
  border: 2px solid var(--c-brand);
}
.timeline li:first-child::before {
  border-color: var(--c-accent);
  background: var(--c-accent);
}
.timeline .when {
  display: block;
  font: 600 0.74rem/1.4 var(--font-mono);
  color: var(--c-text-3);
  letter-spacing: 0.04em;
}
.timeline .what {
  font-size: 0.94rem;
  line-height: 1.4;
  color: var(--c-text);
}
.timeline .where {
  display: block;
  font-size: 0.86rem;
  color: var(--c-text-3);
}
@media (max-width: 900px) {
  .about-grid {
    grid-template-columns: 1fr;
  }
  .glance {
    position: static;
  }
}

/* Publication cards (home + research featured) */
.pub-card {
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 14px;
  padding: 24px;
  color: inherit;
  text-decoration: none;
  transition:
    transform 0.35s var(--ease-out),
    box-shadow 0.35s var(--ease-out),
    border-color 0.35s;
}
.pub-card:hover {
  color: inherit;
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--c-border-strong);
}
.pub-card .badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.pub-card h3 {
  font-size: 1.14rem;
  line-height: 1.3;
}
.pub-card .venue {
  margin: 0;
  font-size: 0.9rem;
  color: var(--c-text-3);
}
.pub-card .pub-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 14px;
  border-top: 1px dashed var(--c-border);
  font-size: 0.88rem;
}
.pub-card .pub-foot .year {
  font: 600 0.82rem/1 var(--font-mono);
  color: var(--c-text-2);
}
.pub-card .pub-foot .go {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  color: var(--c-link);
}
.pub-card:hover .go .icon {
  transform: translate(2px, -2px);
}
.go .icon {
  transition: transform 0.3s var(--ease-out);
}
.badge-type {
  background: color-mix(in srgb, var(--type-c, var(--c-brand)) 14%, transparent);
  color: var(--c-text);
}
.badge-type::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--type-c, var(--c-brand));
}
.type-journal {
  --type-c: var(--series-journal);
}
.type-chapter {
  --type-c: var(--series-chapter);
}
.type-conference {
  --type-c: var(--series-conference);
}
.type-book {
  --type-c: var(--series-book);
}

/* News */
.news-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: start;
}
.news-grid .section-head {
  position: sticky;
  top: calc(var(--header-h) + 24px);
  margin-bottom: 0;
}
.news-list {
  position: relative;
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 18px;
}
.news-item {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 18px;
  padding: 22px;
}
.news-date {
  display: grid;
  align-content: start;
  justify-items: start;
  gap: 8px;
}
.news-date .yr {
  font: 650 1.6rem/1 var(--font-sans);
  letter-spacing: -0.02em;
  color: var(--c-text);
}
.news-item h3 {
  font-size: 1.12rem;
  margin-bottom: 6px;
}
.news-item p {
  margin: 0 0 8px;
  color: var(--c-text-2);
  font-size: 0.97rem;
}
@media (max-width: 900px) {
  .news-grid {
    grid-template-columns: 1fr;
  }
  .news-grid .section-head {
    position: static;
  }
}
@media (max-width: 520px) {
  .news-item {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .news-date {
    grid-auto-flow: column;
    align-items: center;
  }
}

/* Service */
.service {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 16px;
  padding: 22px;
  align-items: start;
}
.service-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: var(--c-accent-soft);
  color: var(--c-accent-text);
}
.service:nth-child(even) .service-icon {
  background: var(--c-brand-soft);
  color: var(--c-brand);
}
.service-icon .icon {
  width: 22px;
  height: 22px;
}
.service .role {
  display: block;
  margin-bottom: 4px;
  font: 600 0.74rem/1.2 var(--font-mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--c-text-3);
}
.service h3 {
  font-size: 1.08rem;
  line-height: 1.3;
  margin-bottom: 4px;
}
.service p {
  margin: 0;
  font-size: 0.93rem;
  color: var(--c-text-2);
}
.service a {
  font-weight: 600;
}

/* Publishers marquee */
.publishers {
  padding-block: 44px;
  border-block: 1px solid var(--c-border);
  background: var(--c-surface);
  overflow: hidden;
}
.publishers-title {
  margin: 0 0 18px;
  text-align: center;
  font: 600 0.74rem/1 var(--font-mono);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--c-text-3);
}
.marquee {
  display: flex;
  width: max-content;
  mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}
.marquee-track {
  display: flex;
  align-items: center;
  gap: 56px;
  padding-right: 56px;
  margin: 0;
  list-style: none;
}
.marquee-track li {
  font: 500 clamp(1.3rem, 1rem + 1.2vw, 1.85rem) / 1 var(--font-display);
  color: var(--c-text-2);
  white-space: nowrap;
  letter-spacing: -0.01em;
}
.marquee-track li::after {
  content: "✦";
  margin-left: 56px;
  font-size: 0.8rem;
  color: var(--c-accent);
  vertical-align: middle;
}
@media (prefers-reduced-motion: no-preference) {
  .marquee {
    animation: marquee 38s linear infinite;
  }
  .publishers:hover .marquee {
    animation-play-state: paused;
  }
}
@keyframes marquee {
  to {
    transform: translateX(-50%);
  }
}
@media (prefers-reduced-motion: reduce) {
  .marquee {
    width: auto;
    justify-content: center;
    mask-image: none;
    -webkit-mask-image: none;
  }
  .marquee-track {
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px 40px;
    padding: 0 var(--gutter);
  }
  .marquee-track li::after {
    display: none;
  }
  .marquee-track[aria-hidden="true"] {
    display: none;
  }
}

/* CTA band with a zellige-inspired star lattice */
.cta {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border-radius: var(--radius-lg);
  padding: clamp(36px, 6vw, 72px);
  background:
    radial-gradient(70% 120% at 100% 0%, rgb(10 125 178 / 0.45), transparent 60%),
    radial-gradient(60% 100% at 0% 100%, rgb(232 119 34 / 0.28), transparent 60%), var(--c-ink-2);
  color: var(--c-on-ink);
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) auto;
  align-items: center;
  gap: 28px 48px;
}
.cta::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: 0.09;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='56' viewBox='0 0 56 56'%3E%3Cg fill='none' stroke='%23ffffff' stroke-width='1.2'%3E%3Crect x='17' y='17' width='22' height='22'/%3E%3Crect x='17' y='17' width='22' height='22' transform='rotate(45 28 28)'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 56px 56px;
  mask-image: linear-gradient(90deg, transparent 0%, #000 70%);
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 70%);
}
.cta h2 {
  color: #fff;
  font-size: clamp(1.9rem, 1.3rem + 2.2vw, 2.8rem);
  margin-bottom: 12px;
}
.cta p {
  margin: 0;
  color: var(--c-on-ink-2);
  font-size: 1.08rem;
  max-width: 36em;
}
.cta-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
@media (max-width: 860px) {
  .cta {
    grid-template-columns: 1fr;
  }
}

/* ---------- Footer ----------------------------------------------------- */
.site-footer {
  margin-top: var(--section-pad);
  background: var(--c-ink);
  color: var(--c-on-ink-2);
  font-size: 0.95rem;
}
.footer-top {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) repeat(2, minmax(0, 0.8fr));
  gap: 40px;
  padding-block: 64px 44px;
}
.footer-brand .brand {
  color: var(--c-on-ink);
  margin-bottom: 16px;
}
.footer-brand p {
  max-width: 30em;
  margin-bottom: 22px;
}
.footer-brand .affil-logo {
  opacity: 0.7;
}
.site-footer h2 {
  margin-bottom: 14px;
  font: 600 0.74rem/1 var(--font-mono);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--c-on-ink);
}
.footer-links {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.footer-links a {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--c-on-ink-2);
  text-decoration: none;
}
.footer-links a:hover {
  color: #fff;
}
.footer-links .icon {
  width: 17px;
  height: 17px;
}
.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  padding-block: 22px;
  border-top: 1px solid rgb(255 255 255 / 0.08);
  font-size: 0.85rem;
}
.footer-bottom a {
  color: var(--c-on-ink-2);
}
.footer-bottom a:hover {
  color: #fff;
}
@media (max-width: 760px) {
  .footer-top {
    grid-template-columns: 1fr 1fr;
  }
  .footer-brand {
    grid-column: 1 / -1;
  }
}

/* ---------- Utilities: reveal, toast, back-to-top ------------------------ */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(22px);
  transition:
    opacity 0.8s var(--ease-out),
    transform 0.8s var(--ease-out);
  transition-delay: calc(var(--d, 0) * 80ms);
}
.js [data-reveal].is-visible {
  opacity: 1;
  transform: none;
}
@media (prefers-reduced-motion: reduce) {
  .js [data-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
.toast-region {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 300;
  transform: translateX(-50%);
  display: grid;
  gap: 8px;
  pointer-events: none;
}
.toast {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border-radius: var(--radius-pill);
  background: var(--c-text);
  color: var(--c-bg);
  box-shadow: var(--shadow-lg);
  font-size: 0.92rem;
  font-weight: 550;
  animation: toast-in 0.35s var(--ease-out);
}
.toast .icon {
  color: var(--c-success);
}
.toast.is-leaving {
  opacity: 0;
  transform: translateY(8px);
  transition:
    opacity 0.3s,
    transform 0.3s;
}
@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.96);
  }
}
.to-top {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 90;
  box-shadow: var(--shadow-md);
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition:
    opacity 0.3s,
    transform 0.3s var(--ease-out),
    visibility 0s linear 0.3s;
}
.to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition:
    opacity 0.3s,
    transform 0.3s var(--ease-out);
}

/* ---------- 404 -------------------------------------------------------- */
.notfound {
  min-height: 100svh;
  display: grid;
  place-items: center;
  text-align: center;
  padding: calc(var(--header-h) + 32px) var(--gutter) 64px;
  background: radial-gradient(50% 60% at 50% 0%, rgb(10 125 178 / 0.35), transparent 70%), var(--c-ink);
  color: var(--c-on-ink);
}
.notfound .code {
  font: 600 clamp(5rem, 3rem + 10vw, 10rem) / 0.9 var(--font-display);
  letter-spacing: -0.04em;
  color: #fff;
}
.notfound .code span {
  color: var(--c-on-ink-accent);
}
.notfound h1 {
  color: #fff;
  font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.2rem);
  margin: 12px 0;
}
.notfound p {
  max-width: 34em;
  margin: 0 auto 28px;
  color: var(--c-on-ink-2);
}
.notfound .actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

/* ---------- Forced colours & print ------------------------------------- */
@media (forced-colors: active) {
  .chip[aria-pressed="true"] {
    outline: 2px solid CanvasText;
  }
}
@media print {
  .site-header,
  .mobile-menu,
  .hero-canvas,
  .to-top,
  .toast-region,
  .cta,
  .site-footer,
  .filters,
  .pub-actions,
  .chart-wrap,
  .scroll-cue,
  .anim-caption {
    display: none !important;
  }
  body {
    background: #fff;
    color: #000;
  }
  .hero,
  .page-hero {
    background: none !important;
    color: #000;
    padding: 0 0 16px;
  }
  .page-hero h1,
  .hero h1 {
    color: #000;
  }
  .page-hero .lead,
  .breadcrumb {
    color: #333;
  }
  .js [data-reveal] {
    opacity: 1 !important;
    transform: none !important;
  }
  a {
    color: #000;
  }
}
