/* =======================================================================
   Prism Lab — IoT Prism Laboratory, University of Bologna.

   Brand metaphor: a research apparatus that takes a single beam (a question,
   a dataset, a problem) and refracts it into a spectrum of work. The site
   reflects that with one disciplined accent on tinted neutrals; the literal
   spectrum appears intentionally — once at the top of every page as a
   hairline rule, and once on the homepage hero as the prism illustration.
   ======================================================================= */

/* -- Reset --------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
img, svg, video { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
ul, ol { list-style: none; }
a { color: inherit; text-decoration: none; }


/* -- Tokens -------------------------------------------------------------- */
:root {
  /* Brand hue — a deep cool violet. Sits between cyan and magenta on the
     visible spectrum, so the lab name is honoured even in the single accent. */
  --brand-h: 290;

  /* Surface palette — every neutral is tinted toward the brand hue (~0.015
     chroma) so the UI feels coherent without ever being decorative. */
  --bg:           oklch(13.5% 0.018 var(--brand-h));
  --bg-raised:    oklch(17%   0.020 var(--brand-h));
  --bg-sunken:    oklch(11%   0.015 var(--brand-h));
  --bg-hover:     oklch(20%   0.024 var(--brand-h));

  --fg:           oklch(96%   0.010 var(--brand-h));
  --fg-muted:     oklch(75%   0.018 var(--brand-h));
  --fg-subtle:    oklch(55%   0.020 var(--brand-h));

  --border:        oklch(28% 0.025 var(--brand-h));
  --border-strong: oklch(45% 0.045 var(--brand-h));

  /* Single accent — the brand violet at full chroma. */
  --accent:        oklch(72% 0.180 var(--brand-h));
  --accent-strong: oklch(80% 0.190 var(--brand-h));
  --accent-soft:   oklch(72% 0.180 var(--brand-h) / 0.14);
  --accent-fg:     oklch(15% 0.025 var(--brand-h));

  /* Spectrum — used ONLY in the hero illustration and the page-top hairline.
     Do not reach for these in regular UI. */
  --spectrum-1: oklch(82% 0.16 200);   /* cyan */
  --spectrum-2: oklch(72% 0.18 290);   /* violet (== --accent) */
  --spectrum-3: oklch(72% 0.20 360);   /* magenta */
  --spectrum-rule: linear-gradient(90deg,
    oklch(82% 0.16 200),
    oklch(78% 0.16 240),
    oklch(72% 0.18 290),
    oklch(72% 0.20 330),
    oklch(72% 0.20 360)
  );

  /* Functional state colours, used sparingly. */
  --success: oklch(75% 0.16 145);
  --warning: oklch(82% 0.16  80);
  --danger:  oklch(72% 0.20  25);
  --info:    var(--spectrum-1);

  /* Shadows — neutral, not glowing. Glow is an AI tell. */
  --shadow-1: 0 1px 2px oklch(0% 0 0 / 0.30);
  --shadow-2: 0 8px 24px -10px oklch(0% 0 0 / 0.45);

  /* Spacing — 4 pt scale. */
  --space-1:  0.25rem;
  --space-2:  0.5rem;
  --space-3:  0.75rem;
  --space-4:  1rem;
  --space-6:  1.5rem;
  --space-8:  2rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-24: 6rem;

  /* Type — a 1.25 modular scale, fluid at the top. */
  --type-display:  clamp(2.5rem,  1.4rem + 4.5vw, 4rem);
  --type-h1:       clamp(1.75rem, 1.2rem + 2.2vw, 2.25rem);
  --type-h2:       1.5rem;
  --type-h3:       1.25rem;
  --type-h4:       1.0625rem;
  --type-body:     1rem;
  --type-small:    0.875rem;
  --type-caption:  0.78rem;

  /* Fonts — chosen to step away from the AI default font set.
     Funnel Sans (Google) is a quietly characterful workhorse grotesque.
     Spectral (Production Type, Google Fonts) is the literal name match —
     a humanist serif drawn for screen reading.
     JetBrains Mono carries metadata and code. */
  --font-display: "Funnel Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-prose:   "Spectral", Iowan Old Style, Apple Garamond, Baskerville, "Times New Roman", serif;
  --font-mono:    "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;

  /* Geometry */
  --r-sm: 4px;
  --r-md: 8px;
  --r-lg: 14px;

  /* Motion — exponential easing, never bounce. */
  --ease: cubic-bezier(0.32, 0.72, 0.39, 1);
  --t-quick: 120ms var(--ease);
  --t-base:  220ms var(--ease);
  --t-deep:  420ms var(--ease);

  /* Layout */
  --max-content: 1180px;
  --max-prose:   68ch;
}

