/* Self-hosted IBM Plex (SIL Open Font License), Latin subsets from Google Fonts.
   IBM Plex Sans is a variable font: one file covers weights 400-600. */
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 400 600; font-display: swap;
  src: url(fonts/IBMPlexSans.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 400 600; font-display: swap;
  src: url(fonts/IBMPlexSans-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "IBM Plex Sans"; font-style: italic; font-weight: 400; font-display: swap;
  src: url(fonts/IBMPlexSans-400i.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 400; font-display: swap;
  src: url(fonts/IBMPlexMono-400.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 500; font-display: swap;
  src: url(fonts/IBMPlexMono-500.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/* ==========================================================================
   M-PRISM / Mascolino research site: design tokens, base, components
   Single drop-in stylesheet. No build step, no JS required.

   Fonts (put in <head> before this file):
   <link rel="preconnect" href="https://fonts.googleapis.com">
   <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
   <link href="https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500&family=IBM+Plex+Sans:ital,wght@0,400;0,500;0,600;1,400&display=swap" rel="stylesheet">

   Breakpoints (media queries cannot read custom properties, so they are
   literal): sm 40em (640px) · md 64em (1024px) · lg 80em (1280px).
   Theme: follows the OS; force with <html data-theme="light|dark">.
   Contrast ratios for every text/background pair: see specs/design.md.
   ========================================================================== */

/* ---------- 1. Tokens: light (default) ---------- */
:root {
  color-scheme: light dark;

  /* Surfaces */
  --bg:            #F7F7F4;  /* warm paper; nod to the old site's beige band */
  --surface:       #FFFFFF;  /* cards */
  --surface-sunk:  #EFF1F3;  /* table stripes, code, quiet panels */
  --plate:         #EEF1F4;  /* neutral plate behind figures */
  --band:          #21314D;  /* Mines Dark Blue: footer + feature bands */

  /* Text */
  --text:          #1A2233;  /* 14.8:1 on bg */
  --heading:       #21314D;  /* Mines Dark Blue, 12.1:1 */
  --muted:         #475366;  /* metadata, captions, 7.4:1 on bg */
  --band-text:     #F2F4F7;
  --band-muted:    #B9C6D9;
  --band-link:     #F6CF5B;

  /* Lines */
  --border:        #D6DBE2;  /* decorative hairlines only */
  --border-strong: #7F8A9B;  /* input/control boundaries, 3.25:1 */

  /* Action */
  --primary:       #09396C;  /* Mines Blaster Blue */
  --on-primary:    #FFFFFF;
  --accent:        #F1B91A;  /* Mines Golden Tech: fills only, never text on light */
  --on-accent:     #21314D;
  --link:          #0B4A8B;
  --link-hover:    #09396C;
  --focus:         #0272DE;  /* Mines Earth Blue */
  --student:       #9A4A12;  /* student-author mark in citations */

  /* Heat-map (fission-matrix motif). Sequential, monotone in luminance,
     low -> high. --heat-hot is the single "transient" cell. Decorative only. */
  --heat-0: #E6EBF1;
  --heat-1: #D3DEEA;
  --heat-2: #AFC3DA;
  --heat-3: #879EC3;  /* Mines Light Blue */
  --heat-4: #5A7AA8;
  --heat-5: #2F5589;
  --heat-6: #09396C;  /* Mines Blaster Blue */
  --heat-hot: #E07A2E; /* from the M-PRISM logo's orange beam */

  /* Elevation (used sparingly; borders do the structural work) */
  --shadow-hover: 0 1px 2px rgb(16 28 48 / .06), 0 6px 18px -6px rgb(16 28 48 / .18);

  /* ---------- Typography ---------- */
  --font-sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace;

  /* Fluid scale, 360px -> 1280px viewport. ~1.2 ratio on phones, ~1.33 on desktop. */
  --step-small: clamp(0.875rem, 0.8505rem + 0.1087vw, 0.9375rem);   /* 14 -> 15px */
  --step-body:  clamp(1.0625rem, 1.0380rem + 0.1087vw, 1.125rem);   /* 17 -> 18px */
  --step-lede:  clamp(1.1875rem, 1.1141rem + 0.3261vw, 1.375rem);   /* 19 -> 22px */
  --step-h4:    clamp(1.1875rem, 1.1141rem + 0.3261vw, 1.375rem);   /* 19 -> 22px */
  --step-h3:    clamp(1.375rem, 1.2283rem + 0.6522vw, 1.75rem);     /* 22 -> 28px */
  --step-h2:    clamp(1.625rem, 1.3560rem + 1.1957vw, 2.3125rem);   /* 26 -> 37px */
  --step-h1:    clamp(2.125rem, 1.5870rem + 2.3913vw, 3.5rem);      /* 34 -> 56px */

  --lh-tight: 1.15;   /* h1-h2 */
  --lh-snug:  1.3;    /* h3-h4, card titles */
  --lh-body:  1.6;    /* paragraphs */
  --lh-cite:  1.5;    /* publication lists */
  --measure:  68ch;   /* prose */
  --measure-wide: 80ch; /* citations */

  /* ---------- Space (4px base) ---------- */
  --space-3xs: 0.25rem;  /* 4  */
  --space-2xs: 0.5rem;   /* 8  */
  --space-xs:  0.75rem;  /* 12 */
  --space-s:   1rem;     /* 16 */
  --space-m:   1.5rem;   /* 24 */
  --space-l:   2rem;     /* 32 */
  --space-xl:  3rem;     /* 48 */
  --space-2xl: 4rem;     /* 64 */
  --space-3xl: 6rem;     /* 96 */
  --space-section: clamp(3rem, 1.4348rem + 6.9565vw, 7rem);   /* 48 -> 112px */
  --space-gutter:  clamp(1rem, 0.4130rem + 2.6087vw, 2.5rem);  /* page side padding */
  --space-gap:     clamp(1rem, 0.6087rem + 1.7391vw, 2rem);    /* grid gap */
  --space-window:  clamp(2.5rem, 1.5rem + 2.5vw, 4rem);       /* 40 -> 64px: gap between sheets, where the field shows */

  /* ---------- Layout ---------- */
  --container:      72rem;  /* 1152px content */
  --container-wide: 80rem;  /* 1280px header/footer/figure bleeds */
  --radius-s: 4px;          /* chips, buttons, inputs */
  --radius-m: 6px;          /* cards, figure plates, photos */
  --header-h: 4rem;

  /* Figure and ground (see design.md, Background motif). Three value levels:
     ground (the reactor core: the animated field and the gutters) < paper (sheets) < inset (cards, plates). */
  --ground: var(--band);       /* Mines Dark Blue */
  --paper: var(--bg);          /* warm paper */
  --inset: var(--surface);
  --sheet-line: var(--border);
  --inset-line: var(--heat-3);  /* Mines Light Blue frame on figures and cards inside a sheet */
  /* The dark heat ramp, named once: the dark theme and anything drawn on the navy ground use it */
  --heat-dark-0: #17233A; --heat-dark-1: #1F3456; --heat-dark-2: #2B4A78; --heat-dark-3: #46689A;
  --heat-dark-4: #6D8DBC; --heat-dark-5: #9DB6D9; --heat-dark-6: #CFDCE9; --heat-dark-hot: #F0A050;
  /* The field uses one palette in both themes */
  --field-thermal: #6CB4FF;    /* = dark --focus */
  --field-warm: var(--heat-dark-hot);
  --field-fast: #F1B91A;       /* = --accent: Golden Tech as light, never as text */
  --field-pellet: var(--heat-dark-2);
  --field-clad: var(--heat-dark-3);
  --field-flux: #0272DE;       /* = light --focus, Earth Blue: the thermal-flux glow */
  --field-quiet: 1;            /* scales the static layers (lattice, flux) */
  /* University tags on the Team page: one hue per school, the short name always printed on it.
     Light: white ink, 7.83:1 (PoliTO) to 13.03:1 (Mines). Dark: light tints with --org-ink, 9.42:1 or more. */
  --org-ink: #FFFFFF;
  --org-mines: #21314D; --org-polito: #0B5D4B; --org-polimi: #5B2A86; --org-unilj: #9B1C1C; --org-vt: #7C3A00;
}

/* ---------- 1b. Tokens: dark ---------- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0D1522; --surface: #131E30; --surface-sunk: #0A111C; --plate: #E6EAF0; --band: #080E18;
    --text: #E6EBF2; --heading: #F2F5F9; --muted: #A6B3C6;
    --band-text: #E6EBF2; --band-muted: #A6B3C6; --band-link: #F6CF5B;
    --border: #26344B; --border-strong: #6B7C96;
    --primary: #F1B91A; --on-primary: #14213A; --accent: #F1B91A; --on-accent: #14213A;
    --link: #8DB9F2; --link-hover: #B5D2F7; --focus: #6CB4FF; --student: #F0B27A;
    --heat-0: #17233A; --heat-1: #1F3456; --heat-2: #2B4A78; --heat-3: #46689A;
    --heat-4: #6D8DBC; --heat-5: #9DB6D9; --heat-6: #CFDCE9; --heat-hot: #F0A050;
    --shadow-hover: 0 0 0 1px var(--border-strong), 0 8px 24px -8px rgb(0 0 0 / .6);
    --paper: var(--surface); --inset: var(--heat-0); --sheet-line: var(--heat-4); --field-quiet: .6;
    --org-ink: #0D1522; --org-mines: #A9C4E6; --org-polito: #8FD3BF; --org-polimi: #CDB4E8; --org-unilj: #F2A7A0; --org-vt: #F6B88A;
  }
}
:root[data-theme="dark"] {
  --bg: #0D1522; --surface: #131E30; --surface-sunk: #0A111C; --plate: #E6EAF0; --band: #080E18;
  --text: #E6EBF2; --heading: #F2F5F9; --muted: #A6B3C6;
  --band-text: #E6EBF2; --band-muted: #A6B3C6; --band-link: #F6CF5B;
  --border: #26344B; --border-strong: #6B7C96;
  --primary: #F1B91A; --on-primary: #14213A; --accent: #F1B91A; --on-accent: #14213A;
  --link: #8DB9F2; --link-hover: #B5D2F7; --focus: #6CB4FF; --student: #F0B27A;
  --heat-0: #17233A; --heat-1: #1F3456; --heat-2: #2B4A78; --heat-3: #46689A;
  --heat-4: #6D8DBC; --heat-5: #9DB6D9; --heat-6: #CFDCE9; --heat-hot: #F0A050;
  --shadow-hover: 0 0 0 1px var(--border-strong), 0 8px 24px -8px rgb(0 0 0 / .6);
  --paper: var(--surface); --inset: var(--heat-0); --sheet-line: var(--heat-4); --field-quiet: .6;
  --org-ink: #0D1522; --org-mines: #A9C4E6; --org-polito: #8FD3BF; --org-polimi: #CDB4E8; --org-unilj: #F2A7A0; --org-vt: #F6B88A;
}
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"]  { color-scheme: dark; }

/* ---------- 2. Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + var(--space-s)); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--step-body);
  line-height: var(--lh-body);
  font-kerning: normal;
  font-variant-numeric: proportional-nums;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
h1, h2, h3, h4 { color: var(--heading); font-weight: 600; margin: 0 0 var(--space-xs); text-wrap: balance; }
h1 { font-size: var(--step-h1); line-height: var(--lh-tight); letter-spacing: -0.02em; }
h2 { font-size: var(--step-h2); line-height: var(--lh-tight); letter-spacing: -0.015em; }
h3 { font-size: var(--step-h3); line-height: var(--lh-snug);  letter-spacing: -0.01em; }
h4 { font-size: var(--step-h4); line-height: var(--lh-snug); font-weight: 500; }
p, ul, ol, dl { margin: 0 0 var(--space-s); }
p, li { max-width: var(--measure); text-wrap: pretty; }
small, .small { font-size: var(--step-small); }
.lede { font-size: var(--step-lede); line-height: 1.5; color: var(--text); max-width: 60ch; }
.muted { color: var(--muted); }
.mono, code, kbd { font-family: var(--font-mono); font-size: 0.92em; }
.eyebrow {
  font-family: var(--font-mono); font-size: var(--step-small); font-weight: 500;
  letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted);
  margin: 0 0 var(--space-xs);
}
sub, sup { line-height: 0; }
img, svg, video { display: block; max-width: 100%; height: auto; }
hr { border: 0; border-top: 1px solid var(--border); margin: var(--space-xl) 0; }

a { color: var(--link); text-decoration-line: underline; text-decoration-thickness: 1px; text-underline-offset: 0.18em; text-decoration-color: color-mix(in srgb, currentColor 45%, transparent); }
a:hover { color: var(--link-hover); text-decoration-color: currentColor; text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 2px; }
::selection { background: color-mix(in srgb, var(--accent) 45%, transparent); color: inherit; }

.skip-link { position: absolute; left: var(--space-s); top: -10rem; z-index: 100; background: var(--surface); color: var(--link); padding: var(--space-2xs) var(--space-s); border: 2px solid var(--focus); border-radius: var(--radius-s); }
.skip-link:focus { top: var(--space-s); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }

/* ---------- 3. Layout ---------- */
.container { width: min(100% - 2 * var(--space-gutter), var(--container)); margin-inline: auto; }
.container--wide { width: min(100% - 2 * var(--space-gutter), var(--container-wide)); margin-inline: auto; }
.section { padding-block: var(--space-section); }
.section + .section { padding-top: 0; }
.section--band { background: var(--band); color: var(--band-text); --heading: var(--band-text); --muted: var(--band-muted); --link: var(--band-link); --link-hover: #FFFFFF; --focus: var(--band-link); }
.section__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--space-xs) var(--space-l); margin-bottom: var(--space-l); }
.section__head > :last-child:not(:first-child) { font-size: var(--step-small); }

/* 12-col grid; children span via utility classes. Collapses to 1 col < 40em. */
.grid { display: grid; gap: var(--space-gap); grid-template-columns: repeat(12, minmax(0, 1fr)); }
.grid > * { grid-column: 1 / -1; }
@media (min-width: 40em) { .grid > .sm-6 { grid-column: span 6; } }
@media (min-width: 64em) {
  .grid > .md-4 { grid-column: span 4; } .grid > .md-5 { grid-column: span 5; }
  .grid > .md-6 { grid-column: span 6; } .grid > .md-7 { grid-column: span 7; } .grid > .md-8 { grid-column: span 8; }
}
/* Auto-fill card grid (projects, people, courses) */
.cards { display: grid; gap: var(--space-gap); grid-template-columns: repeat(auto-fill, minmax(min(100%, 20rem), 1fr)); }
.cards--people { grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr)); }
.stack > * + * { margin-top: var(--space-s); }

/* ---------- 4. Signature motif: fission-matrix heat-map ----------
   Pure CSS, one empty element: <div class="fm-matrix" aria-hidden="true"></div>
   8x8 diagonal-dominant matrix (a_ij ~ exp(-|i-j|/1.25), slightly stronger
   downstream coupling) with one "hot" cell = a local transient.
   Gutters are drawn by the last two layers in the page background colour. */
.fm-matrix {
  --fm-gap: 3px;
  --fm-gap-color: var(--bg);
  aspect-ratio: 1;
  width: 100%;
  background:
    repeating-linear-gradient(90deg, transparent 0 calc(12.5% - var(--fm-gap)), var(--fm-gap-color) 0 12.5%),
    repeating-linear-gradient(180deg, transparent 0 calc(12.5% - var(--fm-gap)), var(--fm-gap-color) 0 12.5%),
    linear-gradient(90deg, var(--heat-6) 0 12.5%, var(--heat-3) 0 25%, var(--heat-1) 0 50%, var(--heat-0) 0),
    linear-gradient(90deg, var(--heat-2) 0 12.5%, var(--heat-6) 0 25%, var(--heat-3) 0 37.5%, var(--heat-1) 0 62.5%, var(--heat-0) 0),
    linear-gradient(90deg, var(--heat-1) 0 12.5%, var(--heat-2) 0 25%, var(--heat-6) 0 37.5%, var(--heat-3) 0 50%, var(--heat-1) 0 75%, var(--heat-0) 0),
    linear-gradient(90deg, var(--heat-0) 0 12.5%, var(--heat-1) 0 25%, var(--heat-2) 0 37.5%, var(--heat-6) 0 50%, var(--heat-3) 0 62.5%, var(--heat-1) 0 87.5%, var(--heat-0) 0),
    linear-gradient(90deg, var(--heat-0) 0 25%, var(--heat-1) 0 37.5%, var(--heat-2) 0 50%, var(--heat-6) 0 75%, var(--heat-1) 0),
    linear-gradient(90deg, var(--heat-0) 0 37.5%, var(--heat-1) 0 50%, var(--heat-5) 0 62.5%, var(--heat-hot) 0 75%, var(--heat-3) 0 87.5%, var(--heat-1) 0),
    linear-gradient(90deg, var(--heat-0) 0 50%, var(--heat-1) 0 62.5%, var(--heat-2) 0 75%, var(--heat-6) 0 87.5%, var(--heat-3) 0),
    linear-gradient(90deg, var(--heat-0) 0 62.5%, var(--heat-1) 0 75%, var(--heat-2) 0 87.5%, var(--heat-6) 0);
  background-size: 100% 100%, 100% 100%, 100% 12.5%, 100% 12.5%, 100% 12.5%, 100% 12.5%, 100% 12.5%, 100% 12.5%, 100% 12.5%, 100% 12.5%;
  background-position: 0 0, 0 0, 0 0%, 0 14.2857%, 0 28.5714%, 0 42.8571%, 0 57.1429%, 0 71.4286%, 0 85.7143%, 0 100%;
  background-repeat: no-repeat;
}
/* Single-row strip: section divider / card top rule. Reads as one matrix row. */
.fm-strip {
  height: 6px; width: 100%; border: 0; margin: 0;
  background: linear-gradient(90deg, var(--heat-1) 0 12.5%, var(--heat-2) 0 25%, var(--heat-3) 0 37.5%, var(--heat-6) 0 50%, var(--heat-hot) 0 62.5%, var(--heat-4) 0 75%, var(--heat-2) 0 87.5%, var(--heat-1) 0);
}
/* 3x3 mark for the header lockup and favicon-like uses. */
.fm-mark {
  --s: 1.5rem; width: var(--s); height: var(--s); flex: none; border-radius: 2px;
  background:
    repeating-linear-gradient(90deg, transparent 0 calc(33.333% - 2px), var(--fm-gap-color, var(--bg)) 0 33.333%),
    repeating-linear-gradient(180deg, transparent 0 calc(33.333% - 2px), var(--fm-gap-color, var(--bg)) 0 33.333%),
    linear-gradient(90deg, var(--heat-6) 0 33.333%, var(--heat-3) 0 66.666%, var(--heat-1) 0) 0 0 / 100% 33.333% no-repeat,
    linear-gradient(90deg, var(--heat-3) 0 33.333%, var(--heat-hot) 0 66.666%, var(--heat-3) 0) 0 50% / 100% 33.333% no-repeat,
    linear-gradient(90deg, var(--heat-1) 0 33.333%, var(--heat-3) 0 66.666%, var(--heat-6) 0) 0 100% / 100% 33.333% no-repeat;
}

/* ---------- 5. Header / nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: saturate(1.2) blur(8px);
  border-bottom: 1px solid var(--border);
}
.site-header__inner { display: flex; flex-wrap: wrap; align-items: center; gap: 0 var(--space-l); min-height: var(--header-h); }
.brand { display: inline-flex; align-items: center; gap: var(--space-xs); color: var(--heading); text-decoration: none; padding-block: var(--space-2xs); }
.brand:hover { color: var(--heading); }
.brand__name { font-weight: 600; font-size: 1.0625rem; letter-spacing: 0.01em; line-height: 1.1; }
.brand__sub { display: block; font-family: var(--font-mono); font-size: 0.75rem; font-weight: 400; color: var(--muted); letter-spacing: 0.02em; }
.nav { margin-left: auto; }
.nav ul { display: flex; gap: var(--space-3xs); list-style: none; margin: 0; padding: 0; }
.nav a {
  display: block; padding: var(--space-2xs) var(--space-xs);
  color: var(--text); text-decoration: none; font-size: 0.9375rem; font-weight: 500;
  border-radius: var(--radius-s); min-height: 44px; line-height: 28px;
  box-shadow: inset 0 -2px 0 transparent;
}
.nav a:hover { background: var(--surface-sunk); color: var(--heading); }
.nav a[aria-current="page"] { color: var(--heading); box-shadow: inset 0 -2px 0 var(--accent); border-radius: 0; }
/* < 64em: nav becomes a full-width, horizontally scrollable row (no JS). */
@media (max-width: 39.99em) { .brand__sub { display: none; } .site-header { position: static; } }
@media (max-width: 63.99em) {
  .nav { margin-left: 0; width: 100%; overflow-x: auto; scrollbar-width: none; margin-inline: calc(-1 * var(--space-xs)); }
  .nav::-webkit-scrollbar { display: none; }
  .nav ul { width: max-content; }
}

/* ---------- 6. Hero ---------- */
.hero { padding-block: var(--space-section) calc(var(--space-section) * .75); }
.hero__grid { display: grid; gap: var(--space-xl) var(--space-gap); align-items: center; }
@media (min-width: 64em) { .hero__grid { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); } }
.hero__title { max-width: 18ch; margin-bottom: var(--space-m); }
.hero__title em { font-style: normal; background: linear-gradient(transparent 62%, color-mix(in srgb, var(--accent) 55%, transparent) 0); }
.hero__lede { margin-bottom: var(--space-l); }
.hero__actions { display: flex; flex-wrap: wrap; gap: var(--space-xs); }
.hero__meta { margin-top: var(--space-l); display: flex; flex-wrap: wrap; gap: var(--space-2xs) var(--space-m); font-family: var(--font-mono); font-size: var(--step-small); color: var(--muted); }
/* Portrait sits on the fission matrix, offset down-right by exactly two
   matrix cells (20% of the figure = 2/8 of an 80%-wide matrix), so the
   visible L shows whole cells: the dominant diagonal and its first couplings. */
.hero__figure { position: relative; width: min(100%, 26rem); justify-self: center; margin: 0; }
.hero__figure .fm-matrix { position: absolute; top: 0; left: 0; width: 80%; }
/* margins (not padding on the figure) so % resolves against the figure width */
.hero__photo { position: relative; aspect-ratio: 4 / 5; width: 80%; margin: 20% 0 0 20%; object-fit: cover; object-position: 50% 25%; border-radius: var(--radius-m); background: var(--plate); }
@media (max-width: 39.99em) { .hero__figure { width: min(100%, 18rem); } }

/* ---------- 7. Buttons / CTA ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2xs);
  min-height: 44px; padding: 0.625rem 1.125rem;
  font: 500 0.9375rem/1.2 var(--font-sans); letter-spacing: 0.01em;
  border-radius: var(--radius-s); border: 1px solid transparent;
  text-decoration: none; cursor: pointer;
  transition: background-color .15s, border-color .15s, color .15s;
}
.btn--primary { background: var(--primary); color: var(--on-primary); }
.btn--primary:hover { background: color-mix(in srgb, var(--primary) 86%, var(--text)); color: var(--on-primary); }
.btn--accent { background: var(--accent); color: var(--on-accent); }
.btn--accent:hover { background: color-mix(in srgb, var(--accent) 85%, #000); color: var(--on-accent); }
.btn--ghost { background: transparent; color: var(--heading); border-color: var(--border-strong); }
.btn--ghost:hover { background: var(--surface-sunk); color: var(--heading); border-color: var(--heading); }
.btn__arrow { font-family: var(--font-mono); transition: transform .15s; }
.btn:hover .btn__arrow { transform: translateX(3px); }
/* Inline text CTA, e.g. "All publications ->" */
.cta-link { font-weight: 500; text-decoration: none; }
.cta-link::after { content: " \2192"; font-family: var(--font-mono); }
.cta-link:hover { text-decoration: underline; }

/* ---------- 8. Figures: neutral plate, fixed aspect, never cropped ---------- */
.plate {
  position: relative; margin: 0;
  aspect-ratio: var(--ratio, 16 / 10);
  background: var(--plate);
  border: 1px solid var(--border);
  border-radius: var(--radius-m);
  overflow: hidden;
  display: block;
}
/* Absolutely placed so the image can never stretch the fixed-ratio box. */
.plate > img {
  position: absolute; inset: var(--plate-pad, var(--space-xs));
  width: calc(100% - 2 * var(--plate-pad, var(--space-xs)));
  height: calc(100% - 2 * var(--plate-pad, var(--space-xs)));
  object-fit: contain; object-position: center;
}
.plate--auto > img { position: static; width: 100%; height: auto; margin: 0 auto; }
.plate--auto { padding: var(--plate-pad, var(--space-xs)); }
.plate--square { --ratio: 1; }
.plate--wide   { --ratio: 16 / 9; }
.plate--flush  { --plate-pad: 0px; }      /* AI illustrations already have a margin */
.plate--auto   { aspect-ratio: auto; }  /* detail pages: natural height */
.figure { margin: 0 0 var(--space-l); }
.figure figcaption { margin-top: var(--space-2xs); font-size: var(--step-small); color: var(--muted); line-height: 1.45; max-width: var(--measure); }
.figure figcaption b { color: var(--text); font-weight: 600; }
/* Click-to-enlarge (plain link to the full-size file). */
a.plate:hover { border-color: var(--border-strong); }

/* ---------- 9. Project card ---------- */
.project-card {
  position: relative; display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-m);
  overflow: hidden; transition: border-color .15s, box-shadow .15s, transform .15s;
}
.project-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-hover); }
.project-card:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; }
.project-card .plate { border: 0; border-bottom: 1px solid var(--border); border-radius: 0; }
.project-card__body { display: flex; flex-direction: column; gap: var(--space-2xs); padding: var(--space-m); flex: 1; }
.project-card__title { font-size: var(--step-h4); font-weight: 600; line-height: var(--lh-snug); margin: 0; }
.project-card__title a { color: var(--heading); text-decoration: none; }
.project-card__title a::after { content: ""; position: absolute; inset: 0; } /* stretched link */
.project-card__title a:focus-visible { outline: none; }
.project-card__tagline { color: var(--text); margin: 0; font-size: 1rem; }
.project-card__foot { margin-top: auto; padding-top: var(--space-xs); display: flex; flex-wrap: wrap; gap: var(--space-3xs) var(--space-xs); font-size: var(--step-small); color: var(--muted); }
.tags { display: flex; flex-wrap: wrap; gap: var(--space-3xs); list-style: none; margin: 0; padding: 0; }
.tag {
  font-family: var(--font-mono); font-size: 0.75rem; line-height: 1.5; letter-spacing: 0.01em;
  padding: 0.0625rem 0.4375rem; border-radius: var(--radius-s);
  background: var(--surface-sunk); color: var(--muted); border: 1px solid var(--border);
}
/* Featured variant: horizontal on wide screens */
@media (min-width: 64em) {
  .project-card--feature { flex-direction: row; grid-column: 1 / -1; }
  .project-card--feature .plate { flex: 0 0 55%; border-bottom: 0; border-right: 1px solid var(--border); }
  .project-card--feature .project-card__body { padding: var(--space-xl); justify-content: center; }
  .project-card--feature .project-card__title { font-size: var(--step-h3); }
}

