/* ==========================================================================
   Site design system: "digital twin" theme
   Loaded after main.css. Plain CSS on purpose: GitHub Pages compiles SCSS with
   the retired Ruby Sass, which cannot handle modern CSS functions.
   Colours: edit the tokens below (light) and under html[data-theme="dark"].
   ========================================================================== */

:root {
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Space Grotesk", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --bg: #f6f8fb;
  --bg-alt: #ffffff;
  --bg-elev: #ffffff;
  --surface: #ffffff;
  --surface-2: #f0f4f9;
  --surface-3: #e5ecf4;
  --text: #0c1629;
  --text-2: #2c3a52;
  --muted: #56667e;
  --border: #dfe6ef;
  --border-strong: #c8d3e1;

  --accent: #0e7c72;
  --accent-strong: #0a5f57;
  --accent-bright: #14b8a6;
  --accent-soft: rgba(20, 184, 166, 0.12);
  --accent-line: rgba(14, 124, 114, 0.35);
  --accent-2: #1d4ed8;
  --accent-2-soft: rgba(37, 99, 235, 0.1);
  --accent-3: #7c3aed;
  --accent-3-soft: rgba(124, 58, 237, 0.1);
  --amber: #92400e;
  --amber-soft: rgba(245, 158, 11, 0.16);
  --green: #166534;
  --green-soft: rgba(34, 197, 94, 0.14);
  --rose: #be123c;
  --grad-from: #0e7c72;
  --grad-to: #2563eb;

  --btn-primary-bg: #0e7c72;
  --btn-primary-hover: #0a5f57;
  --btn-primary-fg: #ffffff;
  --btn-primary-glow: rgba(14, 124, 114, 0.55);

  --header-bg: rgba(246, 248, 251, 0.8);
  --header-border: rgba(12, 22, 41, 0.08);
  --toolbar-bg: rgba(246, 248, 251, 0.86);

  --shadow-sm: 0 1px 2px rgba(12, 22, 41, 0.06), 0 1px 1px rgba(12, 22, 41, 0.04);
  --shadow-md: 0 10px 28px -12px rgba(12, 22, 41, 0.2);
  --shadow-lg: 0 28px 60px -24px rgba(12, 22, 41, 0.3);

  --radius: 16px;
  --header-h: 68px;
  --container: 1180px;
  --side-w: 268px;
  --shell-gap: clamp(32px, 4vw, 56px);

  /* Hero bands are dark in both themes */
  --hero-bg: #070d1a;
  --hero-text: #e6edf7;
  --hero-muted: #9fb0c8;
  --hero-accent: #2dd4bf;
  --hero-line: rgba(148, 163, 184, 0.09);
}

html[data-theme="dark"] {
  --bg: #0a1120;
  --bg-alt: #0c1526;
  --bg-elev: #0f1a2e;
  --surface: #0f1a2e;
  --surface-2: #14213a;
  --surface-3: #1a2a4a;
  --text: #e8eef7;
  --text-2: #c2cedd;
  --muted: #8fa1ba;
  --border: #1d2b47;
  --border-strong: #2b3d60;

  --accent: #2dd4bf;
  --accent-strong: #5eead4;
  --accent-bright: #2dd4bf;
  --accent-soft: rgba(45, 212, 191, 0.12);
  --accent-line: rgba(45, 212, 191, 0.4);
  --accent-2: #60a5fa;
  --accent-2-soft: rgba(96, 165, 250, 0.14);
  --accent-3: #a78bfa;
  --accent-3-soft: rgba(167, 139, 250, 0.14);
  --amber: #fbbf24;
  --amber-soft: rgba(251, 191, 36, 0.14);
  --green: #4ade80;
  --green-soft: rgba(74, 222, 128, 0.14);
  --rose: #fb7185;
  --grad-from: #2dd4bf;
  --grad-to: #60a5fa;

  --btn-primary-bg: #2dd4bf;
  --btn-primary-hover: #5eead4;
  --btn-primary-fg: #042f2a;
  --btn-primary-glow: rgba(45, 212, 191, 0.45);

  --header-bg: rgba(10, 17, 32, 0.74);
  --header-border: rgba(148, 163, 184, 0.12);
  --toolbar-bg: rgba(10, 17, 32, 0.84);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 12px 30px -12px rgba(0, 0, 0, 0.65);
  --shadow-lg: 0 30px 64px -24px rgba(0, 0, 0, 0.75);
}

/* Map the template's own variables onto the new palette so legacy
   components (archives, notices, tables...) follow the theme too. */
:root,
html[data-theme="dark"] {
  --global-base-color: var(--muted);
  --global-bg-color: var(--bg);
  --global-footer-bg-color: var(--bg-alt);
  --global-border-color: var(--border);
  --global-dark-border-color: var(--border-strong);
  --global-code-background-color: var(--surface-2);
  --global-code-text-color: var(--text);
  --global-fig-caption-color: var(--muted);
  --global-link-color: var(--accent);
  --global-link-color-hover: var(--accent-strong);
  --global-link-color-visited: var(--accent);
  --global-masthead-link-color: var(--text);
  --global-masthead-link-color-hover: var(--accent);
  --global-text-color: var(--text);
  --global-text-color-light: var(--muted);
  --global-thead-color: var(--surface-2);
}

/* --------------------------------------------------------------------------
   Base (also neutralises the template's fixed header / absolute footer)
   -------------------------------------------------------------------------- */

html {
  font-size: 16px;
  background: var(--bg);
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
  color-scheme: light;
}

html[data-theme="dark"] { color-scheme: dark; }

body {
  margin: 0 !important;
  padding: 0 !important;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

#main {
  flex: 1 0 auto;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
  animation: none;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--text);
}

a { color: var(--accent); }
a:hover { color: var(--accent-strong); }
a:focus:not(:focus-visible) { outline: none; }

:focus-visible {
  outline: 2px solid var(--accent-bright);
  outline-offset: 3px;
  border-radius: 6px;
}

::selection { background: rgba(20, 184, 166, 0.28); color: inherit; }

img { max-width: 100%; height: auto; }

figure { display: block; }

.container {
  width: min(100% - 32px, var(--container));
  margin-inline: auto;
}

/* Filtering toggles the hidden attribute; keep it stronger than component display rules */
[hidden] { display: none !important; }

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 200;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--text);
  color: var(--bg);
  font-weight: 600;
  text-decoration: none;
  transition: top 0.2s;
}

.skip-link:focus { top: 12px; color: var(--bg); }

/* --------------------------------------------------------------------------
   Shared UI pieces
   -------------------------------------------------------------------------- */

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.7em;
  margin: 0 0 14px;
  font: 500 0.72rem/1.3 var(--font-mono);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}

.eyebrow::before {
  content: "";
  width: 22px;
  height: 1px;
  background: currentColor;
  opacity: 0.7;
}

.button {
  --b-bg: transparent;
  --b-fg: var(--text);
  --b-bd: var(--border-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 46px;
  padding: 0 20px;
  border: 1px solid var(--b-bd);
  border-radius: 12px;
  background: var(--b-bg);
  color: var(--b-fg);
  font: 600 0.95rem/1 var(--font-sans);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.button:hover { color: var(--b-fg); transform: translateY(-1px); }
.button:active { transform: translateY(0); }
.button i { font-size: 0.85em; }

.button--primary {
  --b-bg: var(--btn-primary-bg);
  --b-fg: var(--btn-primary-fg);
  --b-bd: transparent;
  box-shadow: 0 12px 26px -14px var(--btn-primary-glow);
}

.button--primary:hover { --b-bg: var(--btn-primary-hover); }
.button--ghost:hover { --b-bd: var(--accent); --b-fg: var(--accent); }
.button--sm { height: 38px; padding: 0 15px; border-radius: 10px; font-size: 0.86rem; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 0.83rem;
  line-height: 1.3;
}

.chip-list { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--muted);
  font: 600 0.66rem/1.5 var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.badge--manuscripts { background: var(--accent-soft); color: var(--accent); }
.badge--conferences { background: var(--accent-2-soft); color: var(--accent-2); }
.badge--books { background: var(--accent-3-soft); color: var(--accent-3); }
.badge--preprints { background: var(--amber-soft); color: var(--amber); }
.badge--status { background: var(--amber-soft); color: var(--amber); }
.badge--status-accepted { background: var(--green-soft); color: var(--green); }

.status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 10px;
  border-radius: 999px;
  font: 600 0.66rem/1 var(--font-mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
}

.status::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.status--ongoing { color: var(--green); background: var(--green-soft); }
.status--ongoing::before { animation: pulse-dot 2s ease-out infinite; }
.status--done { color: var(--muted); background: var(--surface-2); }

@keyframes pulse-dot {
  0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.55); }
  70% { box-shadow: 0 0 0 7px rgba(34, 197, 94, 0); }
  100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 31px;
  padding: 0 11px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: transparent;
  color: var(--text-2);
  font: 500 0.78rem/1 var(--font-sans);
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, background-color 0.2s;
}