[data-theme="light"] {
  --bg:           oklch(99%  0.006 var(--brand-h));
  --bg-raised:    oklch(100% 0     0);
  --bg-sunken:    oklch(97%  0.010 var(--brand-h));
  --bg-hover:     oklch(95%  0.014 var(--brand-h));

  --fg:           oklch(20%  0.020 var(--brand-h));
  --fg-muted:     oklch(45%  0.020 var(--brand-h));
  --fg-subtle:    oklch(60%  0.018 var(--brand-h));

  --border:        oklch(90% 0.014 var(--brand-h));
  --border-strong: oklch(78% 0.024 var(--brand-h));

  --accent:        oklch(48% 0.20 var(--brand-h));
  --accent-strong: oklch(40% 0.22 var(--brand-h));
  --accent-soft:   oklch(48% 0.20 var(--brand-h) / 0.10);
  --accent-fg:     oklch(98% 0.010 var(--brand-h));

  --shadow-1: 0 1px 2px oklch(0% 0 0 / 0.05);
  --shadow-2: 0 8px 24px -10px oklch(0% 0 0 / 0.10);
}

@media (prefers-reduced-motion: reduce) {
  :root { --t-quick: 0ms; --t-base: 0ms; --t-deep: 0ms; }
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}


/* -- Body & globals ----------------------------------------------------- */
body {
  font-family: var(--font-display);
  font-size: var(--type-body);
  line-height: 1.55;
  color: var(--fg);
  background: var(--bg);
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "ss01", "ss02", "cv11";
}

/* The single literal use of the spectrum in chrome: a 1 px hairline at the
   very top of every page. This is the brand signature. Nothing else in the
   chrome reaches for the spectrum — that's the whole point. */
body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto 0;
  height: 1px;
  background: var(--spectrum-rule);
  z-index: 200;
  pointer-events: none;
}

::selection { background: var(--accent-soft); color: var(--fg); }


/* -- Typography --------------------------------------------------------- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  color: var(--fg);
  letter-spacing: -0.012em;
  line-height: 1.15;
  font-weight: 600;
  text-wrap: balance;
}

h1 { font-size: var(--type-h1); font-weight: 700; }
h2 { font-size: var(--type-h2); font-weight: 600; }
h3 { font-size: var(--type-h3); font-weight: 600; }
h4 { font-size: var(--type-h4); font-weight: 600; }

p { text-wrap: pretty; }

a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: color-mix(in oklab, var(--accent) 35%, transparent);
  text-underline-offset: 0.18em;
  transition: color var(--t-quick), text-decoration-color var(--t-quick);
}
a:hover { color: var(--accent-strong); text-decoration-color: currentColor; }

code, pre, samp, kbd { font-family: var(--font-mono); font-size: 0.92em; }
code {
  padding: 0.06em 0.35em;
  background: var(--bg-sunken);
  border-radius: var(--r-sm);
}
pre {
  padding: var(--space-4);
  background: var(--bg-sunken);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow-x: auto;
  font-size: var(--type-small);
  line-height: 1.55;
}
pre code { background: transparent; padding: 0; }

blockquote {
  margin: var(--space-6) 0;
  padding-left: var(--space-4);
  border-left: 1px solid var(--border-strong);
  color: var(--fg-muted);
  font-family: var(--font-prose);
  font-size: 1.05em;
  font-style: italic;
}

hr {
  border: 0;
  height: 1px;
  background: var(--border);
  margin: var(--space-8) 0;
}

img, figure { border-radius: var(--r-md); }


/* -- Skip link ---------------------------------------------------------- */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 4px;
  padding: var(--space-2) var(--space-3);
  background: var(--accent);
  color: var(--accent-fg);
  border-radius: var(--r-sm);
  font-weight: 600;
  z-index: 9999;
}
.skip-link:focus { left: var(--space-3); }


/* -- Header ------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in oklab, var(--bg) 78%, transparent);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: var(--max-content);
  margin: 0 auto;
  padding: var(--space-3) var(--space-6);
  display: flex;
  align-items: center;
  gap: var(--space-6);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  flex-shrink: 0;
  text-decoration: none;
  color: var(--fg);
}
.brand:hover { color: var(--accent); text-decoration: none; }

.brand-mark { width: 28px; height: 28px; flex-shrink: 0; object-fit: contain; display: block; }

.brand > span:first-of-type {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: -0.005em;
  line-height: 1.1;
}

.brand-text-muted {
  display: block;
  margin-top: 1px;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-subtle);
  line-height: 1;
}

/* primary nav -------- */
.nav-primary {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  margin-left: auto;
}
.nav-item { position: relative; }

.nav-link {
  display: inline-block;
  padding: 0.45rem 0.7rem;
  font-size: var(--type-small);
  font-weight: 500;
  color: var(--fg-muted);
  border-radius: var(--r-sm);
  text-decoration: none;
  transition: color var(--t-quick), background-color var(--t-quick);
}
.nav-link:hover,
.nav-link:focus-visible,
.nav-item:hover > .nav-link {
  color: var(--fg);
  background: var(--bg-hover);
  text-decoration: none;
}
.nav-link.active { color: var(--accent); }

.has-submenu > .nav-link::after {
  content: "";
  display: inline-block;
  margin-left: 0.4em;
  width: 0.32em; height: 0.32em;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  opacity: 0.55;
}