/* ---------- 10. Publication item (citation) ----------
   <li class="pub">
     <span class="pub__year">2026</span>
     <div>
       <span class="pub__type">Journal</span>
       <cite class="pub__title"><a href="https://doi.org/...">Title</a></cite>
       <p class="pub__authors">D. S. Yoon, ..., <b class="pub__me">V. Mascolino</b>, <span class="pub__student">S. Balouza</span></p>
       <p class="pub__venue"><i>Nuclear Engineering and Design</i>, vol. 455, p. 114930</p>
       <p class="pub__links"><a class="pub__doi" href="https://doi.org/...">doi:10.1016/...</a></p>
     </div>
   </li>                                                                     */
.pubs { list-style: none; margin: 0; padding: 0; max-width: var(--measure-wide); }
.pub {
  display: grid; grid-template-columns: 4.25rem minmax(0, 1fr); gap: 0 var(--space-s);
  padding-block: var(--space-m); border-top: 1px solid var(--border);
  line-height: var(--lh-cite);
}
.pub:last-child { border-bottom: 1px solid var(--border); }
.pub p { margin: 0; max-width: none; }
.pub__year { font-family: var(--font-mono); font-size: var(--step-small); font-variant-numeric: tabular-nums; color: var(--muted); padding-top: 0.2em; }
.pub__type {
  display: inline-block; margin-bottom: var(--space-3xs);
  font-family: var(--font-mono); font-size: 0.6875rem; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted);
}
.pub__type::before { content: ""; display: inline-block; width: .5em; height: .5em; margin-right: .45em; background: var(--heat-4); vertical-align: 0.05em; }
.pub[data-type="journal"]    .pub__type::before { background: var(--heat-6); }
.pub[data-type="conference"] .pub__type::before { background: var(--heat-4); }
.pub[data-type="preprint"]   .pub__type::before { background: var(--heat-hot); }
.pub[data-type="report"]     .pub__type::before { background: var(--heat-2); }
.pub__title { display: block; font-style: normal; font-weight: 500; font-size: 1.0625rem; color: var(--heading); margin-bottom: var(--space-3xs); text-wrap: pretty; }
.pub__title a { color: inherit; text-decoration: none; }
.pub__title a:hover { color: var(--link-hover); text-decoration: underline; }
.pub__authors { font-size: var(--step-small); color: var(--text); }
.pub__me { font-weight: 600; }
.pub__student { text-decoration: underline dotted var(--student) 2px; text-underline-offset: 0.22em; }
.pub__venue { font-size: var(--step-small); color: var(--muted); }
.pub__venue i { font-style: italic; color: var(--text); }
.pub__links { margin-top: var(--space-3xs) !important; display: flex; flex-wrap: wrap; gap: var(--space-xs); font-family: var(--font-mono); font-size: 0.8125rem; }
.pub__doi { overflow-wrap: anywhere; }
.pubs-legend { font-size: var(--step-small); color: var(--muted); }
.pubs-legend .pub__student { color: var(--text); }
@media (max-width: 39.99em) {
  .pub { grid-template-columns: 1fr; }
  .pub__year { padding: 0 0 var(--space-3xs); }
}