.pill:hover,
.pill[aria-expanded="true"] { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.pill i { font-size: 0.74rem; }

/* Blueprint grid used behind the dark bands */
.blueprint {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(var(--hero-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--hero-line) 1px, transparent 1px);
  background-size: 48px 48px;
  -webkit-mask-image: radial-gradient(ellipse at 70% 30%, #000 20%, transparent 72%);
  mask-image: radial-gradient(ellipse at 70% 30%, #000 20%, transparent 72%);
}

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */

.site-header {
  --nav-fg: var(--text-2);
  --nav-fg-strong: var(--text);
  --nav-fg-muted: var(--muted);
  --nav-hover-bg: var(--surface-2);
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  background: var(--header-bg);
  border-bottom: 1px solid var(--header-border);
  -webkit-backdrop-filter: saturate(1.6) blur(14px);
  backdrop-filter: saturate(1.6) blur(14px);
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

.site-header__inner {
  height: 100%;
  display: flex;
  align-items: center;
  gap: 20px;
}

/* Transparent header over the dark homepage hero */
body.is-home:not(.nav-open) .site-header:not(.is-scrolled) {
  --nav-fg: #c9d5e6;
  --nav-fg-strong: #ffffff;
  --nav-fg-muted: #8ea1bd;
  --nav-hover-bg: rgba(255, 255, 255, 0.08);
  background: transparent;
  border-bottom-color: transparent;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-right: auto;
  color: var(--nav-fg-strong);
  text-decoration: none;
}

.brand:hover { color: var(--nav-fg-strong); }

.brand__mark {
  width: 38px;
  height: 38px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: linear-gradient(135deg, #14b8a6, #2563eb);
  color: #fff;
  font: 700 0.9rem/1 var(--font-display);
  letter-spacing: 0.02em;
  box-shadow: 0 8px 18px -8px rgba(20, 184, 166, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.brand__text { display: flex; flex-direction: column; }
.brand__name { font: 600 1.02rem/1.1 var(--font-display); letter-spacing: -0.01em; }

.brand__tag {
  margin-top: 4px;
  font: 500 0.62rem/1 var(--font-mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--nav-fg-muted);
}

.site-nav__list {
  display: flex;
  align-items: center;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-nav__link {
  position: relative;
  display: block;
  padding: 8px 12px;
  border-radius: 10px;
  color: var(--nav-fg);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.2s, background-color 0.2s;
}

.site-nav__link:hover { color: var(--nav-fg-strong); background: var(--nav-hover-bg); }
.site-nav__link.is-active { color: var(--nav-fg-strong); }

.site-nav__link.is-active::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 1px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--accent-bright), var(--accent-2));
}

.site-header__actions { display: flex; align-items: center; gap: 6px; }

.icon-btn {
  width: 40px;
  height: 40px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 11px;
  background: transparent;
  color: var(--nav-fg-strong);
  font-size: 1rem;
  cursor: pointer;
  transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}

.icon-btn:hover { background: var(--nav-hover-bg); border-color: var(--header-border); }

.theme-toggle .fa-sun { display: none; }
html[data-theme="dark"] .theme-toggle .fa-sun { display: inline-block; }
html[data-theme="dark"] .theme-toggle .fa-moon { display: none; }

.nav-toggle { display: none; }

.nav-toggle__bars,
.nav-toggle__bars::before,
.nav-toggle__bars::after {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transition: transform 0.25s ease, opacity 0.2s ease;
}

.nav-toggle__bars { position: relative; }
.nav-toggle__bars::before,
.nav-toggle__bars::after { content: ""; position: absolute; left: 0; }
.nav-toggle__bars::before { top: -6px; }
.nav-toggle__bars::after { top: 6px; }
.nav-open .nav-toggle__bars { background: transparent; }
.nav-open .nav-toggle__bars::before { transform: translateY(6px) rotate(45deg); }
.nav-open .nav-toggle__bars::after { transform: translateY(-6px) rotate(-45deg); }

.scroll-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  pointer-events: none;
}

.scroll-progress span {
  display: block;
  height: 100%;
  transform: scaleX(0);
  transform-origin: 0 50%;
  background: linear-gradient(90deg, var(--accent-bright), var(--accent-2));
}

@media (max-width: 1080px) {
  .brand__tag { display: none; }
  .site-nav__link { padding: 8px 9px; font-size: 0.86rem; }
}

@media (max-width: 960px) {
  .nav-toggle { display: inline-grid; }

  .site-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    padding: 10px 16px 18px;
    background: var(--bg-elev);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
  }

  .nav-open .site-nav { opacity: 1; visibility: visible; transform: none; }
  .site-nav__list { flex-direction: column; align-items: stretch; gap: 2px; }
  .site-nav__link { padding: 12px 14px; font-size: 1rem; color: var(--text-2); }
  .site-nav__link:hover, .site-nav__link.is-active { color: var(--text); background: var(--surface-2); }
  .site-nav__link.is-active::after { left: 0; right: auto; top: 12px; bottom: 12px; width: 3px; height: auto; }
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

.site-footer {
  margin-top: auto;
  padding: 64px 0 28px;
  background: #070d1a;
  color: #93a5bf;
  border-top: 1px solid rgba(148, 163, 184, 0.12);
  font-size: 0.92rem;
}

.site-footer a { color: #d3deec; text-decoration: none; transition: color 0.2s; }
.site-footer a:hover { color: #5eead4; }

.site-footer__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) repeat(3, minmax(0, 1fr));
  gap: 40px;
}

.site-footer .brand { color: #fff; margin-bottom: 16px; }
.site-footer .brand__tag { display: block; color: #7f93b0; }
.site-footer__about { max-width: 38ch; margin: 0 0 14px; line-height: 1.6; }
.site-footer__loc { display: flex; align-items: center; gap: 8px; margin: 0; color: #7f93b0; }

.site-footer__title {
  margin: 0 0 16px;
  font: 500 0.7rem/1 var(--font-mono);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #6f82a0;
}

.site-footer ul { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.site-footer li i { width: 18px; margin-right: 8px; text-align: center; color: #6f82a0; }

.site-footer__bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px 24px;
  margin-top: 48px;
  padding-top: 22px;
  border-top: 1px solid rgba(148, 163, 184, 0.12);
  color: #6f82a0;
  font-size: 0.8rem;
}

.site-footer__bottom a { color: #93a5bf; }

@media (max-width: 900px) {
  .site-footer__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .site-footer__col--brand { grid-column: 1 / -1; }
}

@media (max-width: 520px) {
  .site-footer__grid { grid-template-columns: minmax(0, 1fr); gap: 32px; }
}

/* --------------------------------------------------------------------------
   Inner page header band + sidebar shell
   -------------------------------------------------------------------------- */

.page-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: clamp(36px, 5vw, 60px) 0 clamp(96px, 9vw, 116px);
  background:
    radial-gradient(900px 420px at 85% -20%, rgba(45, 212, 191, 0.2), transparent 60%),
    radial-gradient(700px 380px at -5% 130%, rgba(96, 165, 250, 0.16), transparent 60%),
    var(--hero-bg);
  color: var(--hero-text);
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}

.page-hero--flush { padding-bottom: clamp(40px, 5vw, 64px); }

.page-hero__crumb {
  display: flex;
  width: max-content;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
  color: var(--hero-muted);
  font: 500 0.78rem/1 var(--font-mono);
  letter-spacing: 0.04em;
  text-decoration: none;
}

.page-hero__crumb:hover { color: #5eead4; }
.page-hero .eyebrow { color: #5eead4; }

.page-hero__title {
  max-width: 30ch;
  margin: 0;
  color: #fff;
  font-size: clamp(1.9rem, 4vw, 3rem);
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.page-hero__title--long { max-width: 44ch; font-size: clamp(1.6rem, 3.2vw, 2.4rem); }

.page-hero__intro {
  max-width: 64ch;
  margin: 16px 0 0;
  color: #b4c2d6;
  font-size: 1.05rem;
  line-height: 1.6;
}

.page-hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
  color: #b4c2d6;
  font-size: 0.92rem;
}

.page-hero__meta i { margin-right: 8px; color: #5eead4; }

.shell {
  width: min(100% - 32px, var(--container));
  margin: 0 auto;
  padding-bottom: clamp(64px, 8vw, 104px);
  display: grid;
  grid-template-columns: var(--side-w) minmax(0, 1fr);
  gap: var(--shell-gap);
  align-items: start;
}

.shell--full { grid-template-columns: minmax(0, 1fr); }

.shell__side {
  position: sticky;
  top: calc(var(--header-h) + 20px);
  z-index: 2;
  margin-top: -72px;
  max-height: calc(100vh - var(--header-h) - 40px);
  overflow-y: auto;
  scrollbar-width: none;
}

.shell__side::-webkit-scrollbar { display: none; }
.shell__main { min-width: 0; padding-top: 40px; }

@media (min-width: 1025px) {
  .page-hero--with-side .page-hero__inner { padding-left: calc(var(--side-w) + var(--shell-gap)); }
}

@media (max-width: 1024px) {
  .shell { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .shell__side { position: relative; top: 0; margin-top: -64px; max-height: none; overflow: visible; }
  .shell__main { padding-top: 32px; }
}

/* Profile card (sidebar) */
.profile-card {
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow-md);
}

.profile-card__photo {
  display: block;
  width: 112px;
  height: 112px;
  margin-bottom: 16px;
  padding: 3px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-bright), var(--accent-2));
}

.profile-card__photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border: 3px solid var(--surface);
  border-radius: 50%;
}

.profile-card__name { margin: 0 0 6px; font-size: 1.22rem; }

.profile-card__creds {
  margin: 0 0 10px;
  color: var(--accent);
  font: 500 0.7rem/1.4 var(--font-mono);
  letter-spacing: 0.08em;
}

.profile-card__bio { margin: 0 0 12px; color: var(--muted); font-size: 0.87rem; line-height: 1.55; }

.profile-card__loc {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--text-2);
  font-size: 0.85rem;
}

.profile-card__loc i { color: var(--accent); }

.profile-card__contact {
  display: grid;
  gap: 2px;
  margin: 16px 0 0;
  padding: 14px 0 0;
  border-top: 1px solid var(--border);
  list-style: none;
}

.profile-card__contact a {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 -8px;
  padding: 6px 8px;
  border-radius: 8px;
  color: var(--text-2);
  font-size: 0.87rem;
  text-decoration: none;
  transition: background-color 0.2s, color 0.2s;
}

.profile-card__contact a:hover { background: var(--surface-2); color: var(--accent); }
.profile-card__contact i { width: 18px; text-align: center; color: var(--muted); transition: color 0.2s; }
.profile-card__contact a:hover i { color: var(--accent); }

.profile-card__icons { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 0; padding: 0; list-style: none; }

.profile-card__icons a {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text-2);
  font-size: 0.95rem;
  text-decoration: none;
  transition: border-color 0.2s, background-color 0.2s, color 0.2s, transform 0.2s;
}

.profile-card__icons a:hover { transform: translateY(-1px); border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }

.profile-card__icons span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.side-extra { margin-top: 20px; }

@media (max-width: 1024px) {
  .profile-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    column-gap: 16px;
    padding: 16px 18px;
  }

  .profile-card__photo { width: 72px; height: 72px; margin: 0; grid-row: 1 / span 3; }
  .profile-card__bio { display: none; }
  .profile-card__name { margin-bottom: 2px; }
  .profile-card__creds { margin-bottom: 4px; }
  .profile-card__contact { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 2px 20px; margin-top: 14px; padding-top: 10px; }
  .profile-card__contact a { margin: 0; padding: 4px 0; }
  .profile-card__contact a:hover { background: none; }
  .profile-card__icons { grid-column: 1 / -1; margin-top: 8px; }
}

/* --------------------------------------------------------------------------
   Long-form content
   -------------------------------------------------------------------------- */

.prose { color: var(--text-2); font-size: 1.02rem; line-height: 1.75; }
.prose > :first-child { margin-top: 0; }
.prose p { margin: 0 0 1.1em; }
.prose p.justify-text { margin-bottom: 1.1em; }
.prose h1 { margin: 1.6em 0 0.6em; font-size: clamp(1.6rem, 2.6vw, 2rem); }
.prose h2 { margin: 2.1em 0 0.7em; font-size: clamp(1.35rem, 2.2vw, 1.7rem); }
.prose h3 { margin: 1.8em 0 0.6em; font-size: 1.2rem; }
.prose h4 { margin: 1.6em 0 0.5em; font-size: 1.05rem; }

.prose a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: var(--accent-line);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
  transition: text-decoration-color 0.2s, color 0.2s;
}

.prose a:hover { color: var(--accent-strong); text-decoration-color: currentColor; }
.prose a.button, .prose a.pill { color: var(--b-fg, var(--text-2)); text-decoration: none; }
.prose a.pill:hover { color: var(--accent); }
.prose strong { color: var(--text); font-weight: 600; }
.prose ul, .prose ol { margin: 0 0 1.2em; padding-left: 1.3em; }
.prose li { margin: 0.4em 0; padding-left: 0.2em; }
.prose li::marker { color: var(--accent-bright); }

.prose blockquote {
  margin: 1.6em 0;
  padding: 16px 20px;
  border-left: 3px solid var(--accent-bright);
  border-radius: 0 12px 12px 0;
  background: var(--accent-soft);
  color: var(--text-2);
  font-style: normal;
}

.prose blockquote p:last-child { margin-bottom: 0; }
.prose img { border-radius: 14px; }
.prose hr { height: 1px; margin: 2.4em 0; border: 0; background: var(--border); }

.prose table {
  display: block;
  width: 100%;
  margin: 1.5em 0;
  overflow-x: auto;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.prose th, .prose td { padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: left; }
.prose th { background: var(--surface-2); color: var(--text); font-weight: 600; }

.prose code {
  padding: 0.15em 0.4em;
  border-radius: 6px;
  background: var(--surface-2);
  font-family: var(--font-mono);
  font-size: 0.86em;
}

.prose pre {
  padding: 16px 18px;
  overflow: auto;
  border-radius: 12px;
  background: #0b1324;
  color: #e6edf7;
  font-size: 0.85rem;
}

.prose pre code { padding: 0; background: none; color: inherit; }

/* Compact generated lists on the CV page */
.prose .cv-list { padding-left: 1.6em; }
.prose .cv-list li { margin: 0 0 0.8em; font-size: 0.95rem; line-height: 1.6; }
.prose .cv-list li::marker { color: var(--muted); font: 500 0.8em var(--font-mono); }
.prose .cv-list a { white-space: nowrap; }
.prose .cv-list a strong { white-space: normal; }

/* Justified text (about.md uses {: .justify-text}) leaves big gaps on narrow screens */
@media (max-width: 640px) {
  .prose p.justify-text { text-align: left; }
}

.note {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin: 0 0 28px;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  color: var(--text-2);
  font-size: 0.93rem;
}

.note i { margin-top: 4px; color: var(--accent); }
.note p { margin: 0; }

/* --------------------------------------------------------------------------
   Homepage
   -------------------------------------------------------------------------- */

.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  margin-top: calc(-1 * var(--header-h));
  padding: calc(var(--header-h) + clamp(36px, 6vw, 80px)) 0 clamp(96px, 11vw, 150px);
  background:
    radial-gradient(1100px 620px at 78% 38%, rgba(45, 212, 191, 0.17), transparent 60%),
    radial-gradient(900px 520px at 5% 0%, rgba(96, 165, 250, 0.15), transparent 60%),
    var(--hero-bg);
  color: var(--hero-text);
}

.hero .blueprint {
  -webkit-mask-image: radial-gradient(ellipse at 65% 45%, #000 25%, transparent 75%);
  mask-image: radial-gradient(ellipse at 65% 45%, #000 25%, transparent 75%);
}

.hero__inner {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: clamp(24px, 4vw, 56px);
  align-items: center;
}

.hero .eyebrow { color: #5eead4; }

.hero__title {
  margin: 0 0 18px;
  color: #fff;
  font-size: clamp(2.7rem, 6.4vw, 4.9rem);
  font-weight: 700;
  line-height: 0.98;
  letter-spacing: -0.045em;
}

.hero__title span {
  background: linear-gradient(100deg, #ffffff 30%, #9deee2 70%, #93c5fd);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero__tagline {
  max-width: 28ch;
  margin: 0 0 20px;
  color: #d3deec;
  font: 500 clamp(1.25rem, 2.3vw, 1.7rem)/1.35 var(--font-display);
  letter-spacing: -0.015em;
}

.rotator { display: inline-grid; vertical-align: bottom; }

.rotator > span {
  grid-area: 1 / 1;
  opacity: 0;
  transform: translateY(0.3em);
  transition: opacity 0.35s ease, transform 0.45s ease;
  white-space: nowrap;
  background: linear-gradient(90deg, #5eead4, #60a5fa);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.rotator > span.is-active { opacity: 1; transform: none; }
.rotator > span.is-leaving { opacity: 0; transform: translateY(-0.15em); transition-duration: 0.2s, 0.3s; }

.hero__role { max-width: 54ch; margin: 0 0 30px; color: var(--hero-muted); font-size: 1.02rem; line-height: 1.6; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 30px; }
.hero .button--primary { --b-bg: #2dd4bf; --b-fg: #042f2a; --btn-primary-glow: rgba(45, 212, 191, 0.5); }
.hero .button--primary:hover { --b-bg: #5eead4; }
.hero .button--ghost { --b-fg: #e6edf7; --b-bd: rgba(148, 163, 184, 0.35); }
.hero .button--ghost:hover { --b-fg: #5eead4; --b-bd: #2dd4bf; --b-bg: rgba(45, 212, 191, 0.08); }

.hero__social { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }

.hero__social a {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 11px;
  color: #c9d5e6;
  font-size: 1.05rem;
  text-decoration: none;
  transition: color 0.2s, border-color 0.2s, background-color 0.2s, transform 0.2s;
}

.hero__social a:hover { color: #5eead4; border-color: #2dd4bf; background: rgba(45, 212, 191, 0.08); transform: translateY(-2px); }

.hero__visual {
  position: relative;
  width: 100%;
  max-width: 580px;
  aspect-ratio: 1 / 1;
  justify-self: end;
}

.hero__visual canvas { display: block; width: 100%; height: 100%; }

.hud {
  position: absolute;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 11px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 8px;
  background: rgba(7, 13, 26, 0.62);
  color: #8ea1bd;
  font: 500 0.64rem/1 var(--font-mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  pointer-events: none;
}

.hud b { color: #5eead4; font-weight: 500; }
.hud--tl { top: 7%; left: 3%; }
.hud--br { right: 2%; bottom: 9%; }
.hud--bl { left: 3%; bottom: 9%; }

.hud__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #2dd4bf;
  box-shadow: 0 0 10px #2dd4bf;
  animation: blink 1.6s ease-in-out infinite;
}

@keyframes blink { 50% { opacity: 0.25; } }

@media (max-width: 900px) {
  .hero__inner { grid-template-columns: minmax(0, 1fr); }
  .hero__visual { justify-self: center; max-width: 440px; margin-top: 8px; }
}

/* Stats band overlapping the hero */
.stats { position: relative; z-index: 3; margin-top: -58px; }

.stats__card {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--border);
  box-shadow: var(--shadow-lg);
}

.stat { padding: 26px 16px 22px; background: var(--surface); text-align: center; }

.stat__num {
  display: block;
  font: 700 clamp(2rem, 3.6vw, 2.8rem)/1 var(--font-display);
  letter-spacing: -0.04em;
  background: linear-gradient(135deg, var(--grad-from), var(--grad-to));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-variant-numeric: tabular-nums;
}

.stat__label {
  display: block;
  margin-top: 10px;
  color: var(--muted);
  font: 500 0.68rem/1.35 var(--font-mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

@media (max-width: 760px) {
  .stats__card { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat:last-child { grid-column: 1 / -1; }
}

/* Sections */
.section { position: relative; padding: clamp(64px, 9vw, 112px) 0; }
.section--alt { background: var(--bg-alt); border-block: 1px solid var(--border); }
.section__head { max-width: 720px; margin-bottom: clamp(32px, 5vw, 52px); }

.section__head--row {
  max-width: none;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px 32px;
}

.section__head--row > div { max-width: 680px; }

.section__title {
  margin: 0 0 14px;
  font-size: clamp(1.9rem, 3.4vw, 2.7rem);
  line-height: 1.1;
  letter-spacing: -0.035em;
}

.section__lead { max-width: 62ch; margin: 0; color: var(--muted); font-size: 1.06rem; line-height: 1.65; }

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--accent);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  white-space: nowrap;
}

.link-arrow i { font-size: 0.8em; transition: transform 0.2s; }
.link-arrow:hover i { transform: translateX(4px); }

/* About */
.about {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(36px, 6vw, 84px);
  align-items: start;
}

.portrait { position: relative; isolation: isolate; max-width: 420px; margin: 0; }

.portrait::before {
  content: "";
  position: absolute;
  inset: 18px -18px -18px 18px;
  z-index: -1;
  border: 1.5px solid var(--accent-line);
  border-radius: 26px;
}

.portrait::after {
  content: "";
  position: absolute;
  right: -30px;
  top: -24px;
  z-index: -1;
  width: 120px;
  height: 120px;
  background-image: radial-gradient(var(--accent-line) 1.5px, transparent 1.5px);
  background-size: 14px 14px;
  opacity: 0.8;
}

.portrait img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: 24px;
  box-shadow: var(--shadow-lg);
}

.credentials { display: grid; gap: 10px; max-width: 420px; margin: 40px 0 0; padding: 0; list-style: none; }

.credentials li {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
}

.credentials__label {
  flex: none;
  min-width: 64px;
  padding: 7px 9px;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent);
  font: 600 0.7rem/1 var(--font-mono);
  letter-spacing: 0.06em;
  text-align: center;
}

.credentials__title { color: var(--text-2); font-size: 0.88rem; line-height: 1.4; }
.about__text .section__title { margin-bottom: 22px; }
.about__interests { margin: 28px 0 30px; }

.about__interests h3 {
  margin: 0 0 12px;
  color: var(--muted);
  font: 500 0.7rem/1 var(--font-mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.about__actions { display: flex; flex-wrap: wrap; gap: 12px; }

@media (max-width: 900px) {
  .about { grid-template-columns: minmax(0, 1fr); }
  .portrait { max-width: 340px; }
}

/* Research themes */
.theme-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }

.theme-card {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  padding: 26px 26px 24px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
  color: inherit;
  text-decoration: none;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.theme-card::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 0%), var(--accent-soft), transparent 45%);
  opacity: 0;
  transition: opacity 0.3s;
}

.theme-card:hover { transform: translateY(-4px); border-color: var(--accent-line); box-shadow: var(--shadow-md); color: inherit; }
.theme-card:hover::after { opacity: 1; }

.theme-card__num {
  position: absolute;
  top: 24px;
  right: 24px;
  color: var(--muted);
  font: 500 0.72rem/1 var(--font-mono);
  opacity: 0.7;
}

.theme-card__icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  margin-bottom: 20px;
  border-radius: 14px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 1.2rem;
  transition: transform 0.3s ease;
}

.theme-card:hover .theme-card__icon { transform: rotate(-6deg) scale(1.06); }
.theme-card h3 { margin: 0 0 8px; font-size: 1.15rem; }
.theme-card p { flex: 1; margin: 0 0 20px; color: var(--muted); font-size: 0.93rem; line-height: 1.6; }

.theme-card__more {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--accent);
  font: 500 0.76rem/1 var(--font-mono);
  letter-spacing: 0.04em;
}

.theme-card__more i { transition: transform 0.2s; }
.theme-card:hover .theme-card__more i { transform: translateX(4px); }

@media (max-width: 960px) { .theme-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .theme-grid { grid-template-columns: minmax(0, 1fr); } }

/* Project cards */
.project-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }

.project-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.project-card:hover { transform: translateY(-4px); border-color: var(--border-strong); box-shadow: var(--shadow-md); }

.project-card__media {
  display: block;
  aspect-ratio: 5 / 3;
  overflow: hidden;
  background: #fff;
  border-bottom: 1px solid var(--border);
}

.project-card__media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.project-card:hover .project-card__media img { transform: scale(1.04); }

/* Stand-in artwork for projects without a logo image */
.project-placeholder {
  position: relative;
  isolation: isolate;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  overflow: hidden;
  background:
    radial-gradient(360px 200px at 80% 10%, rgba(45, 212, 191, 0.3), transparent 60%),
    radial-gradient(320px 200px at 10% 100%, rgba(96, 165, 250, 0.25), transparent 60%),
    #0a1224;
  color: #e6edf7;
}

.project-placeholder::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(148, 163, 184, 0.12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.12) 1px, transparent 1px);
  background-size: 28px 28px;
}

.project-card__media { text-decoration: none; }
.project-placeholder i { color: #5eead4; font-size: 2.2rem; }
.project-placeholder b { font: 700 1.5rem/1 var(--font-display); letter-spacing: -0.02em; }
.project-card:hover .project-placeholder i { transform: scale(1.06); transition: transform 0.4s; }
.project-hero__logo--placeholder { padding: 0; overflow: hidden; }

.commissioned { margin-top: 48px; }
.commissioned__list { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; counter-reset: pi; }

.commissioned__list li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 20px;
  padding: 14px 18px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
}

.commissioned__title { color: var(--text); font-weight: 500; }
.commissioned__period { color: var(--muted); font: 500 0.75rem/1.4 var(--font-mono); white-space: nowrap; }
.project-hero__logo--placeholder .project-placeholder { aspect-ratio: 5 / 3; border-radius: 20px; }
.project-card__body { flex: 1; display: flex; flex-direction: column; padding: 20px 22px 22px; }

.project-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.project-card__period { color: var(--muted); font: 500 0.72rem/1 var(--font-mono); letter-spacing: 0.02em; text-align: right; }
.project-card__title { margin: 0 0 6px; font-size: 1.3rem; }
.project-card__title a { color: var(--text); text-decoration: none; }
.project-card__title a:hover { color: var(--accent); }
.project-card__sub { flex: 1; margin: 0 0 14px; color: var(--text-2); font-size: 0.92rem; line-height: 1.5; }

.project-card__sponsor {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.project-card__sponsor i { margin-top: 3px; color: var(--accent); }

.project-card__links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  padding-top: 14px;
  border-top: 1px dashed var(--border-strong);
  font-size: 0.85rem;
  font-weight: 600;
}

.project-card__links a { display: inline-flex; align-items: center; gap: 7px; text-decoration: none; }
.project-card__links i { font-size: 0.75em; }

.project-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

@media (max-width: 1024px) { .project-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .project-grid { grid-template-columns: minmax(0, 1fr); } }

/* Books */
.books { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }

.book {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 28px;
  align-items: center;
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--surface);
}

.book__cover { display: block; perspective: 900px; }

.book__cover img {
  display: block;
  width: 100%;
  border-radius: 3px 9px 9px 3px;
  box-shadow: inset 4px 0 6px rgba(0, 0, 0, 0.18), 14px 20px 34px -14px rgba(2, 6, 23, 0.55);
  transform: rotateY(-16deg);
  transform-origin: left center;
  transition: transform 0.5s ease;
}

.book:hover .book__cover img { transform: rotateY(-4deg) translateY(-4px); }

.book__publisher {
  margin: 0 0 10px;
  color: var(--accent-3);
  font: 500 0.7rem/1.4 var(--font-mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.book__title { margin: 0 0 10px; font-size: 1.2rem; line-height: 1.3; }
.book__title a { color: var(--text); text-decoration: none; }
.book__title a:hover { color: var(--accent); }
.book__authors { margin: 0 0 18px; color: var(--muted); font-size: 0.88rem; line-height: 1.5; }
.book__authors b { color: var(--text-2); font-weight: 600; }

@media (max-width: 900px) { .books { grid-template-columns: minmax(0, 1fr); } }

@media (max-width: 480px) {
  .book { grid-template-columns: 92px minmax(0, 1fr); gap: 18px; padding: 18px; }
  .book__title { font-size: 1.05rem; }
}

/* Highlights timeline (rendered from the Markdown in about.md) */
.split {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
  gap: clamp(32px, 6vw, 72px);
  align-items: start;
}

.split__aside { position: sticky; top: calc(var(--header-h) + 32px); }
.split__aside .section__head { margin-bottom: 24px; }

@media (max-width: 900px) {
  .split { grid-template-columns: minmax(0, 1fr); }
  .split__aside { position: static; }
}

.timeline { color: var(--text-2); }

.timeline h2,
.timeline h3 {
  display: inline-flex;
  margin: 0 0 18px;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--text);
  color: var(--bg);
  font: 600 0.82rem/1 var(--font-mono);
  letter-spacing: 0.12em;
}

.timeline h2 strong,
.timeline h3 strong { color: inherit; font-weight: inherit; }

.timeline ul {
  margin: 0 0 44px 17px;
  padding: 4px 0 0 30px;
  border-left: 2px solid var(--border);
  list-style: none;
}

.timeline li {
  position: relative;
  margin: 0 0 14px;
  padding: 14px 18px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  font-size: 0.96rem;
  line-height: 1.6;
  transition: border-color 0.2s, transform 0.2s;
}

.timeline li:hover { border-color: var(--accent-line); transform: translateX(3px); }

.timeline li::before {
  content: "";
  position: absolute;
  left: -39px;
  top: 20px;
  width: 12px;
  height: 12px;
  border: 2px solid var(--accent-bright);
  border-radius: 50%;
  background: var(--bg-alt);
  transition: background-color 0.2s;
}

.timeline li:hover::before { background: var(--accent-bright); }
.timeline strong { color: var(--text); font-weight: 600; }
.timeline a { color: var(--accent); text-decoration: underline; text-decoration-color: var(--accent-line); text-underline-offset: 3px; }
.timeline p { margin: 0 0 1em; }

/* Moments gallery */
.moments__track {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: max(16px, (100vw - var(--container)) / 2);
  padding: 4px max(16px, (100vw - var(--container)) / 2) 22px;
  margin: 0;
  list-style: none;
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}

.moment { flex: none; scroll-snap-align: start; }

.moment a {
  position: relative;
  display: block;
  width: clamp(250px, 30vw, 360px);
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 16px;
  background: var(--surface-2);
}

.moment img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s ease; }
.moment a:hover img { transform: scale(1.05); }

.moment a::after {
  content: "\f00e";
  position: absolute;
  right: 12px;
  bottom: 12px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: rgba(7, 13, 26, 0.6);
  color: #fff;
  font: 900 0.85rem/1 "Font Awesome 6 Free";
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.25s, transform 0.25s;
}

.moment a:hover::after,
.moment a:focus-visible::after { opacity: 1; transform: none; }

.moment figcaption {
  position: absolute;
  inset: auto 0 0;
  padding: 28px 14px 12px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
  color: #fff;
  font-size: 0.82rem;
}

.moments__nav { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.moments__nav .link-arrow { margin-right: 10px; }

/* Gallery page: masonry-style columns */
.gallery-grid { columns: 3 240px; column-gap: 14px; }
.gallery-item { break-inside: avoid; margin: 0 0 14px; }

.gallery-item a {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: 14px;
  background: var(--surface-2);
}

.gallery-item img { display: block; width: 100%; height: auto; margin: 0; transition: transform 0.6s ease; }
.gallery-item a:hover img { transform: scale(1.04); }
.gallery-item figcaption { padding: 8px 2px 0; color: var(--muted); font: 0.85rem/1.4 var(--font-sans); }

/* the template gives images inside <figure> a bottom margin and captions a serif font */
.moment img, .portrait img { margin: 0; }
.moment figcaption, .lightbox figcaption { font-family: var(--font-sans); }

.round-btn {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, transform 0.2s;
}

.round-btn:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-1px); }

/* Call to action */
.cta { padding: clamp(56px, 8vw, 96px) 0; }

.cta__panel {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) auto;
  gap: 28px 40px;
  align-items: center;
  padding: clamp(32px, 6vw, 64px);
  border-radius: 28px;
  background:
    radial-gradient(600px 320px at 95% 0%, rgba(45, 212, 191, 0.26), transparent 60%),
    radial-gradient(520px 320px at 0% 110%, rgba(96, 165, 250, 0.22), transparent 60%),
    #0a1224;
  color: var(--hero-text);
}

.cta__panel .eyebrow { color: #5eead4; }
.cta__title { margin: 0 0 12px; color: #fff; font-size: clamp(1.8rem, 3.4vw, 2.6rem); letter-spacing: -0.035em; }
.cta__text { max-width: 54ch; margin: 0; color: #b4c2d6; font-size: 1.04rem; }
.cta__actions { display: flex; flex-wrap: wrap; gap: 12px; }
.cta .button--primary { --b-bg: #2dd4bf; --b-fg: #042f2a; }
.cta .button--primary:hover { --b-bg: #5eead4; }
.cta .button--ghost { --b-fg: #e6edf7; --b-bd: rgba(148, 163, 184, 0.35); }
.cta .button--ghost:hover { --b-fg: #5eead4; --b-bd: #2dd4bf; }

@media (max-width: 800px) { .cta__panel { grid-template-columns: minmax(0, 1fr); } }

/* --------------------------------------------------------------------------
   Publications
   -------------------------------------------------------------------------- */

.pub-overview {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  margin-bottom: 26px;
  padding: 22px 24px 18px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
}

.pub-overview__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 20px;
}

.pub-overview__title { margin: 0; font-size: 1.05rem; }
.pub-overview__title span { color: var(--muted); font: 500 0.75rem var(--font-mono); letter-spacing: 0.06em; margin-left: 8px; }
.pub-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 0; padding: 0; list-style: none; color: var(--muted); font-size: 0.8rem; }
.pub-legend li { display: inline-flex; align-items: center; gap: 7px; }
.pub-legend i { width: 10px; height: 10px; border-radius: 3px; }

.pub-chart { display: flex; align-items: stretch; gap: 6px; height: 150px; }

.pub-chart__col {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  text-decoration: none;
}

.pub-chart__n { color: var(--text-2); font: 600 0.72rem/1 var(--font-mono); }
.pub-chart__track { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; }

.pub-chart__bar {
  width: 100%;
  max-width: 34px;
  height: var(--h);
  display: flex;
  flex-direction: column-reverse;
  overflow: hidden;
  border-radius: 6px 6px 3px 3px;
  transition: filter 0.2s, transform 0.2s;
}

a.pub-chart__col:hover .pub-chart__bar { filter: brightness(1.12); transform: translateY(-2px); }
a.pub-chart__col:hover { color: var(--accent); }
.pub-chart__y { font: 500 0.66rem/1 var(--font-mono); }
.seg--manuscripts { background: var(--accent-bright); }
.seg--conferences { background: var(--accent-2); }
.seg--books { background: var(--accent-3); }
.seg--preprints { background: var(--amber); }

@media (max-width: 560px) {
  .pub-chart { gap: 3px; height: 130px; }
  .pub-chart__y { font-size: 0.56rem; transform: rotate(-45deg); margin-top: 4px; }
  .pub-chart__n { font-size: 0.62rem; }
}

.pub-toolbar {
  position: sticky;
  top: calc(var(--header-h) + 10px);
  z-index: 10;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 0 -10px 12px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--toolbar-bg);
  box-shadow: var(--shadow-sm);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.pub-search { position: relative; flex: 1 1 240px; margin: 0; }

.pub-search i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 0.85rem;
  pointer-events: none;
}

.pub-search input {
  box-sizing: border-box;
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 42px;
  margin: 0;
  padding: 0 14px 0 38px;
  border: 1px solid var(--border-strong);
  border-radius: 11px;
  background: var(--surface);
  color: var(--text);
  box-shadow: none;
  font: 400 0.92rem/1 var(--font-sans);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.pub-search input::placeholder { color: var(--muted); opacity: 0.85; }
.pub-search input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.pub-filters { display: flex; flex-wrap: wrap; gap: 6px; }

.chip-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  margin: 0;
  padding: 0 13px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-2);
  font: 500 0.84rem/1 var(--font-sans);
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}

.chip-btn:hover { border-color: var(--accent); color: var(--accent); }

.chip-btn span {
  padding: 3px 7px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font: 600 0.68rem/1 var(--font-mono);
}

.chip-btn.is-active { border-color: var(--text); background: var(--text); color: var(--bg); }
.chip-btn.is-active span { background: rgba(127, 127, 127, 0.25); color: inherit; }
.pub-count { margin: 0 0 26px; color: var(--muted); font: 500 0.76rem/1 var(--font-mono); letter-spacing: 0.04em; }
.pub-count b { color: var(--text); }

.pub-year {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  gap: 20px;
  margin-bottom: 34px;
  scroll-margin-top: calc(var(--header-h) + 80px);
}

.pub-year__label {
  position: sticky;
  top: calc(var(--header-h) + 88px);
  align-self: start;
  margin: 6px 0 0;
  font-size: 1.55rem;
  letter-spacing: -0.03em;
}

.pub-year__label small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font: 500 0.66rem/1 var(--font-mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.pub-list { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }

.pub {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  margin: 0;
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.pub:hover { border-color: var(--border-strong); box-shadow: var(--shadow-md); }
.pub--cover { grid-template-columns: 74px minmax(0, 1fr); }
.pub__cover img { display: block; width: 74px; border-radius: 3px 6px 6px 3px; box-shadow: 0 10px 20px -10px rgba(2, 6, 23, 0.5); }
.pub__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin-bottom: 9px; }
.pub__venue { color: var(--muted); font-size: 0.82rem; font-style: italic; }
.pub__title { margin: 0 0 6px; font: 600 1.03rem/1.45 var(--font-sans); letter-spacing: -0.005em; }

.pub__title a {
  color: var(--text);
  text-decoration: none;
  background-image: linear-gradient(var(--accent), var(--accent));
  background-position: 0 100%;
  background-repeat: no-repeat;
  background-size: 0 1.5px;
  transition: background-size 0.3s ease, color 0.2s;
}

.pub__title a:hover { color: var(--accent); background-size: 100% 1.5px; }
.pub__authors { margin: 0 0 12px; color: var(--muted); font-size: 0.87rem; line-height: 1.5; }
.pub__authors b { color: var(--text); font-weight: 600; }
.pub__actions { display: flex; flex-wrap: wrap; gap: 7px; }
.pub__bib { position: relative; margin-top: 12px; }

/* BibTeX viewer: follows the light/dark theme. The inner <code> must not pick up
   the template's code colours (dark text on a dark box made it unreadable). */
.pub__bib pre {
  max-height: 280px;
  margin: 0;
  padding: 14px 96px 14px 16px;
  overflow: auto;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--text);
  font: 0.78rem/1.6 var(--font-mono);
  white-space: pre;
}

.pub__bib pre code {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
}

.pub__bib .pill { position: absolute; top: 8px; right: 8px; background: var(--surface); }

.pill--oa { color: var(--green); border-color: var(--green-soft); }
.pill--oa:hover { color: var(--green); border-color: var(--green); background: var(--green-soft); }

.pub__note {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: -4px 0 12px;
  color: var(--text-2);
  font-size: 0.85rem;
}

.pub__note i { color: var(--accent-3); font-size: 0.8rem; }

.pub__chapters { margin-top: 12px; font-size: 0.86rem; }

.pub__chapters summary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--accent);
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

.pub__chapters summary::-webkit-details-marker { display: none; }
.pub__chapters summary::after { content: "\f078"; font: 900 0.65rem/1 "Font Awesome 6 Free"; transition: transform 0.2s; }
.pub__chapters[open] summary::after { transform: rotate(180deg); }
.pub__chapters ol { margin: 10px 0 0; padding-left: 1.4em; color: var(--text-2); }
.pub__chapters li { margin: 4px 0; }
.pub__chapters li::marker { color: var(--muted); }
.pub__chapters a { color: var(--text-2); text-decoration: none; }
.pub__chapters a:hover { color: var(--accent); text-decoration: underline; }
.pub__chapters span { color: var(--muted); font-size: 0.8rem; white-space: nowrap; }

.chapter-list { margin: 0 0 30px; }
.chapter-list h2 { margin: 0 0 12px; font-size: 1.15rem; }
.chapter-list ol { margin: 0; padding-left: 1.4em; }
.chapter-list li { margin: 0 0 10px; color: var(--text-2); }
.chapter-list li::marker { color: var(--accent); font-weight: 600; }
.chapter-list a { color: var(--text); font-weight: 500; text-decoration: none; }
.chapter-list a:hover { color: var(--accent); }
.chapter-list span { display: block; color: var(--muted); font: 0.74rem/1.5 var(--font-mono); }
.pub-empty { padding: 48px 0; color: var(--muted); text-align: center; }
.pub-empty i { display: block; margin-bottom: 12px; font-size: 1.6rem; opacity: 0.6; }

@media (max-width: 640px) {
  .pub-toolbar { position: static; margin-inline: 0; }
  .pub-year { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .pub-year__label { position: static; display: flex; align-items: baseline; gap: 10px; }
  .pub { padding: 16px; }
  .pub--cover { grid-template-columns: 56px minmax(0, 1fr); gap: 14px; }
  .pub__cover img { width: 56px; }
}

.cite-box {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 22px;
  margin-bottom: 30px;
  padding: 22px 24px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
}

.cite-box--cover { grid-template-columns: 120px minmax(0, 1fr); }
.cite-box__cover img { display: block; width: 120px; border-radius: 3px 8px 8px 3px; box-shadow: 0 14px 28px -14px rgba(2, 6, 23, 0.55); }
.cite-box .eyebrow { margin-bottom: 10px; }
.cite-box__text { margin: 0 0 16px; color: var(--text-2); font-size: 0.95rem; line-height: 1.65; }
.cite-box__text b { color: var(--text); }

@media (max-width: 560px) { .cite-box--cover { grid-template-columns: minmax(0, 1fr); } }

/* --------------------------------------------------------------------------
   Research project pages
   -------------------------------------------------------------------------- */

.project-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: clamp(28px, 5vw, 56px);
  align-items: center;
}

.project-hero__logo {
  padding: 10px;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.7);
  transform: rotate(1.5deg);
}

.project-hero__logo img { display: block; width: 100%; border-radius: 12px; }

.facts {
  display: flex;
  flex-wrap: wrap;
  gap: 18px 36px;
  margin: 26px 0 28px;
}

.facts div { min-width: 0; }

.facts dt {
  margin: 0 0 7px;
  color: #7f93b0;
  font: 500 0.66rem/1 var(--font-mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.facts dd { max-width: 36ch; margin: 0; color: #e6edf7; font-size: 0.95rem; line-height: 1.45; }
.page-hero .button--primary { --b-bg: #2dd4bf; --b-fg: #042f2a; }
.page-hero .button--primary:hover { --b-bg: #5eead4; }
.project-body { max-width: 860px; margin: 0 auto; padding: clamp(40px, 6vw, 64px) 16px clamp(64px, 8vw, 96px); }

.project-photo img {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: 560px;
  margin: 0 auto 36px;
  border-radius: 18px;
  box-shadow: var(--shadow-lg);
}

.project-pager {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 56px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}

.project-pager a {
  display: block;
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.2s, transform 0.2s;
}

.project-pager a:hover { border-color: var(--accent); transform: translateY(-2px); color: var(--text); }
.project-pager small { display: block; margin-bottom: 6px; color: var(--muted); font: 500 0.7rem/1 var(--font-mono); letter-spacing: 0.1em; text-transform: uppercase; }
.project-pager strong { font: 600 1.05rem/1.3 var(--font-display); }
.project-pager__next { grid-column: 2; text-align: right; }

@media (max-width: 800px) {
  .project-hero { grid-template-columns: minmax(0, 1fr); }
  .project-hero__logo { max-width: 360px; transform: none; }
}

/* --------------------------------------------------------------------------
   Talks timeline
   -------------------------------------------------------------------------- */

.page-banner { margin: 0 0 32px; }

.page-banner img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 7;
  object-fit: cover;
  border-radius: 20px;
  box-shadow: var(--shadow-md);
}

.summary-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 34px; padding: 0; list-style: none; }
.summary-row .chip b { color: var(--text); font-weight: 600; }
.tl-year { margin-bottom: 18px; }

.tl-year__label {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 0 18px;
  font-size: 1.45rem;
  letter-spacing: -0.03em;
}

.tl-year__label::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.tl { position: relative; margin: 0 0 28px; padding: 0; list-style: none; }

.tl::before {
  content: "";
  position: absolute;
  left: 19px;
  top: 12px;
  bottom: 12px;
  width: 2px;
  background: var(--border);
}

.tl__item { position: relative; margin-bottom: 14px; padding-left: 60px; }

.tl__icon {
  position: absolute;
  left: 0;
  top: 14px;
  z-index: 1;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--accent);
  box-shadow: var(--shadow-sm);
  font-size: 0.95rem;
}

.tl__item[data-kind="press"] .tl__icon,
.tl__item[data-kind="tv"] .tl__icon { color: var(--accent-2); }
.tl__item[data-kind="award"] .tl__icon { color: var(--amber); }
.tl__item[data-kind="lecture"] .tl__icon { color: var(--accent-3); }
.tl__item[data-kind="video"] .tl__icon { color: var(--rose); }

.video-embed {
  position: relative;
  aspect-ratio: 16 / 9;
  margin: 1.5em 0;
  overflow: hidden;
  border-radius: 14px;
  background: #000;
  box-shadow: var(--shadow-md);
}

.video-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.tl__card {
  padding: 16px 20px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

.tl__card:hover { transform: translateX(3px); border-color: var(--border-strong); box-shadow: var(--shadow-md); }

.tl__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  margin-bottom: 8px;
  color: var(--muted);
  font: 500 0.74rem/1.3 var(--font-mono);
  letter-spacing: 0.03em;
}

.tl__title { margin: 0 0 4px; font: 600 1.04rem/1.4 var(--font-sans); letter-spacing: -0.005em; }
.tl__title a { color: var(--text); text-decoration: none; }
.tl__title a:hover { color: var(--accent); }
.tl__venue { margin: 0; color: var(--text-2); font-size: 0.88rem; }
.tl__desc { margin: 8px 0 0; color: var(--muted); font-size: 0.88rem; line-height: 1.55; }
.tl__source { display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; font-size: 0.82rem; font-weight: 600; text-decoration: none; }
.tl__source i { font-size: 0.72em; }

/* --------------------------------------------------------------------------
   Teaching
   -------------------------------------------------------------------------- */

.inst { margin-bottom: 44px; scroll-margin-top: calc(var(--header-h) + 20px); }

.inst__head {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.inst__icon {
  flex: none;
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent-bright), var(--accent-2));
  color: #fff;
  font-size: 1.25rem;
  box-shadow: 0 10px 22px -12px var(--btn-primary-glow);
}

.inst__name { margin: 0; font-size: 1.3rem; }
.inst__meta { margin: 5px 0 0; color: var(--muted); font: 500 0.74rem/1.3 var(--font-mono); letter-spacing: 0.04em; }
.module-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }

.module {
  display: flex;
  flex-direction: column;
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

.module:hover { transform: translateY(-2px); border-color: var(--border-strong); box-shadow: var(--shadow-md); }
.module__title { margin: 12px 0 6px; font: 600 1rem/1.4 var(--font-sans); letter-spacing: -0.005em; }
.module__title a { color: var(--text); text-decoration: none; }
.module__title a:hover { color: var(--accent); }
.module__desc { flex: 1; margin: 0 0 14px; color: var(--muted); font-size: 0.88rem; line-height: 1.55; }

.module__role {
  display: flex;
  gap: 9px;
  margin: 0;
  padding-top: 12px;
  border-top: 1px dashed var(--border-strong);
  color: var(--text-2);
  font-size: 0.82rem;
  line-height: 1.45;
}

.module__role i { margin-top: 3px; color: var(--accent); }

@media (max-width: 720px) { .module-grid { grid-template-columns: minmax(0, 1fr); } }

.inst__meta a { color: var(--accent); text-decoration: none; white-space: nowrap; }
.inst__meta a:hover { text-decoration: underline; }
.inst__meta a i { font-size: 0.8em; }
.chip a { display: inline-flex; align-items: center; gap: 6px; color: inherit; text-decoration: none; }
.chip a:hover { color: var(--accent); }

.supervision__summary { max-width: 70ch; margin: 0 0 18px; color: var(--text-2); font-size: 0.97rem; line-height: 1.65; }

.supervision__list {
  flex: 1;
  margin: 0 0 14px;
  padding-left: 1.1em;
  color: var(--text-2);
  font-size: 0.87rem;
  line-height: 1.5;
}

.supervision__list li { margin: 0 0 6px; }
.supervision__list li::marker { color: var(--accent-bright); }
.module__role a { color: var(--accent); font-weight: 600; text-decoration: none; }
.module__role a:hover { text-decoration: underline; }

.prospective {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 20px 32px;
  align-items: end;
  margin-top: 22px;
  padding: 24px 26px;
  border: 1px solid var(--accent-line);
  border-radius: 18px;
  background: linear-gradient(135deg, var(--accent-soft), var(--accent-2-soft));
}

.prospective h3 { margin: 0 0 8px; font-size: 1.2rem; }
.prospective p { margin: 0 0 10px; color: var(--text-2); font-size: 0.93rem; }
.prospective ul { margin: 0; padding-left: 1.1em; color: var(--text-2); font-size: 0.9rem; }
.prospective li { margin: 0 0 4px; }
.prospective li::marker { color: var(--accent); }

@media (max-width: 760px) { .prospective { grid-template-columns: minmax(0, 1fr); } }

/* --------------------------------------------------------------------------
   Template components kept from AcademicPages
   -------------------------------------------------------------------------- */

.page__share {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 40px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
}

.page__share-title {
  width: 100%;
  margin: 0 0 6px;
  color: var(--muted);
  font: 500 0.7rem/1 var(--font-mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

/* the template's .btn forces colour and border with !important */
.page__share .btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 8px 12px;
  border: 1px solid var(--border) !important;
  border-radius: 9px;
  background: var(--surface);
  color: var(--text-2) !important;
  font: 500 0.8rem/1 var(--font-sans);
  text-decoration: none;
  transition: border-color 0.2s, color 0.2s, background-color 0.2s;
}

.page__share .btn:hover { border-color: var(--accent) !important; color: var(--accent) !important; background: var(--accent-soft); }

.page__meta,
.page__taxonomy { color: var(--muted); font-size: 0.85rem; }

.archive__item-title { font-size: 1.1rem; }
.archive__item-title a { color: var(--text); text-decoration: none; }
.archive__item-title a:hover { color: var(--accent); }
.list__item .archive__item { padding: 18px 0; border-bottom: 1px solid var(--border); }

/* --------------------------------------------------------------------------
   Floating helpers
   -------------------------------------------------------------------------- */

.to-top {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 40;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-md);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 0.25s, transform 0.25s, visibility 0.25s, border-color 0.2s, color 0.2s;
}

.to-top.is-visible { opacity: 1; visibility: visible; transform: none; }
.to-top:hover { border-color: var(--accent); color: var(--accent); }

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 70;
  padding: 11px 16px;
  border-radius: 11px;
  background: var(--text);
  color: var(--bg);
  box-shadow: var(--shadow-lg);
  font-size: 0.88rem;
  font-weight: 500;
  opacity: 0;
  transform: translate(-50%, 16px);
  transition: opacity 0.25s, transform 0.25s;
  pointer-events: none;
}

.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
.toast i { margin-right: 8px; color: var(--accent-bright); }

.lightbox {
  max-width: min(94vw, 1400px);
  max-height: 94vh;
  padding: 0;
  overflow: visible;
  border: 0;
  background: transparent;
}

.lightbox::backdrop { background: rgba(3, 7, 18, 0.88); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.lightbox figure { margin: 0; }
.lightbox img { display: block; max-width: 94vw; max-height: 84vh; margin: 0 auto; border-radius: 12px; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6); }
.lightbox figcaption { margin-top: 12px; color: #cbd5e1; font-size: 0.9rem; text-align: center; }

.lightbox__btn {
  position: fixed;
  z-index: 2;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.7);
  color: #fff;
  cursor: pointer;
}

.lightbox__btn:hover { background: rgba(45, 212, 191, 0.25); border-color: #2dd4bf; }
.lightbox__btn--close { top: 18px; right: 18px; }
.lightbox__btn--prev { left: 18px; top: 50%; transform: translateY(-50%); }
.lightbox__btn--next { right: 18px; top: 50%; transform: translateY(-50%); }

/* Scroll reveal (only armed once site.js has loaded) */
.reveal-ready .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s cubic-bezier(0.2, 0.7, 0.2, 1), transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
  transition-delay: calc(var(--d, 0) * 70ms);
}

.reveal-ready .reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    transition-delay: 0s !important;
  }

  .reveal-ready .reveal { opacity: 1; transform: none; }
}

@media print {
  .site-header, .site-footer, .to-top, .shell__side, .hero__visual, .pub-toolbar, .moments, .cta { display: none !important; }
  .hero, .page-hero { margin: 0; padding: 24px 0; background: none !important; color: #000 !important; }
  .hero__title, .page-hero__title, .hero__title span { color: #000 !important; background: none !important; }
  .shell { display: block; }
}