.submenu {
  position: absolute;
  top: calc(100% + 2px);
  left: 0;
  min-width: 220px;
  padding: var(--space-2);
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-2);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity var(--t-quick), transform var(--t-quick), visibility var(--t-quick);
}
.has-submenu:hover > .submenu,
.has-submenu:focus-within > .submenu {
  opacity: 1; visibility: visible; transform: translateY(0);
}
.submenu .nav-link {
  display: block;
  padding: 0.45rem 0.65rem;
  font-size: var(--type-small);
}

.nav-tools { display: flex; align-items: center; gap: var(--space-1); }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.1rem;
  height: 2.1rem;
  color: var(--fg-muted);
  border-radius: var(--r-sm);
  transition: color var(--t-quick), background-color var(--t-quick);
}
.icon-btn:hover { color: var(--fg); background: var(--bg-hover); }
.icon-btn svg { width: 1.05rem; height: 1.05rem; }

.theme-toggle .icon-moon { display: none; }
[data-theme="light"] .theme-toggle .icon-sun  { display: none; }
[data-theme="light"] .theme-toggle .icon-moon { display: block; }


/* -- Mobile nav --------------------------------------------------------- */
.nav-toggle { display: none; }
.nav-toggle-btn { display: none; }


/* -- Tech grace notes --------------------------------------------------- */

/* Corner ticks — used on the hero. Four L-shaped crop marks sit in the
   hero's corners like a camera viewfinder / technical drawing frame. */
.hero { position: relative; }
.corner-tick {
  position: absolute;
  width: 12px;
  height: 12px;
  border: 0 solid var(--fg-subtle);
  opacity: 0.55;
  pointer-events: none;
}
.corner-tl { top: var(--space-4); left:  var(--space-4); border-width: 1px 0 0 1px; }
.corner-tr { top: var(--space-4); right: var(--space-4); border-width: 1px 1px 0 0; }
.corner-bl { bottom: var(--space-4); left:  var(--space-4); border-width: 0 0 1px 1px; }
.corner-br { bottom: var(--space-4); right: var(--space-4); border-width: 0 1px 1px 0; }

/* Mono file-path breadcrumb on single pages. */
.path-crumb {
  display: inline-block;
  margin: 0 0 var(--space-3);
  font-family: var(--font-mono);
  font-size: var(--type-caption);
  color: var(--fg-subtle);
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
}
.path-crumb-root { color: var(--accent); }
.path-crumb-sep  { color: var(--fg-subtle); opacity: 0.5; margin: 0 0.1em; }
.path-crumb-part { color: var(--fg-muted); }

/* `/` keyboard-shortcut affordance inside the publications search box. */
.pub-field-input-wrap { position: relative; }
.pub-field-input-wrap input { padding-right: 2.2rem; }
.pub-kbd {
  position: absolute;
  right: 0.45rem;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.35rem;
  padding: 0.1rem 0.35rem;
  background: var(--bg-raised);
  color: var(--fg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  line-height: 1;
  box-shadow: 0 1px 0 var(--border);
  user-select: none;
  transition: opacity var(--t-quick), visibility var(--t-quick);
}
.pub-field-input-wrap input:focus + .pub-kbd,
.pub-field-input-wrap input:not(:placeholder-shown) + .pub-kbd {
  opacity: 0;
  visibility: hidden;
}

/* Build tag in the footer. */
.footer-build {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  color: var(--fg-subtle);
  opacity: 0.7;
  font-variant-numeric: tabular-nums;
}


/* -- Main + section primitives ----------------------------------------- */
main { flex: 1; }

.section,
.container,
main > section,
main > article {
  max-width: var(--max-content);
  margin: 0 auto;
  padding: var(--space-12) var(--space-6);
}

.page-header {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-bottom: var(--space-12);
}
.page-title {
  font-size: var(--type-display);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.05;
  text-wrap: balance;
}
.page-description {
  margin-top: var(--space-2);
  color: var(--fg-muted);
  font-size: 1.0625rem;
  max-width: var(--max-prose);
  line-height: 1.55;
}
.page-content { max-width: var(--max-prose); }
.page-content.wide { max-width: 100%; }

/* Section heading inside a page (grid of cards etc.) */
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}
.section-title {
  font-family: var(--font-display);
  font-size: var(--type-h2);
  font-weight: 600;
  margin: 0;
}
.section-link {
  font-family: var(--font-mono);
  font-size: var(--type-caption);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--fg-subtle);
  text-decoration: none;
}
.section-link:hover { color: var(--accent); text-decoration: none; }
.section-link::after { content: " →"; }

/* Section-group title (used in team list, project list) */
.team-group, .project-group { margin-bottom: var(--space-12); }
.team-group:last-child, .project-group:last-child { margin-bottom: 0; }

.team-group-title,
.project-group-title {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin: 0 0 var(--space-4);
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: var(--type-caption);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--fg-subtle);
}
.team-group-title > span:first-child,
.project-group-title > span:first-child { color: var(--fg-muted); }
.team-count {
  display: inline-flex;
  align-items: center;
  padding: 0 0.4rem;
  height: 1.1rem;
  background: var(--bg-sunken);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--fg-subtle);
  font-size: 0.66rem;
  letter-spacing: 0.05em;
}