/* ---------- 11. Person card ----------
   Photos are pre-cropped to 4:5; --focus-y fine-tunes if a raw image is used. */
.person { display: flex; flex-direction: column; gap: var(--space-2xs); }
.person__photo {
  aspect-ratio: 4 / 5; width: 100%; object-fit: cover;
  object-position: var(--focus-x, 50%) var(--focus-y, 30%);
  border-radius: var(--radius-m); background: var(--plate);
  border: 1px solid var(--border);
}
.person__name { font-size: var(--step-h4); font-weight: 600; margin: var(--space-2xs) 0 0; }
.person__role { font-family: var(--font-mono); font-size: 0.8125rem; color: var(--muted); margin: 0; }
.person__bio { font-size: 0.9375rem; line-height: 1.55; margin: var(--space-3xs) 0 0; }
.person__project { font-size: var(--step-small); margin: 0; }
.person__award { font-size: var(--step-small); border-left: 3px solid var(--accent); padding-left: var(--space-xs); margin: var(--space-2xs) 0 0; }
/* No-photo members: a monogram on a mini matrix, never a grey silhouette. */
.person__monogram {
  display: grid; align-content: start; justify-items: start; padding: var(--space-m);
  aspect-ratio: 4 / 5; border-radius: var(--radius-m);
  border: 1px solid var(--border); background: var(--surface); position: relative; overflow: hidden;
}
.person__monogram .fm-matrix { position: absolute; inset: auto -10% -10% auto; width: 70%; opacity: .55; --fm-gap-color: var(--surface); }
.person__monogram span { position: relative; font-weight: 600; font-size: 2rem; color: var(--heading); letter-spacing: 0.02em; }
/* Compact roster row for members without bios */
.roster { list-style: none; padding: 0; margin: 0; columns: 16rem; column-gap: var(--space-gap); }
.roster li { break-inside: avoid; padding: var(--space-2xs) 0; border-top: 1px solid var(--border); }
.roster small { display: block; color: var(--muted); }