/* -- Buttons ------------------------------------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 0.55rem 1rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--type-small);
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color var(--t-quick), border-color var(--t-quick), color var(--t-quick), transform var(--t-quick);
}
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.btn-primary {
  background: var(--accent);
  color: var(--accent-fg);
}
.btn-primary:hover { background: var(--accent-strong); color: var(--accent-fg); text-decoration: none; }
.btn-primary:active { transform: translateY(1px); }

.btn-ghost {
  background: transparent;
  color: var(--fg);
  border-color: var(--border-strong);
}
.btn-ghost:hover { color: var(--accent); border-color: var(--accent); text-decoration: none; }


/* -- Hero --------------------------------------------------------------- */
.hero {
  max-width: var(--max-content);
  margin: 0 auto;
  padding: var(--space-16) var(--space-6) var(--space-8);
}
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: var(--space-12);
  align-items: center;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: var(--space-4);
  font-family: var(--font-mono);
  font-size: var(--type-caption);
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-subtle);
}
.hero-eyebrow::before {
  content: "";
  width: 0.4rem; height: 0.4rem;
  border-radius: 50%;
  background: var(--accent);
}

.hero-title {
  font-family: var(--font-display);
  font-size: var(--type-display);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.030em;
  margin: 0 0 var(--space-4);
  text-wrap: balance;
}
.hero-title-accent {
  font-style: italic;
  font-family: var(--font-prose);
  font-weight: 500;
  color: var(--accent);
}

.hero-subtitle {
  max-width: 38rem;
  font-family: var(--font-prose);
  font-size: 1.1rem;
  line-height: 1.5;
  color: var(--fg-muted);
  margin: 0 0 var(--space-6);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}

.hero-visual {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 280px;
}
.prism-art {
  width: 100%;
  max-width: 420px;
  aspect-ratio: 1;
  position: relative;
}
.hero-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}


/* -- Card primitives (used by features/areas/projects) ----------------- */
.card {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-6);
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  text-decoration: none;
  color: inherit;
  transition: border-color var(--t-base), background-color var(--t-base), transform var(--t-base);
}
.card:hover {
  background: var(--bg-hover);
  border-color: var(--border-strong);
  text-decoration: none;
  color: inherit;
}
.card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Feature cards on the homepage */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--space-4);
}
.feature-card { composes: card; }
.feature-card,
.feature-card:hover {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-6);
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  text-decoration: none;
  color: inherit;
  transition: border-color var(--t-base), background-color var(--t-base);
}
.feature-card:hover { background: var(--bg-hover); border-color: var(--border-strong); }
.feature-card h3 {
  font-size: var(--type-h4);
  font-weight: 600;
  margin: var(--space-1) 0 0;
}
.feature-card:hover h3 { color: var(--accent); }
.feature-card p {
  font-family: var(--font-prose);
  color: var(--fg-muted);
  font-size: var(--type-small);
  line-height: 1.55;
  margin: 0;
}
.feature-tag {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-subtle);
}


/* -- Post / list cards (publications & news posts) --------------------- */
.posts-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.post-card {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-3);
  padding: var(--space-6);
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  transition: border-color var(--t-base), background-color var(--t-base);
}
.post-card:hover { background: var(--bg-hover); border-color: var(--border-strong); }

.post-image {
  aspect-ratio: 4/3;
  overflow: hidden;
  border-radius: var(--r-sm);
}
.post-image img { width: 100%; height: 100%; object-fit: cover; }

.post-title {
  font-family: var(--font-display);
  font-size: var(--type-h3);
  font-weight: 600;
  line-height: 1.25;
  margin: 0;
}
.post-title a {
  color: var(--fg);
  text-decoration: none;
}
.post-card:hover .post-title a { color: var(--accent); }

.post-meta, .post-meta-inline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-mono);
  font-size: var(--type-caption);
  color: var(--fg-subtle);
}
.post-meta .sep, .post-meta-inline .sep { opacity: 0.5; }

.post-excerpt {
  font-family: var(--font-prose);
  color: var(--fg-muted);
  margin: 0;
  line-height: 1.55;
}

.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  margin-top: var(--space-2);
}
.post-tag {
  padding: 0.15rem 0.5rem;
  background: var(--bg-sunken);
  color: var(--fg-muted);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  font-family: var(--font-mono);
  font-size: var(--type-caption);
  text-decoration: none;
  transition: color var(--t-quick), border-color var(--t-quick);
}
.post-tag:hover {
  color: var(--accent);
  border-color: var(--accent);
  text-decoration: none;
}

@media (min-width: 720px) {
  .post-card {
    grid-template-columns: 200px 1fr;
    grid-template-rows: auto;
    align-items: start;
  }
  .post-card .post-image { grid-row: 1 / 99; aspect-ratio: 4/3; }
}


/* -- Single page (page.html) ------------------------------------------- */
.single { max-width: var(--max-prose); margin: 0 auto; padding: var(--space-12) var(--space-6); }
.single .post-header { margin-bottom: var(--space-8); }
.single .post-title {
  font-family: var(--font-display);
  font-size: var(--type-display);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.05;
  margin: var(--space-2) 0 var(--space-4);
}

.prose {
  font-family: var(--font-prose);
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--fg);
  max-width: var(--max-prose);
}
.prose h2 { font-family: var(--font-display); font-size: var(--type-h2); margin: var(--space-12) 0 var(--space-3); }
.prose h3 { font-family: var(--font-display); font-size: var(--type-h3); margin: var(--space-8) 0 var(--space-2); }
.prose p, .prose ul, .prose ol { margin-bottom: var(--space-4); }
.prose ul, .prose ol { padding-left: 1.5em; list-style: revert; }
.prose li { margin-bottom: 0.4em; }
.prose strong { color: var(--fg); font-weight: 600; }
.prose img { margin: var(--space-6) auto; border: 1px solid var(--border); }


/* -- Publication block (legacy WordPress-export markup) ---------------- */
.publication-title {
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--fg);
  margin-bottom: 0.2rem;
}
.publication-authors {
  color: var(--fg-muted);
  font-style: italic;
  font-family: var(--font-prose);
}
.publication-type, .publication-year, .publication-doi {
  display: inline-block;
  margin-right: var(--space-2);
  font-family: var(--font-mono);
  font-size: var(--type-caption);
  color: var(--fg-subtle);
}
.publication-doi a { word-break: break-all; }


/* -- Footer ------------------------------------------------------------- */
.site-footer {
  margin-top: var(--space-16);
  padding: var(--space-12) var(--space-6) var(--space-8);
  background: var(--bg-sunken);
  border-top: 1px solid var(--border);
}
.footer-inner {
  max-width: var(--max-content);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: var(--space-12);
  align-items: start;
}
.footer-brand p {
  font-family: var(--font-prose);
  color: var(--fg-muted);
  font-size: var(--type-small);
  line-height: 1.55;
  margin-top: var(--space-3);
  max-width: 30rem;
}
.footer-col-title {
  font-family: var(--font-mono);
  font-size: var(--type-caption);
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-subtle);
  margin-bottom: var(--space-3);
}
.footer-col ul { display: flex; flex-direction: column; gap: var(--space-1); }
.footer-col a {
  display: inline-block;
  padding: 0.15rem 0;
  color: var(--fg-muted);
  font-size: var(--type-small);
  text-decoration: none;
}
.footer-col a:hover { color: var(--accent); }

.footer-bottom {
  max-width: var(--max-content);
  margin: var(--space-8) auto 0;
  padding-top: var(--space-4);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-3);
  font-family: var(--font-mono);
  font-size: var(--type-caption);
  color: var(--fg-subtle);
}


/* =====================================================================
   Team
   ===================================================================== */
.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-3);
}

.team-card {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: var(--space-4);
  padding: var(--space-4);
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  text-decoration: none;
  color: inherit;
  transition: border-color var(--t-base), background-color var(--t-base);
}
.team-card:hover {
  background: var(--bg-hover);
  border-color: var(--border-strong);
  text-decoration: none;
  color: inherit;
}

.team-avatar {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--bg-sunken);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}
.team-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 0; }
.team-initials {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  color: var(--accent);
}

.team-info { min-width: 0; }
.team-name {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.25;
  color: var(--fg);
  margin: 0 0 0.1rem;
}
.team-card:hover .team-name { color: var(--accent); }

.team-role {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-subtle);
  margin-bottom: 0.3rem;
}
.team-interests {
  font-family: var(--font-prose);
  color: var(--fg-muted);
  font-size: var(--type-small);
  line-height: 1.45;
  margin: 0;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

/* --- single member page ------ */
.member { max-width: var(--max-prose); margin: 0 auto; padding: var(--space-12) var(--space-6); }

.back-link {
  display: inline-flex;
  align-items: center;
  margin-bottom: var(--space-6);
  font-family: var(--font-mono);
  font-size: var(--type-caption);
  color: var(--fg-subtle);
  text-decoration: none;
  letter-spacing: 0.04em;
}
.back-link:hover { color: var(--accent); text-decoration: none; }

.member-header {
  display: grid;
  grid-template-columns: 112px 1fr;
  gap: var(--space-6);
  align-items: start;
  padding-bottom: var(--space-8);
  margin-bottom: var(--space-8);
  border-bottom: 1px solid var(--border);
}

.member-avatar {
  width: 112px; height: 112px;
  border-radius: 50%;
  background: var(--bg-sunken);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.member-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 0; }
.member-avatar .team-initials { font-size: 1.85rem; }

.member-role-tag {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: var(--space-2);
}

.member-name {
  font-family: var(--font-display);
  font-size: clamp(1.875rem, 3vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.05;
  margin: 0 0 0.4rem;
}
.member-position { color: var(--fg); font-weight: 500; margin: 0; }
.member-affiliation {
  color: var(--fg-subtle);
  font-size: var(--type-small);
  margin: 0.15rem 0 0;
  font-family: var(--font-prose);
}

.member-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin: var(--space-4) 0 0;
}
.member-links a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.65rem;
  font-family: var(--font-mono);
  font-size: var(--type-caption);
  color: var(--fg-muted);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  text-decoration: none;
  transition: color var(--t-quick), border-color var(--t-quick);
}
.member-links a:hover { color: var(--accent); border-color: var(--accent); text-decoration: none; }