/* ---------- 12. Footer ---------- */
.site-footer {
  background: var(--band); color: var(--band-text);
  --heading: var(--band-text); --muted: var(--band-muted); --link: var(--band-link); --link-hover: #FFFFFF; --focus: var(--band-link);
  --fm-gap-color: var(--band);
  padding-block: var(--space-2xl) var(--space-l); font-size: var(--step-small);
}
.site-footer .fm-strip { margin-bottom: var(--space-xl); }
.site-footer__grid { display: grid; gap: var(--space-l) var(--space-gap); }
@media (min-width: 40em) { .site-footer__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 64em) { .site-footer__grid { grid-template-columns: 2fr 1fr 1fr 1fr; } }
.site-footer h2 { font-family: var(--font-mono); font-size: 0.75rem; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--band-muted); margin-bottom: var(--space-xs); }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li + li { margin-top: var(--space-3xs); }
.site-footer address { font-style: normal; color: var(--band-muted); }
.site-footer__logos { display: flex; align-items: center; gap: var(--space-m); }
.site-footer__logos img { height: 3rem; width: auto; }
.site-footer__legal { margin-top: var(--space-xl); padding-top: var(--space-m); border-top: 1px solid rgb(255 255 255 / .14); display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-xs); color: var(--band-muted); }

/* ---------- 13. Motion + print ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; scroll-behavior: auto !important; }
}
@media print {
  .site-header, .site-footer, .hero__figure, .fm-matrix, .fm-strip, .btn { display: none !important; }
  body { background: #fff !important; color: #000; font-size: 11pt; }
  .section--band > .container { background: none !important; color: #000; --heading: #000; --muted: #333; --link: #000; }
  a { color: #000; }
  .pub__doi::after { content: ""; }
}

/* ==========================================================================
   Page-level additions on top of specs/design-tokens.css
   ========================================================================== */

/* Header lockup */
.brand__text { display: flex; flex-direction: column; }

/* Page intro (non-home pages) */
.page-head { padding-block: var(--space-xl) 0; }
.page-head h1 { margin-bottom: var(--space-s); }
.page-head .lede { margin: 0; }

/* Hero extras */
.hero__role { font-size: var(--step-lede); color: var(--heading); font-weight: 500; margin-bottom: var(--space-s); max-width: 36ch; }
.hero__links { margin-top: var(--space-m); display: flex; flex-wrap: wrap; gap: var(--space-2xs) var(--space-m); font-size: var(--step-small); }
.hero__links a { display: inline-flex; align-items: center; min-height: 44px; }

/* Facts row */
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr)); gap: var(--space-gap); margin: 0; padding: 0; list-style: none; }
.facts li { border-top: 2px solid var(--heading); padding-top: var(--space-xs); max-width: none; }
.facts b { display: block; font-size: var(--step-h2); line-height: 1.1; color: var(--heading); font-weight: 600; letter-spacing: -0.015em; }
.facts span { font-size: var(--step-small); color: var(--muted); }

/* Highlights (student achievements) */
.highlights { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-gap); grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr)); }
.highlight { border-left: 3px solid var(--accent); padding: var(--space-2xs) 0 var(--space-2xs) var(--space-s); max-width: none; }
.highlight__when { font-family: var(--font-mono); font-size: 0.8125rem; color: var(--muted); display: block; margin-bottom: var(--space-3xs); }
.highlight p { margin: 0; font-size: 1rem; }

/* Tabs-free two-column recent publications */
.pub-cols { display: grid; gap: var(--space-xl) var(--space-gap); }
@media (min-width: 64em) { .pub-cols { grid-template-columns: 1fr 1fr; } .pub-cols .pub { grid-template-columns: 1fr; } .pub-cols .pub__year { padding: 0 0 var(--space-3xs); } }
.pub-cols h3 { font-size: var(--step-h4); }
.pub__project { font-family: var(--font-sans); }

/* Team strip on home */
.team-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 9rem), 1fr)); gap: var(--space-s); list-style: none; padding: 0; margin: 0 0 var(--space-l); }
.team-strip li { max-width: none; }
.team-strip img { aspect-ratio: 4 / 5; width: 100%; object-fit: cover; border-radius: var(--radius-m); border: 1px solid var(--border); background: var(--plate); }
.team-strip b { display: block; font-size: 0.9375rem; color: var(--heading); margin-top: var(--space-2xs); line-height: 1.3; }
.team-strip span { font-size: 0.8125rem; color: var(--muted); }

/* Callout band */
.callout { display: grid; gap: var(--space-l) var(--space-gap); align-items: center; }
@media (min-width: 64em) { .callout { grid-template-columns: 7fr 5fr; } }
.callout .fm-matrix { max-width: 16rem; justify-self: center; --fm-gap-color: var(--band); }
.callout p { color: var(--band-text); }

/* Partners */
/* Collaborating institutions: one inset card per institution, its symbol on a white tile beside the name.
   The whole card is the link; the name carries the underline on hover. */