.member-links .orcid-link:hover { color: oklch(72% 0.16 138); border-color: oklch(72% 0.16 138); }
.orcid-icon { width: 0.95rem; height: 0.95rem; flex-shrink: 0; }

.member-section { margin-bottom: var(--space-12); }
.member-section-title {
  font-family: var(--font-mono);
  font-size: var(--type-caption);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--fg-subtle);
  margin-bottom: var(--space-4);
}

.interest-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
}
.interest-chips li {
  padding: 0.25rem 0.6rem;
  background: var(--bg-sunken);
  color: var(--fg-muted);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  font-family: var(--font-mono);
  font-size: var(--type-caption);
}

@media (max-width: 640px) {
  .member-header { grid-template-columns: 88px 1fr; gap: var(--space-4); }
  .member-avatar { width: 88px; height: 88px; }
  .member-avatar .team-initials { font-size: 1.4rem; }
}


/* =====================================================================
   Research areas
   ===================================================================== */
.area-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-4);
  margin-top: var(--space-6);
}

.area-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  text-decoration: none;
  color: inherit;
  overflow: hidden;
  transition: border-color var(--t-base), background-color var(--t-base);
}
.area-card:hover { background: var(--bg-hover); border-color: var(--border-strong); text-decoration: none; color: inherit; }

.area-card-image { aspect-ratio: 16/9; overflow: hidden; background: var(--bg-sunken); }
.area-card-image img { width: 100%; height: 100%; object-fit: cover; border-radius: 0; }

.area-card-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-6);
}

.area-tag {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-subtle);
}
.area-tag-lg { font-size: 0.78rem; margin-bottom: var(--space-3); }

.area-title {
  font-family: var(--font-display);
  font-size: var(--type-h3);
  font-weight: 600;
  line-height: 1.2;
  margin: 0;
  color: var(--fg);
}
.area-card:hover .area-title { color: var(--accent); }

.area-summary {
  font-family: var(--font-prose);
  color: var(--fg-muted);
  font-size: var(--type-small);
  line-height: 1.55;
  margin: 0;
}

.area-page { max-width: var(--max-prose); margin: 0 auto; padding: var(--space-12) var(--space-6); }
.area-hero {
  margin: 0 0 var(--space-8);
  border-radius: var(--r-md);
  overflow: hidden;
  border: 1px solid var(--border);
}
.area-hero img { width: 100%; height: auto; max-height: 360px; object-fit: cover; border-radius: 0; }
.area-prose { margin-bottom: var(--space-12); }


/* =====================================================================
   Publications list (used everywhere papers render)
   ===================================================================== */
.paper-list-section { margin-top: var(--space-12); }

.paper-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  counter-reset: paper;
}

.paper-item {
  position: relative;
  padding: var(--space-4) var(--space-6);
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  transition: border-color var(--t-base), background-color var(--t-base);
}
.paper-item:hover { background: var(--bg-hover); border-color: var(--border-strong); }

/* Featured papers carry a small leading badge — not a coloured side stripe. */
.paper-featured .paper-head::before {
  content: "★";
  display: inline-block;
  margin-right: 0.4rem;
  color: var(--accent);
  font-size: 0.85em;
  letter-spacing: 0;
}

.paper-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: 0.3rem;
  font-family: var(--font-mono);
  font-size: var(--type-caption);
  letter-spacing: 0.04em;
  color: var(--fg-subtle);
}
.paper-year { color: var(--fg-muted); font-weight: 500; }
.paper-type { text-transform: lowercase; }
.paper-type::before { content: "·\00a0"; }
.paper-badge {
  display: none;  /* the leading ★ replaces the badge */
}

.paper-title {
  font-family: var(--font-display);
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1.35;
  margin: 0 0 0.2rem;
  color: var(--fg);
}
.paper-title a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 0.2em;
  transition: text-decoration-color var(--t-quick), color var(--t-quick);
}
.paper-title a:hover { color: var(--accent); text-decoration-color: currentColor; }

.paper-authors {
  font-family: var(--font-prose);
  font-size: 0.9375rem;
  color: var(--fg-muted);
  margin: 0;
  line-height: 1.5;
}
.paper-authors .author-team {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}
.paper-authors .author-team:hover { text-decoration: underline; }
.paper-authors .author-ext     { color: var(--fg-muted); }
.paper-authors .author-unknown { color: var(--fg-subtle); }
.paper-sep { color: var(--fg-subtle); }

.paper-venue {
  font-family: var(--font-mono);
  font-size: var(--type-caption);
  color: var(--fg-subtle);
  margin: 0.3rem 0 0;
}

.paper-empty {
  padding: var(--space-6);
  background: var(--bg-sunken);
  border: 1px dashed var(--border);
  border-radius: var(--r-md);
  color: var(--fg-subtle);
  font-size: var(--type-small);
}


/* =====================================================================
   Publications page — toolbar
   ===================================================================== */