.partners { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--space-xs); grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr)); }
@media (min-width: 40em) { .partners { grid-auto-rows: 1fr; } } /* equal cards once they sit side by side */
.partners li { max-width: none; }
.partner { display: flex; align-items: center; gap: var(--space-xs); height: 100%; min-height: 44px; padding: var(--space-2xs) var(--space-xs); background: var(--inset); border: 1px solid var(--inset-line); border-radius: var(--radius-m); color: var(--heading); font-weight: 500; line-height: 1.3; text-decoration: none; }
.partner:hover { border-color: var(--border-strong); }
.partner:hover > span:not(.visually-hidden) { text-decoration: underline; }
.partner::after { margin-left: auto; padding-left: var(--space-3xs); color: var(--muted); }
.partner__mark { flex: none; width: 48px; height: 48px; border-radius: var(--radius-s); }

/* In-page jump nav */
.jump { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: var(--space-2xs); }
.jump a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 var(--space-xs); border: 1px solid var(--border); border-radius: var(--radius-s); background: var(--surface); text-decoration: none; font-size: var(--step-small); }
.jump a:hover { border-color: var(--border-strong); }

/* Research page: one section per project */
.project { margin-bottom: var(--space-window); scroll-margin-top: var(--space-l); } /* the gap between sheets beats the padding inside them */
.project__grid { display: grid; gap: var(--space-l) var(--space-gap); }
@media (min-width: 64em) { .project__grid { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); align-items: start; } }
.project__figs { display: grid; gap: var(--space-s); }
.project__meta { display: grid; gap: var(--space-m) var(--space-gap); }
.project__papers, .project__side { display: grid; gap: var(--space-m); align-content: start; }
@media (min-width: 64em) { .project__meta { grid-column: 1 / -1; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); } .project__side:only-child { grid-column: 1 / -1; } }
.project__meta h3 { font-size: var(--step-small); font-family: var(--font-mono); text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 500; margin-bottom: var(--space-2xs); }
.project__meta ul { padding-left: 1.1em; margin: 0; }
.project__meta li { margin-bottom: var(--space-3xs); }
.project__people { list-style: none; padding: 0 !important; display: flex; flex-wrap: wrap; gap: var(--space-2xs) var(--space-m); }
.project__subtitle { font-size: var(--step-small); color: var(--muted); margin-top: calc(-1 * var(--space-2xs)); }

/* Join page */
.topics { counter-reset: none; list-style: none; padding: 0; margin: 0; display: grid; gap: 0 var(--space-gap); }
@media (min-width: 64em) { .topics { grid-template-columns: 1fr 1fr; } }
.topics li { display: grid; grid-template-columns: 2.5rem 1fr; gap: var(--space-xs); padding-block: var(--space-s); border-top: 1px solid var(--border); max-width: none; }
.topics__n { font-family: var(--font-mono); color: var(--muted); font-size: var(--step-small); padding-top: .15em; }
.topics__link { display: block; font-size: var(--step-small); margin-top: var(--space-3xs); }
.steps { padding-left: 1.25em; }
.steps li { margin-bottom: var(--space-2xs); }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-m); padding: var(--space-l); }
.panel h3 { margin-top: 0; }
/* Reading sheets: opaque surfaces that keep text off the animated background (src/neutrons.js).
   One sheet per content block; the field shows in the gutters and between sheets. */
.sheet { background: var(--paper); border: 1px solid var(--sheet-line); border-radius: var(--radius-m); padding: var(--space-m); }
@media (min-width: 40em) { .sheet { padding: var(--space-l); } }
.sheet > :last-child { margin-bottom: 0; }

/* About page */
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { display: grid; grid-template-columns: 9rem 1fr; gap: var(--space-s); padding-block: var(--space-xs); border-top: 1px solid var(--border); max-width: none; }
@media (max-width: 39.99em) { .timeline li { grid-template-columns: 1fr; gap: 0; } }
.timeline__when { font-family: var(--font-mono); font-size: var(--step-small); color: var(--muted); font-variant-numeric: tabular-nums; }
.timeline b { color: var(--heading); font-weight: 600; }
.course { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-m); overflow: hidden; }
/* Course marks (tools/course_marks.mjs): real figures drawn in tokens, so both themes come free.
   Golden Tech is a fill only, always with a dark rim. */
.course__mark { border-bottom: 1px solid var(--inset-line); padding: var(--space-xs) var(--space-s); }
.cm { display: block; width: 100%; height: auto; overflow: visible; }
.cm-axis { fill: none; stroke: var(--muted); stroke-width: 1.25; }
.cm-area { fill: var(--heat-1); }
.cm-line { fill: none; stroke: var(--heat-6); stroke-width: 2; stroke-linejoin: round; }
.cm-flow { fill: none; stroke: var(--heat-hot); stroke-width: 1.5; stroke-dasharray: 3 3; }
.cm-hot { fill: var(--heat-hot); }
.cm-gold { fill: var(--accent); stroke: var(--heat-6); stroke-width: 1.25; }
.cm-box { fill: var(--heat-0); stroke: var(--heat-5); stroke-width: 1.25; }
.cm-rod { fill: var(--heat-4); }
.cm-tube { fill: var(--inset); stroke: var(--heat-6); stroke-width: 1.25; }
.cm-stream { fill: none; stroke: var(--heat-4); stroke-width: 1.5; }
.cm-body { fill: var(--heat-2); stroke: var(--heat-6); stroke-width: 1.5; }
.course__body { padding: var(--space-s) var(--space-m) var(--space-m); }
.course__code { font-family: var(--font-mono); font-size: var(--step-small); color: var(--muted); display: block; }
.course h3 { font-size: var(--step-h4); margin: var(--space-3xs) 0 0; }
.link-list { list-style: none; padding: 0; margin: 0; }
.link-list li { padding-block: var(--space-2xs); border-top: 1px solid var(--border); max-width: none; }
.link-list a { display: inline-flex; min-height: 32px; align-items: center; }
.contact-actions { display: flex; flex-wrap: wrap; gap: var(--space-xs); margin-bottom: var(--space-m); }
.contact-actions .btn { flex: 1 1 15rem; }

/* External link marker */
.ext::after { content: " \2197"; font-family: var(--font-mono); font-size: 0.85em; }

/* Section spacing helper when a band follows a band */
.section--tight { padding-block: var(--space-xl); }

/* Nav wraps instead of scrolling on narrow screens, so "Join" and "Contact" stay visible (UX spec) */
@media (max-width: 63.99em) {
  .nav { overflow-x: visible; }
  .nav ul { width: auto; flex-wrap: wrap; }
  .nav a { padding-inline: var(--space-2xs); }
}
.nav a[href$="#contact"] { border: 1px solid var(--border-strong); border-radius: var(--radius-s); box-shadow: none; }
.hero__lede em { font-style: normal; background: linear-gradient(transparent 62%, color-mix(in srgb, var(--accent) 55%, transparent) 0); }

/* --- a11y/perf review fixes --- */
main:focus { outline: none; }
.brand { min-height: 44px; }
/* Sticky header is taller when the nav wraps (40em-64em): keep anchor targets clear of it (WCAG 2.4.11) */
@media (min-width: 40em) and (max-width: 63.99em) { html { scroll-padding-top: 7.5rem; } }
/* Dark mode: lighter highlight keeps the hero text >= 4.5:1 */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .hero__lede em { background: linear-gradient(transparent 62%, color-mix(in srgb, var(--accent) 35%, transparent) 0); }
}
:root[data-theme="dark"] .hero__lede em { background: linear-gradient(transparent 62%, color-mix(in srgb, var(--accent) 35%, transparent) 0); }