.pub-toolbar {
  display: grid;
  grid-template-columns: minmax(240px, 2fr) repeat(3, minmax(120px, 1fr)) auto;
  gap: var(--space-3);
  align-items: end;
  margin: var(--space-8) 0 var(--space-6);
  padding: var(--space-4) var(--space-6);
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  position: sticky;
  top: calc(48px + var(--space-3));
  z-index: 5;
}
.pub-field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-width: 0;
}
.pub-field-label {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-subtle);
  font-weight: 500;
}
.pub-field input,
.pub-field select {
  font-family: var(--font-display);
  font-size: var(--type-small);
  color: var(--fg);
  background: var(--bg-sunken);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 0.5rem 0.65rem;
  width: 100%;
  min-width: 0;
  transition: border-color var(--t-quick), box-shadow var(--t-quick);
}
.pub-field input::placeholder { color: var(--fg-subtle); }
.pub-field input:focus,
.pub-field select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.pub-count {
  display: inline-flex;
  align-items: baseline;
  gap: 0.3rem;
  padding: 0.55rem 0.85rem;
  font-family: var(--font-mono);
  font-size: var(--type-caption);
  color: var(--fg-muted);
  background: var(--bg-sunken);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  white-space: nowrap;
}
#pub-visible { color: var(--accent); font-weight: 600; font-size: var(--type-small); }
.pub-count-sep { color: var(--fg-subtle); }
.pub-count-word { color: var(--fg-subtle); font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.06em; }

.pub-list { margin-top: var(--space-4); }

.paper-areas {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  margin: 0.4rem 0 0;
}
.paper-area {
  display: inline-block;
  padding: 0.1rem 0.5rem;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: var(--r-sm);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: lowercase;
  letter-spacing: 0.04em;
  text-decoration: none;
}
.paper-area:hover { text-decoration: underline; }

@media (max-width: 880px) {
  .pub-toolbar { grid-template-columns: 1fr 1fr; position: static; }
  .pub-field-search { grid-column: 1 / -1; }
  .pub-count        { grid-column: 1 / -1; justify-self: start; }
}


/* =====================================================================
   Research projects
   ===================================================================== */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: var(--space-4);
}

.project-card {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: var(--space-4);
  padding: var(--space-6);
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  text-decoration: none;
  color: inherit;
  transition: border-color var(--t-base), background-color var(--t-base);
}
.project-card:hover { background: var(--bg-hover); border-color: var(--border-strong); text-decoration: none; color: inherit; }

.project-card-icon {
  width: 72px; height: 72px;
  border-radius: var(--r-sm);
  background: var(--bg-sunken);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  padding: 0.3rem;
}
.project-card-icon img { width: 100%; height: 100%; object-fit: contain; border-radius: 0; }

.project-card-mark,
.project-hero-mark {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--accent);
  text-align: center;
  line-height: 1;
}
.project-card-mark { font-size: 0.95rem; }
.project-hero-mark { font-size: 1.85rem; }

.project-card-body { display: flex; flex-direction: column; gap: 0.3rem; min-width: 0; }

.project-card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: 0.1rem;
}

.project-status {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.15rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-subtle);
  background: var(--bg-sunken);
}
.project-status::before {
  content: "";
  width: 0.35rem; height: 0.35rem;
  border-radius: 50%;
  background: currentColor;
}
.project-status-active   { color: var(--success); border-color: color-mix(in oklab, var(--success) 40%, var(--border)); }
.project-status-upcoming { color: var(--warning); border-color: color-mix(in oklab, var(--warning) 40%, var(--border)); }
.project-status-completed{ color: var(--fg-subtle); }

.project-dates {
  font-family: var(--font-mono);
  font-size: var(--type-caption);
  color: var(--fg-subtle);
}

.project-card-acronym {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
}

.project-card-title {
  font-family: var(--font-display);
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1.25;
  margin: 0;
  color: var(--fg);
}
.project-card:hover .project-card-title { color: var(--accent); }

.project-card-summary {
  font-family: var(--font-prose);
  color: var(--fg-muted);
  font-size: var(--type-small);
  line-height: 1.5;
  margin: 0;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
}

.project-card-funder {
  font-family: var(--font-mono);
  font-size: var(--type-caption);
  color: var(--fg-subtle);
  margin: 0.2rem 0 0;
}

/* --- landing page --- */
.project-page { max-width: var(--max-content); margin: 0 auto; padding: var(--space-12) var(--space-6); }

.project-hero {
  padding-bottom: var(--space-8);
  margin-bottom: var(--space-8);
  border-bottom: 1px solid var(--border);
}

.project-hero-top {
  display: grid;
  grid-template-columns: 112px 1fr;
  gap: var(--space-6);
  align-items: start;
}

.project-hero-icon {
  width: 112px; height: 112px;
  border-radius: var(--r-md);
  background: var(--bg-sunken);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 0.6rem;
}
.project-hero-icon img { width: 100%; height: 100%; object-fit: contain; border-radius: 0; }

.project-hero-identity { display: flex; flex-direction: column; gap: 0.3rem; }

.project-acronym {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}

.project-title {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin: 0;
}