/* --- design QA fixes --- */
/* 1. Bands keep their own top padding, and so does the section after a band */
.section--band, .section--band + .section { padding-top: var(--space-section); }
/* 2. Hero: matrix bottom-right so the diagonal emerges from under the portrait */
.hero__figure .fm-matrix { top: auto; left: auto; right: 0; bottom: 0; }
.hero__photo { margin: 0 20% 20% 0; }
.hero__role { font-size: var(--step-h4); }
.hero__meta { font-family: var(--font-sans); }
.hero__glance { margin-top: var(--space-s); font-size: var(--step-small); color: var(--muted); }
.hero__glance b { color: var(--heading); font-weight: 600; }
/* 4. Paper lists align with the column; dates fit on one line */
.project__meta .pubs { padding-left: 0; }
@media (min-width: 40em) { .pub { grid-template-columns: 5.5rem minmax(0, 1fr); } } /* phones stack (design-tokens.css) */
/* 5. A leftover last project card spans the row */
@media (min-width: 64em) {
  .cards > .project-card:last-child:nth-child(3n+1) { grid-column: 1 / -1; flex-direction: row; }
  .cards > .project-card:last-child:nth-child(3n+1) .plate { flex: 0 0 calc((100% - 2 * var(--space-gap)) / 3); border-bottom: 0; border-right: 1px solid var(--border); }
  .cards > .project-card:last-child:nth-child(3n+1) .project-card__body { justify-content: center; }
}
@media (min-width: 40em) and (max-width: 63.99em) {
  .cards > .project-card:last-child:nth-child(2n+1) { grid-column: 1 / -1; }
}
/* 6. One white plate for every figure; dim slightly in dark mode */
.plate { --plate: #FFFFFF; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .plate img { filter: brightness(.9) contrast(1.05); } }
:root[data-theme="dark"] .plate img { filter: brightness(.9) contrast(1.05); }
/* 7. A person alone in a section gets a horizontal card */
@media (min-width: 40em) {
  .cards--people:has(> .person:only-child) { grid-template-columns: 1fr; }
  .cards--people > .person:only-child { display: grid; grid-template-columns: 15rem minmax(0, 40rem); column-gap: var(--space-l); align-items: start; }
  .cards--people > .person:only-child > img { grid-row: 1 / span 8; }
  .cards--people > .person:only-child > :not(img) { grid-column: 2; }
}
/* 9. Metadata on the type scale */
:root { --step-xs: 0.8125rem; }
.pub__type, .tag, .person__role, .highlight__when, .pub__links, .team-strip span { font-size: var(--step-xs); }
.pub__title { font-size: var(--step-body); }
.project-card__tagline { font-size: var(--step-small); }
/* 10. Team strip fills its row */
.team-strip { grid-template-columns: repeat(auto-fit, minmax(min(100%, 9rem), 11.5rem)); gap: var(--space-gap); }
/* Footer motif sits on the footer edge */
.site-footer { padding-top: 0; }
.site-footer .fm-strip { margin-bottom: var(--space-2xl); }
/* Single-column callout now that the band has no matrix */
.callout { grid-template-columns: 1fr !important; }

/* Join: position availability, right under the intro */
.join-availability { margin: var(--space-m) 0 0; max-width: 60ch; padding: var(--space-s) var(--space-m); border-left: 3px solid var(--accent); background: var(--surface); border-radius: 0 var(--radius-m) var(--radius-m) 0; }
.join-availability b { color: var(--heading); }

/* Team: group logo beside the intro (stacks under the lede below 64em) */
.page-head__grid { display: grid; gap: var(--space-l) var(--space-gap); align-items: center; }
.group-logo { width: 12.5rem; margin: 0; }
@media (min-width: 40em) { .group-logo { width: 15rem; } }
@media (min-width: 64em) {
  .page-head__grid { grid-template-columns: minmax(0, 1fr) 20rem; }
  .group-logo { width: 20rem; justify-self: end; }
}

/* Hero text sits on a card (like .project-card) so it reads cleanly over the background motif */
.hero__panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-m); padding: var(--space-m); }
@media (min-width: 40em) { .hero__panel { padding: var(--space-xl); } }

/* Group lockup at the top of the hero card: pictorial mark + live-text name.
   Two marks (light ink / reversed); only the visible one is fetched (loading="lazy"). */
.hero__group { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-xs) var(--space-s); margin-bottom: var(--space-m); padding-bottom: var(--space-m); border-bottom: 1px solid var(--border); }
.hero__mark { width: 96px; height: auto; flex: none; }
.hero__mark--dark { display: none; }
.hero__group p { margin: 0; flex: 1 1 12rem; }
.hero__group .eyebrow { display: block; margin: 0 0 var(--space-3xs); }
.hero__group-name { display: block; font-size: var(--step-xs); color: var(--muted); line-height: 1.4; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .hero__mark--light { display: none; }
  :root:not([data-theme="light"]) .hero__mark--dark { display: block; }
}
:root[data-theme="dark"] .hero__mark--light { display: none; }
:root[data-theme="dark"] .hero__mark--dark { display: block; }

/* Background motif: neutron histories in a pin lattice (src/neutrons.js), on the --ground.
   Decorative only. Text never sits on it (every block is a sheet), so it runs at full strength. */
.nfield {
  position: fixed; inset: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none;
  opacity: 0; transition: opacity 1.5s ease-out;
}
.nfield.is-on { opacity: var(--nfield-opacity, 1); }
/* Phones: gutters are 16 px, so motion runs close to the text. Keep it calmer there. */
@media (max-width: 63.99em) { .nfield { --nfield-opacity: .7; } }
@media (max-width: 39.99em) { .nfield { --nfield-opacity: .5; } }
@media (prefers-reduced-motion: reduce) { .nfield { transition: none; } }
/* Pause / play for the background (created by src/neutrons.js). Small and neutral; full opacity keeps the outline at 3:1. */
.nfield-toggle {
  position: fixed; right: var(--space-s); bottom: var(--space-s); z-index: 40;
  display: grid; place-items: center; width: 44px; height: 44px; padding: 0;
  border: 1px solid var(--border-strong); border-radius: 50%;
  background: var(--surface); color: var(--heading); cursor: pointer;
}
.nfield-toggle:hover { border-color: var(--heading); }
.nfield-toggle svg { width: 16px; height: 16px; }
@media print { .nfield, .nfield-toggle { display: none; } }
/* Forced colours: the system palette replaces ours, so the field would only be noise */
@media (forced-colors: active) { .nfield, .nfield-toggle { display: none; } }

/* ---------- Figure and ground: paper on the reactor core ---------- */
body { background: var(--ground); }
/* The header is a solid strip of paper, so no motion shows behind the nav text */
.site-header { background: var(--paper); backdrop-filter: none; }
.hero__panel, .panel { background: var(--paper); border-color: var(--sheet-line); }
.project-card, .course, .join-availability, .person__monogram { background: var(--inset); }
/* Figures and cards inside a sheet get a Mines Light Blue frame, so they no longer melt into the paper */
.sheet .plate, .project-card, .course { border-color: var(--inset-line); }
.project-card .plate { border-color: var(--inset-line); }
.person__monogram .fm-matrix { --fm-gap-color: var(--inset); }
/* Controls that sit on the ground use the gold ring (8.7:1 on --band); Earth Blue is only 2.8:1 there */
.jump { --focus: var(--band-link); gap: var(--space-xs); } /* the gap keeps each ring off the neighbouring chip */
/* The pause button floats over paper and ground alike, so its ring sits inside it */
.nfield-toggle:focus-visible { outline: 3px solid var(--heading); outline-offset: -6px; }
/* The Join band becomes a navy sheet, framed like the other sheets */
.section--band { background: transparent; padding-top: 0; }
.section--band > .container { background: var(--band); border: 1px solid var(--sheet-line); border-radius: var(--radius-m); padding: var(--space-m); }
@media (min-width: 40em) { .section--band > .container { padding: var(--space-l); } }
.section--band + .section { padding-top: 0; }
/* The hero matrix sits on the ground, so it takes the dark ramp (the dark-theme --heat-* values) */
.hero__figure .fm-matrix { --fm-gap-color: var(--ground); }
.hero__figure { --heat-0: var(--heat-dark-0); --heat-1: var(--heat-dark-1); --heat-2: var(--heat-dark-2); --heat-3: var(--heat-dark-3); --heat-4: var(--heat-dark-4); --heat-5: var(--heat-dark-5); --heat-6: var(--heat-dark-6); --heat-hot: var(--heat-dark-hot); }
/* Rhythm: section gaps are windows onto the field, not blank bands */
:root { --space-section: clamp(3rem, 2.4rem + 2.6vw, 4rem); }
/* Measure: Plex sets about 1.34 characters per ch, so 56ch is about 75 characters a line */
:root { --measure: 56ch; }
/* Publications: one reading column, with the field on both sides */
.pubs { max-width: 58ch; }
@media (min-width: 64em) { main:has(nav[aria-label="Publication types"]) .container { width: min(100% - 2 * var(--space-gutter), 46rem); } }
/* Home team strip: two photos per row on phones */
@media (max-width: 39.99em) { .team-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* Dark: the lede highlight at 28 % keeps the text at 7.4:1 */
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .hero__lede em { background: linear-gradient(transparent 62%, color-mix(in srgb, var(--accent) 28%, transparent) 0); } }
:root[data-theme="dark"] .hero__lede em { background: linear-gradient(transparent 62%, color-mix(in srgb, var(--accent) 28%, transparent) 0); }
/* Keyboard focus (red team): a block link gives the team photos a whole ring; the phone nav and
   the skip link draw their rings inward, so the ring never lands on the ground or the brand text */
.team-strip a { display: block; }
@media (max-width: 63.99em) { .nav a:focus-visible { outline-offset: -3px; } }
.skip-link:focus-visible { outline-offset: 0; }
/* Phones: the last lines of a page can scroll clear of the pause button */
@media (max-width: 39.99em) { main { padding-bottom: var(--space-xl); } }

/* ---------- News (Home section and the /news/ archive) ----------
   One template, figure optional. Each item is a container: with a figure and at least 34rem of
   width, the figure sits beside the text; narrower, it goes below. Without one, text takes the width. */
.news { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-l) var(--space-gap); }
.news--grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); }
/* On Home, an item with a figure takes the whole row (figure beside the text); text-only items pair up */
.news--grid > .news-item:has(.news-item__inner--fig), .news--grid > .news-item--wide { grid-column: 1 / -1; }
/* each item is its own inset card (Golden Tech bar on the left), so neighbours never run together */
.news-item { container-type: inline-size; max-width: none; background: var(--inset); border: 1px solid var(--inset-line); border-left: 4px solid var(--accent); border-radius: var(--radius-m); padding: var(--space-s) var(--space-m); }
.news { gap: var(--space-m) var(--space-gap); }
.news-item__inner { display: grid; gap: var(--space-s); align-content: start; }
.news-item__when { font-family: var(--font-mono); font-size: var(--step-xs); color: var(--muted); margin: 0 0 var(--space-3xs); }
.news-item__title { font-size: var(--step-h4); margin: 0 0 var(--space-2xs); }
.news-item__body > p { margin: 0; max-width: var(--measure); }
.news-item__body > p + p { margin-top: var(--space-2xs); }
.news-item__link { font-size: var(--step-small); }
/* ---------- University tags and graduated students (Team page) ----------
   .org is a filled tab in the school's hue (--org-*), with the short name printed on it:
   colour is a key, never the only cue. Contrast for every pair is in design-tokens.css. */
.org { display: inline-flex; align-items: center; gap: 0.3rem; vertical-align: 0.1em; font-family: var(--font-mono); font-size: 0.75rem; font-weight: 600; line-height: 1.5; letter-spacing: 0.02em; padding: 0 0.45rem 0 0.25rem; border-radius: var(--radius-s); color: var(--org-ink); text-decoration: none; cursor: help; white-space: nowrap; }
/* the flag sits inside the tab, 12 px tall in its true proportions; a hairline in the ink colour keeps
   white stripes (Italy, Slovenia, Colorado) from melting into a light tint in dark mode */
.org__flag { height: 0.75rem; width: auto; border-radius: 1px; box-shadow: 0 0 0 1px color-mix(in srgb, var(--org-ink) 50%, transparent); }
.org--mines { background: var(--org-mines); } .org--polito { background: var(--org-polito); } .org--polimi { background: var(--org-polimi); }
.org--unilj { background: var(--org-unilj); } .org--vt { background: var(--org-vt); }
.person__role .org { margin-right: 0.35rem; }
.roster li > .org { margin-left: 0.35rem; }
.alumni { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-m) var(--space-gap); grid-template-columns: repeat(auto-fill, minmax(min(100%, 22rem), 1fr)); }
.alumni__item { padding-top: var(--space-xs); border-top: 1px solid var(--border); display: grid; gap: var(--space-3xs); align-content: start; }
.alumni__item > p { margin: 0; }
.alumni__name { font-size: var(--step-h4); font-weight: 600; color: var(--heading); }
.alumni__name .org { margin-left: 0.35rem; }
.alumni__degree { font-family: var(--font-mono); font-size: 0.8125rem; color: var(--muted); }

/* several papers or posters in one item: title, then who led it */
.news-item__works { list-style: none; margin: var(--space-xs) 0 0; padding: 0; display: grid; gap: var(--space-xs); max-width: var(--measure); }
.news-item__work { display: block; font-weight: 600; color: var(--heading); }
.news-item__by { display: block; font-size: var(--step-xs); color: var(--muted); }
/* the presenter's Team photo beside the title (4:5, rounded rectangle, as on Team) */
.news-item__works li.has-photo { display: grid; grid-template-columns: 2.5rem minmax(0, 1fr); column-gap: var(--space-xs); align-items: start; }
.news-item__face { grid-row: 1 / span 2; width: 2.5rem; height: auto; aspect-ratio: 4 / 5; object-fit: cover; border-radius: var(--radius-s); border: 1px solid var(--inset-line); background: var(--plate); }
.has-photo > .news-item__work, .has-photo > .news-item__by { grid-column: 2; }
.news-item__body > .news-item__works + p { margin-top: var(--space-xs); }
.news-item__fig { margin: 0; }
.news-item__fig .plate { border-color: var(--inset-line); }
/* stacked under the text, a figure stays short; beside the text it may be taller */
.news-item__fig .plate > img { max-height: 12rem; width: auto; max-width: 100%; }
.news-item__fig figcaption { font-size: var(--step-xs); color: var(--muted); margin-top: var(--space-2xs); }
@container (min-width: 34rem) {
  .news-item__inner--fig { grid-template-columns: minmax(0, 1fr) minmax(10rem, 18rem); column-gap: var(--space-gap); }
  .news-item__inner--fig .plate > img { max-height: 16rem; }
}