.project-summary {
  font-family: var(--font-prose);
  font-size: 1.1rem;
  color: var(--fg-muted);
  margin: 0.3rem 0 0;
  max-width: 60ch;
  line-height: 1.5;
}

.project-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-6);
}

.project-cover {
  margin: 0 0 var(--space-8);
  border-radius: var(--r-md);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-sunken);
}
.project-cover img { width: 100%; height: auto; max-height: 360px; object-fit: cover; border-radius: 0; }

.project-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: var(--space-12);
  align-items: start;
}
.project-main { min-width: 0; }

.project-section {
  margin-top: var(--space-12);
  padding-top: var(--space-6);
  border-top: 1px solid var(--border);
}
.project-section-title {
  font-family: var(--font-mono);
  font-size: var(--type-caption);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--fg-subtle);
  margin: 0 0 var(--space-4);
}

/* partners grid */
.partner-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--space-3);
}
.partner-tile {
  display: flex;
  gap: var(--space-3);
  align-items: center;
  padding: var(--space-3) var(--space-4);
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  text-decoration: none;
  color: inherit;
  transition: border-color var(--t-base), background-color var(--t-base);
}
.partner-tile:hover { background: var(--bg-hover); border-color: var(--border-strong); text-decoration: none; color: inherit; }
.partner-logo {
  width: 44px; height: 44px;
  background: var(--bg-sunken);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}
.partner-logo img { max-width: 80%; max-height: 80%; object-fit: contain; border-radius: 0; }
.partner-mark {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.7rem;
  color: var(--accent);
  text-transform: uppercase;
}
.partner-meta { display: flex; flex-direction: column; gap: 0.1rem; min-width: 0; }
.partner-name {
  font-weight: 600;
  font-size: var(--type-small);
  color: var(--fg);
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.partner-country, .partner-role {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  color: var(--fg-subtle);
  letter-spacing: 0.04em;
}

/* sidebar */
.project-aside { display: flex; flex-direction: column; gap: var(--space-4); }

.project-info {
  padding: var(--space-3) var(--space-4);
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
}
.info-title {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--fg-subtle);
  margin-bottom: var(--space-2);
  font-weight: 500;
}
.info-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.1rem;
  padding: 0.4rem 0;
  border-top: 1px dashed var(--border);
  margin: 0;
}
.info-row:first-child { border-top: 0; padding-top: 0; }
.info-row dt {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fg-subtle);
  font-weight: 500;
}
.info-row dd {
  margin: 0;
  color: var(--fg);
  font-size: var(--type-small);
  line-height: 1.4;
}
.info-row dd a { color: var(--accent); text-decoration: none; }
.info-row dd a:hover { text-decoration: underline; }

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
}
.chip {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  background: var(--bg-sunken);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  font-family: var(--font-mono);
  font-size: var(--type-caption);
  color: var(--fg-muted);
  text-decoration: none;
}
.chip-area {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: transparent;
}
.chip-area:hover { border-color: var(--accent); text-decoration: none; }

@media (max-width: 880px) {
  .project-body { grid-template-columns: 1fr; }
  .project-hero-top { grid-template-columns: 80px 1fr; gap: var(--space-4); }
  .project-hero-icon { width: 80px; height: 80px; }
  .project-hero-mark { font-size: 1.5rem; }
}


/* =====================================================================
   Gallery shortcode
   ===================================================================== */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-3);
  margin: var(--space-6) 0;
}
.gallery img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 4/3; }


/* =====================================================================
   Mobile nav (off-canvas)
   ===================================================================== */
@media (max-width: 760px) {
  .nav-toggle-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.4rem; height: 2.4rem;
    color: var(--fg);
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    margin-left: auto;
  }
  .nav-toggle-btn span {
    display: block;
    width: 1rem;
    height: 1.5px;
    background: currentColor;
    position: relative;
  }
  .nav-toggle-btn span::before,
  .nav-toggle-btn span::after {
    content: "";
    position: absolute;
    left: 0; right: 0;
    height: 1.5px;
    background: currentColor;
  }
  .nav-toggle-btn span::before { top: -5px; }
  .nav-toggle-btn span::after  { top:  5px; }

  .nav-primary {
    display: none;
    position: absolute;
    top: 100%; left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    margin: 0;
    padding: var(--space-2);
    background: var(--bg-raised);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-2);
  }
  .nav-toggle:checked ~ .nav-primary { display: flex; }

  .nav-link { display: block; padding: 0.65rem 0.8rem; font-size: var(--type-body); }
  .submenu {
    position: static;
    visibility: visible;
    opacity: 1;
    transform: none;
    box-shadow: none;
    border: 0;
    background: transparent;
    padding-left: var(--space-3);
    min-width: 0;
  }
  .has-submenu > .nav-link::after { display: none; }

  .footer-inner { grid-template-columns: 1fr; gap: var(--space-6); }
  .hero-grid { grid-template-columns: 1fr; gap: var(--space-8); }
  .hero-visual { order: -1; }
  .prism-art { max-width: 240px; }
  .header-inner { padding: var(--space-3) var(--space-4); }
}
