/* =============================================================================
   A²DSL — visual system
   -----------------------------------------------------------------------------
   Dark, high-contrast and technical. The palette is built on one idea: a
   silicon-blue base lit by an indigo-to-cyan "signal" gradient, with magenta
   reserved for anything that needs to interrupt you.

   Type:  Space Grotesk (display)  ·  Inter (text & UI)  ·  JetBrains Mono (data)
   ========================================================================== */

:root {
  /* --- surfaces, darkest to lightest --------------------------------------- */
  --void:      #05070f;
  --base:      #090c17;
  --raise:     #10141f;
  --raise-2:   #161b29;
  --line:      #232a3d;
  --line-soft: #1b2130;

  /* --- light surfaces (public pages) --------------------------------------- */
  --paper:     #ffffff;
  --paper-2:   #f7f8fc;
  --paper-3:   #eef1f8;
  --rule:      #e0e5f0;

  /* --- text ---------------------------------------------------------------- */
  --ink:       #0a0d16;
  --ink-2:     #333d55;
  --ink-3:     #64708c;
  --on-dark:   #eef1fa;
  --on-dark-2: #a9b4cf;
  --on-dark-3: #6f7c9c;

  /* --- signal colours ------------------------------------------------------ */
  /* The three theme colours, as "r,g,b" so they can be used at any opacity:
   * rgba(var(--accent-rgb), .3). src/theme.js replaces them with the
   * administrator's choice (Settings → Look and colours). */
  --accent-rgb:  99,102,241;
  --accent2-rgb: 168,85,247;
  --accent3-rgb: 34,211,238;
  --indigo:    rgb(var(--accent-rgb));
  --indigo-lo: #4f46e5;               /* the main colour, dark enough for text on white */
  --violet:    rgb(var(--accent2-rgb));
  --cyan:      rgb(var(--accent3-rgb));
  --teal:      #2dd4bf;
  --magenta:   #f43f7e;
  --amber:     #f59e0b;
  --green:     #10b981;

  --grad:      linear-gradient(115deg, var(--indigo) 0%, var(--violet) 48%, var(--cyan) 100%);
  --grad-warm: linear-gradient(115deg, var(--magenta) 0%, var(--violet) 100%);
  --grad-soft: linear-gradient(115deg, rgba(var(--accent-rgb),.14), rgba(var(--accent3-rgb),.14));
  --grad-ink:  var(--grad);
  --grad-btn:  var(--grad);           /* the gradient, deep enough for white button text */           /* the gradient, deepened for text on white (src/theme.js) */

  /* --- effects ------------------------------------------------------------- */
  --glow:      0 0 0 1px rgba(var(--accent-rgb),.35), 0 8px 30px -6px rgba(var(--accent-rgb),.45);
  --glow-cyan: 0 0 0 1px rgba(var(--accent3-rgb),.35), 0 8px 30px -6px rgba(var(--accent3-rgb),.4);
  --sh-1:      0 1px 2px rgba(6,10,24,.06), 0 2px 10px rgba(6,10,24,.05);
  --sh-2:      0 4px 12px rgba(6,10,24,.08), 0 18px 40px -12px rgba(6,10,24,.16);
  --sh-3:      0 20px 60px -16px rgba(6,10,24,.3);

  /* --- type ---------------------------------------------------------------- */
  --display: 'Space Grotesk', 'Segoe UI', system-ui, sans-serif;
  --text:    'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono:    'JetBrains Mono', ui-monospace, 'SFMono-Regular', Consolas, monospace;

  /* Content width: fills large screens without letting lines grow too long.
   * In rem, so it also grows with the gentle zoom on wide screens (end of file). */
  --wrap: min(88rem, calc(100vw - 2rem));
  --r-sm: 8px;
  --r:    12px;
  --r-lg: 18px;
  --r-xl: 26px;
  --ease: cubic-bezier(.2,.8,.2,1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

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

body {
  margin: 0;
  font-family: var(--text);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: 'cv02','cv03','cv04','ss01';
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--indigo-lo); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--violet); }

:focus-visible {
  outline: 2px solid var(--violet);
  outline-offset: 3px;
  border-radius: 4px;
}

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 1.5rem; }
.narrow { max-width: 52rem; }

/* ------------------------------- icons ------------------------------------ */
.ic {
  width: 1.1em; height: 1.1em; flex: none;
  display: inline-block; vertical-align: -.18em;
}
.ic-lg { width: 1.4em; height: 1.4em; }

/* ------------------------------ signal rule ------------------------------- */
.layerstack {
  height: 3px; width: 100%;
  background: var(--grad);
  background-size: 200% 100%;
  animation: slide 14s linear infinite;
}
@keyframes slide { to { background-position: 200% 0; } }

/* --------------------------------- header --------------------------------- */
.masthead {
  position: sticky; top: 0; z-index: 60;
  background: rgba(255,255,255,.82);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--rule);
}
.masthead-inner {
  display: flex; align-items: center; gap: 1rem;
  padding: .7rem 1.5rem; max-width: calc(var(--wrap) + 6rem); margin: 0 auto;
}

.brand { display: flex; align-items: center; gap: .85rem; text-decoration: none; color: inherit; min-width: 0; flex: none; }
/* The uploaded logo. Its height follows Settings → Look and colours → Logo size. */
.brand-logo { height: var(--logo-h); width: auto; max-width: calc(var(--logo-h) * 3); object-fit: contain; flex: none; }
:root { --logo-h: 3.6rem; }
:root[data-logo="small"]  { --logo-h: 2.8rem; }
:root[data-logo="large"]  { --logo-h: 4.6rem; }
.brand-mark {
  width: 42px; height: 42px; flex: none; display: grid; place-items: center;
  background: var(--void); color: #fff; border-radius: 11px;
  font-family: var(--display); font-weight: 700; font-size: 1rem; letter-spacing: calc(-.04em * var(--tight, 1));
  position: relative; overflow: hidden;
}
.brand-mark::before {
  content: ''; position: absolute; inset: 0; background: var(--grad); opacity: .9;
}
.brand-mark span { position: relative; z-index: 1; }
.brand-mark sup { font-size: .6em; }
.brand-text { min-width: 0; }
.brand-text strong {
  display: block; font-family: var(--display); font-size: 1.2rem;
  font-weight: 700; letter-spacing: calc(-.02em * var(--tight, 1)); line-height: 1.15;
}
.brand-text em {
  display: block; font-family: var(--mono); font-size: .62rem; font-style: normal;
  letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); margin-top: .18rem;
  max-width: 40ch; line-height: 1.45;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;
}

.nav { display: flex; align-items: center; gap: .1rem; margin-left: auto; flex-wrap: nowrap; }

/* The department line under the logo is long; on narrower screens the menu
 * needs that room more. */
@media (max-width: 1500px) { .masthead .brand-text em { display: none; } }
.nav a {
  position: relative;
  font-size: .86rem; font-weight: 500; color: var(--ink-2); text-decoration: none;
  padding: .5rem .55rem; border-radius: var(--r-sm); white-space: nowrap;
  transition: color .18s var(--ease), background .18s var(--ease);
}
.nav a::after {
  content: ''; position: absolute; left: .55rem; right: .55rem; bottom: .28rem; height: 2px;
  background: var(--grad); border-radius: 2px;
  transform: scaleX(0); transform-origin: left; transition: transform .22s var(--ease);
}
.nav a:hover { color: var(--ink); background: var(--paper-3); }
.nav a:hover::after, .nav a.on::after { transform: scaleX(1); }
.nav a.on { color: var(--ink); font-weight: 600; }

.nav .cta {
  display: inline-flex; align-items: center; gap: .4rem;
  margin-left: .5rem; padding: .55rem 1rem;
  background: var(--void); color: #fff; font-weight: 600; border-radius: 999px;
}
.nav .cta::after { display: none; }
.nav .cta:hover { color: #fff; background: var(--indigo-lo); box-shadow: var(--glow); }
.nav .cta .pip {
  display: inline-grid; place-items: center; min-width: 18px; height: 18px;
  padding: 0 5px; border-radius: 999px; background: var(--magenta);
  font-family: var(--mono); font-size: .65rem; color: #fff;
}

.navtoggle {
  display: none; margin-left: auto; align-items: center; gap: .45rem;
  background: var(--paper); border: 1px solid var(--rule); border-radius: var(--r-sm);
  padding: .5rem .8rem; font: inherit; font-size: .85rem; font-weight: 500; cursor: pointer;
}
.navtoggle:hover { border-color: var(--indigo); color: var(--indigo-lo); }

@media (max-width: 1180px) {
  .navtoggle { display: inline-flex; }
  .nav {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    background: var(--paper); border-bottom: 1px solid var(--rule);
    flex-direction: column; align-items: stretch; padding: .7rem 1.5rem 1.1rem;
    box-shadow: var(--sh-2); gap: .1rem;
  }
  .nav.open { display: flex; }
  .nav a { padding: .7rem .6rem; border-radius: var(--r-sm); }
  .nav a::after { display: none; }
  .nav .cta { margin: .6rem 0 0; justify-content: center; }
}

/* ---------------------------------- hero ---------------------------------- */
.hero {
  position: relative; overflow: hidden;
  background: var(--hero-bg); color: var(--hero-ink);
  padding: 5.5rem 0 4.5rem;
  border-bottom: 1px solid var(--hero-edge);
}
.hero::before {
  content: ''; position: absolute; inset: -40% -10% auto -10%; height: 130%;
  background:
    radial-gradient(46% 46% at 78% 18%, rgba(var(--accent-rgb), calc(.5 * var(--hero-glow))), transparent 68%),
    radial-gradient(40% 40% at 18% 78%, rgba(var(--accent3-rgb), calc(.32 * var(--hero-glow))), transparent 70%),
    radial-gradient(36% 36% at 52% 12%, rgba(var(--accent2-rgb), calc(.32 * var(--hero-glow))), transparent 72%);
  filter: blur(20px);
}
.hero::after {
  content: ''; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image:
    linear-gradient(90deg, var(--hero-grid) 1px, transparent 1px),
    linear-gradient(var(--hero-grid) 1px, transparent 1px);
  background-size: 52px 52px;
  mask-image: radial-gradient(ellipse 110% 90% at 50% 30%, #000 25%, transparent 78%);
  -webkit-mask-image: radial-gradient(ellipse 110% 90% at 50% 30%, #000 25%, transparent 78%);
}
.hero-inner { position: relative; z-index: 2; max-width: var(--wrap); margin: 0 auto; padding: 0 1.5rem; }

.eyebrow {
  font-family: var(--mono); font-size: .7rem; letter-spacing: .18em;
  text-transform: uppercase; color: var(--ink-3); margin: 0 0 1rem;
  display: flex; align-items: center; gap: .5rem;
}
.hero .eyebrow { color: var(--hero-eyebrow); }
.eyebrow::before {
  content: ''; width: 22px; height: 2px; background: var(--grad); border-radius: 2px;
}

.hero h1 {
  font-family: var(--display);
  font-size: clamp(2.4rem, 6vw, 4.2rem); line-height: 1.02; letter-spacing: calc(-.045em * var(--tight, 1));
  font-weight: 700; margin: 0 0 1.2rem; max-width: 18ch;
}
.gradient-text {
  background: var(--hero-grad); -webkit-background-clip: text; background-clip: text;
  color: transparent;
}
.hero p.lede {
  font-size: clamp(1.05rem, 1.5vw, 1.25rem); line-height: 1.6;
  color: var(--hero-ink-2); max-width: 60ch; margin: 0 0 2rem;
}
.hero-actions { display: flex; gap: .75rem; flex-wrap: wrap; }

.figures {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 1rem; margin-top: 3.4rem;
}
.figures div {
  padding: 1.1rem 1.2rem; border-radius: var(--r);
  background: var(--hero-card); border: 1px solid var(--hero-card-line);
  backdrop-filter: blur(6px);
}
.figures strong {
  display: block; font-family: var(--display); font-size: 2.1rem;
  font-weight: 700; letter-spacing: calc(-.035em * var(--tight, 1)); line-height: 1;
  background: var(--hero-grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.figures span {
  font-family: var(--mono); font-size: .66rem; letter-spacing: .14em;
  text-transform: uppercase; color: var(--hero-ink-3); margin-top: .35rem; display: block;
}

/* --------------------------------- buttons -------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  font-family: var(--text); font-size: .9rem; font-weight: 600; line-height: 1.2;
  padding: .7rem 1.25rem; border-radius: 999px; border: 1px solid transparent;
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: transform .16s var(--ease), box-shadow .2s var(--ease),
              background .2s var(--ease), border-color .2s var(--ease), color .2s var(--ease);
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary { background: var(--indigo-lo); color: #fff; }
.btn-primary:hover { background: var(--indigo); color: #fff; box-shadow: var(--glow); }

.btn-gradient { background: var(--grad-btn); color: #fff; background-size: 160% 100%; }
.btn-gradient:hover { color: #fff; background-position: 100% 0; box-shadow: var(--glow); }

.btn-ghost { background: var(--hero-ghost); color: var(--hero-ink); border-color: var(--hero-ghost-line); }
.btn-ghost:hover { background: var(--hero-ghost-hover); color: var(--hero-ink); border-color: var(--hero-ghost-line-hover); }

.btn-outline { background: var(--paper); color: var(--ink); border-color: var(--rule); }
.btn-outline:hover { border-color: var(--indigo); color: var(--indigo-lo); box-shadow: var(--sh-1); }

.btn-danger { background: var(--paper); color: var(--magenta); border-color: #f9cede; }
.btn-danger:hover { background: var(--magenta); color: #fff; border-color: var(--magenta); }

.btn-sm { padding: .4rem .8rem; font-size: .8rem; gap: .35rem; }
.btn-icon { padding: .45rem; border-radius: 10px; }
.btn-block { width: 100%; }

/* -------------------------------- sections -------------------------------- */
.section { padding-block: 4.5rem; }   /* top and bottom only: .wrap supplies the sides */
.section.alt { background: var(--paper-2); border-block: 1px solid var(--rule); }
.section.dark { background: var(--void); color: var(--on-dark); }
.section.dark .section-head h2 { color: var(--on-dark); }
.section.dark .section-head p { color: var(--on-dark-2); }

.section-head { margin-bottom: 2.4rem; display: flex; align-items: flex-end; gap: 1.5rem; flex-wrap: wrap; }
.section-head > div { flex: 1; min-width: 260px; }
.section-head h2 {
  font-family: var(--display); font-size: clamp(1.6rem, 3vw, 2.3rem);
  letter-spacing: calc(-.035em * var(--tight, 1)); font-weight: 700; margin: 0 0 .45rem; line-height: 1.12;
}
.section-head p { color: var(--ink-3); margin: 0; max-width: 62ch; }

.pagehead {
  position: relative; padding: 3.4rem 0 2.2rem; background: var(--hero-bg); color: var(--hero-ink);
  overflow: hidden; border-bottom: 1px solid var(--hero-edge);
}
.pagehead::before {
  content: ''; position: absolute; inset: -60% -20% auto -20%; height: 200%;
  background: radial-gradient(40% 50% at 72% 30%, rgba(var(--accent-rgb), calc(.42 * var(--hero-glow))), transparent 70%),
              radial-gradient(34% 44% at 22% 60%, rgba(var(--accent3-rgb), calc(.22 * var(--hero-glow))), transparent 72%);
  filter: blur(18px);
}
.pagehead .wrap { position: relative; z-index: 1; }
.pagehead h1 {
  font-family: var(--display); font-size: clamp(2rem, 4.4vw, 3rem);
  letter-spacing: calc(-.04em * var(--tight, 1)); font-weight: 700; margin: 0; line-height: 1.06;
}
.pagehead p { color: var(--hero-ink-2); max-width: 68ch; margin: .8rem 0 0; }
.pagehead p a { color: var(--hero-link); }

/* ---------------------------------- grid ---------------------------------- */
.grid { display: grid; gap: 1.4rem; }
.g2 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 20.5rem), 1fr)); }
.g3 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr)); }
.g4 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 12.5rem), 1fr)); }
.split { display: grid; grid-template-columns: minmax(0,1fr) 22rem; gap: 3.5rem; align-items: start; }
@media (max-width: 920px) { .split { grid-template-columns: 1fr; gap: 2.5rem; } }

/* ---------------------------------- cards --------------------------------- */
.card {
  position: relative; background: var(--paper);
  border: 1px solid var(--rule); border-radius: var(--r-lg);
  padding: 1.5rem; overflow: hidden;
  transition: transform .2s var(--ease), box-shadow .25s var(--ease), border-color .2s var(--ease);
}
.card::before {
  content: ''; position: absolute; inset: 0 0 auto 0; height: 3px;
  background: var(--grad); opacity: 0; transition: opacity .25s var(--ease);
}
.card h3 {
  font-family: var(--display); margin: 0 0 .5rem;
  font-size: 1.12rem; letter-spacing: calc(-.02em * var(--tight, 1)); line-height: 1.3;
}
.card h3 a { color: inherit; text-decoration: none; }
.card p { margin: 0; color: var(--ink-3); font-size: .93rem; line-height: 1.6; }

a.card, .card.linked { text-decoration: none; color: inherit; display: block; }
a.card:hover, .card.linked:hover, .card:hover {
  border-color: transparent; box-shadow: var(--sh-2); transform: translateY(-3px);
}
a.card:hover::before, .card.linked:hover::before, .card:hover::before { opacity: 1; }
a.card:hover h3 { color: var(--indigo-lo); }

.card-icon {
  width: 44px; height: 44px; display: grid; place-items: center; margin-bottom: 1rem;
  border-radius: 12px; background: var(--grad-soft); color: var(--indigo-lo);
  border: 1px solid rgba(var(--accent-rgb),.2);
}
.card-icon .ic { width: 22px; height: 22px; }
.card:nth-child(3n+2) .card-icon { color: var(--violet); background: linear-gradient(115deg, rgba(var(--accent2-rgb),.14), rgba(244,63,126,.12)); border-color: rgba(var(--accent2-rgb),.22); }
.card:nth-child(3n+3) .card-icon { color: #0891b2; background: linear-gradient(115deg, rgba(var(--accent3-rgb),.16), rgba(45,212,191,.12)); border-color: rgba(var(--accent3-rgb),.24); }

.card-go {
  display: inline-flex; align-items: center; gap: .35rem; margin-top: 1rem;
  font-size: .82rem; font-weight: 600; color: var(--indigo-lo);
}
.card-go .ic { transition: transform .2s var(--ease); }
a.card:hover .card-go .ic, .card.linked:hover .card-go .ic { transform: translateX(3px); }

/* --------------------------------- people --------------------------------- */
.person-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 1.6rem; }
.person { text-decoration: none; color: inherit; display: block; }
.person .shot {
  aspect-ratio: 1; border-radius: var(--r-lg); overflow: hidden; margin-bottom: .85rem;
  background: var(--paper-3); position: relative;
  transition: transform .22s var(--ease), box-shadow .25s var(--ease);
}
.person .shot::after {
  content: ''; position: absolute; inset: 0; border-radius: var(--r-lg);
  box-shadow: inset 0 0 0 1px rgba(10,13,22,.07);
}
.person .shot img { width: 100%; height: 100%; object-fit: cover; }
.person .shot .initials {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-family: var(--display); font-size: 2rem; font-weight: 700;
  letter-spacing: calc(-.04em * var(--tight, 1)); color: #fff; background: var(--grad);
}
.person:hover .shot { transform: translateY(-4px); box-shadow: var(--sh-2); }
.person strong { display: block; font-size: .97rem; font-weight: 600; letter-spacing: calc(-.01em * var(--tight, 1)); }
.person span { display: block; font-size: .83rem; color: var(--ink-3); line-height: 1.45; }

.profile-head { display: grid; grid-template-columns: 230px minmax(0,1fr); gap: 2.8rem; align-items: start; }
@media (max-width: 760px) { .profile-head { grid-template-columns: 1fr; gap: 1.8rem; } }
.profile-head .shot {
  aspect-ratio: 1; border-radius: var(--r-xl); overflow: hidden;
  background: var(--paper-3); box-shadow: var(--sh-2);
}
.profile-head .shot img { width: 100%; height: 100%; object-fit: cover; }

/* ------------------------------ publications ------------------------------ */
.pub {
  display: flex; gap: .9rem; padding: .7rem .7rem;
  border-radius: var(--r); border: 1px solid transparent;
  transition: background .18s var(--ease), border-color .18s var(--ease);
}
.pub:hover { background: var(--paper-2); }
.pub + .pub { border-top: 1px solid var(--rule); border-radius: 0; }
.pub-num {
  font-family: var(--mono); font-size: .7rem; color: var(--ink-3);
  padding-top: .18rem; min-width: 2rem;
}
.pub-body { flex: 1; min-width: 0; }
.pub h3 {
  font-family: var(--display); margin: 0 0 .12rem;
  font-size: .98rem; font-weight: 600; letter-spacing: calc(-.01em * var(--tight, 1)); line-height: 1.35;
}
.pub .pub-meta { font-size: .86rem; line-height: 1.45; color: var(--ink-2); margin: 0 0 .32rem; }
.pub .venue { color: var(--ink-3); }
.pub .venue em { font-style: italic; }
.pub .links { display: flex; gap: .25rem .35rem; flex-wrap: wrap; align-items: center; font-size: .72rem; }
.pub .links a, .pub .links button {
  display: inline-flex; align-items: center;
  font-family: var(--mono); font-size: .64rem; letter-spacing: .05em; text-transform: uppercase;
  padding: .1rem .45rem; border: 1px solid var(--rule); border-radius: 999px;
  text-decoration: none; color: var(--ink-3); background: var(--paper); cursor: pointer;
  transition: all .18s var(--ease); font-weight: 500; line-height: 1.5;
}
.pub .links a:hover, .pub .links button:hover {
  border-color: var(--indigo); color: var(--indigo-lo); background: rgba(var(--accent-rgb),.06);
}
.pub-type {
  font-family: var(--mono); font-size: .62rem; letter-spacing: .06em; text-transform: uppercase;
  font-weight: 600; padding: .1rem .45rem; border-radius: 999px; line-height: 1.5;
  background: rgba(var(--accent-rgb), .09); color: var(--indigo-lo);
}
.pub-type.cyan    { background: rgba(var(--accent2-rgb), .12); }
.pub-type.magenta { background: rgba(var(--accent3-rgb), .12); }
.pub-type.green   { background: rgba(16, 150, 100, .1); color: #0d7a52; }
.pub .pub-tags { color: var(--ink-3); font-size: .74rem; margin-left: .2rem; }
.pub .pub-tags::before { content: '·'; margin-right: .4rem; }
.pub .links .pub-tags a, .pub .pub-tags span {
  border: 0; padding: 0; background: none; font-family: inherit; font-size: inherit;
  letter-spacing: 0; text-transform: none; color: var(--ink-3); margin-right: .55rem;
}
.pub .links .pub-tags a:hover { color: var(--indigo-lo); background: none; text-decoration: underline; }
.pub-year {
  font-family: var(--mono); font-size: .72rem; letter-spacing: .14em; color: var(--ink-3);
  margin: 1.2rem 0 .2rem .7rem; font-weight: 600;
}

/* ---------------------------------- chips --------------------------------- */
.chip {
  display: inline-flex; align-items: center; gap: .3rem;
  font-family: var(--mono); font-size: .68rem; letter-spacing: .06em; text-transform: uppercase;
  padding: .28rem .62rem; border-radius: 999px; font-weight: 500;
  background: var(--paper-2); color: var(--ink-3); border: 1px solid var(--rule);
  text-decoration: none; transition: all .18s var(--ease);
}
a.chip:hover, button.chip:hover {
  border-color: var(--indigo); color: var(--indigo-lo);
  background: rgba(var(--accent-rgb),.07); transform: translateY(-1px);
}
.chip.on { background: var(--grad); color: #fff; border-color: transparent; }
.chip.on:hover { color: #fff; }
.chip.magenta { color: #be185d; border-color: #f9cede; background: #fdf2f7; }
.chip.green   { color: #047857; border-color: #b7e6d3; background: #f0fdf8; }
.chip.violet  { color: #7c3aed; border-color: #ddd0fb; background: #f9f5ff; }
.chip.cyan    { color: #0e7490; border-color: #bae9f4; background: #f0fbfe; }
.chip.amber   { color: #b45309; border-color: #f6dfb4; background: #fffbeb; }

.filterbar { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.taglist { display: flex; gap: .4rem; flex-wrap: wrap; margin-top: .7rem; }

.year-head {
  display: flex; align-items: center; gap: .9rem;
  font-family: var(--mono); font-size: .78rem; letter-spacing: .16em;
  color: var(--ink); margin: 1.8rem 0 .3rem; font-weight: 600;
}
.year-head::after { content: ''; flex: 1; height: 1px; background: var(--rule); }
.year-head:first-child { margin-top: 0; }

/* ----------------------------------- news --------------------------------- */
.newsitem {
  display: grid; grid-template-columns: 118px minmax(0,1fr); gap: 1.5rem;
  padding: 1.5rem 1.1rem; border-radius: var(--r);
  border-bottom: 1px solid var(--rule);
  transition: background .18s var(--ease);
}
.newsitem:hover { background: var(--paper-2); }
@media (max-width: 640px) { .newsitem { grid-template-columns: 1fr; gap: .6rem; } }
.newsitem time { font-family: var(--mono); font-size: .74rem; color: var(--ink-3); padding-top: .3rem; }
.newsitem h3 {
  font-family: var(--display); margin: 0 0 .35rem;
  font-size: 1.1rem; letter-spacing: calc(-.022em * var(--tight, 1)); line-height: 1.32;
}
.newsitem h3 a { color: inherit; text-decoration: none; }
.newsitem h3 a:hover { color: var(--indigo-lo); }
.newsitem p { margin: 0; color: var(--ink-3); font-size: .94rem; }

/* ---------------------------------- prose --------------------------------- */
.prose { font-size: 1.03rem; line-height: 1.75; color: var(--ink-2); }
.prose h2 {
  font-family: var(--display); font-size: 1.45rem; letter-spacing: calc(-.028em * var(--tight, 1));
  margin: 2.2rem 0 .75rem; color: var(--ink); font-weight: 700;
}
.prose h3 {
  font-family: var(--display); font-size: 1.15rem; letter-spacing: calc(-.02em * var(--tight, 1));
  margin: 1.6rem 0 .5rem; color: var(--ink); font-weight: 600;
}
.prose p { margin: 0 0 1.1rem; }
.prose ul, .prose ol { margin: 0 0 1.1rem; padding-left: 1.3rem; }
.prose li { margin-bottom: .45rem; }
.prose li::marker { color: var(--indigo); }
.prose strong { color: var(--ink); font-weight: 600; }
.prose blockquote {
  border-left: 3px solid transparent; border-image: var(--grad) 1;
  margin: 1.6rem 0; padding: .3rem 0 .3rem 1.2rem; color: var(--ink-3);
}
.prose code {
  font-family: var(--mono); font-size: .87em;
  background: var(--paper-3); padding: .12em .4em; border-radius: 5px; color: var(--indigo-lo);
}
.prose pre {
  background: var(--void); color: var(--on-dark); padding: 1.2rem;
  border-radius: var(--r); overflow-x: auto;
}
.prose pre code { background: none; color: inherit; }
.prose img { border-radius: var(--r); margin: 1.4rem 0; }
.prose table { width: 100%; border-collapse: collapse; margin: 1.4rem 0; font-size: .93rem; }
.prose th, .prose td { text-align: left; padding: .65rem .8rem; border-bottom: 1px solid var(--rule); }
.prose th { font-weight: 600; background: var(--paper-2); }
.prose a { font-weight: 500; }

/* --------------------------------- gallery -------------------------------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 1.2rem; }
.tile {
  border: 1px solid var(--rule); border-radius: var(--r-lg); overflow: hidden;
  background: var(--paper); transition: transform .22s var(--ease), box-shadow .25s var(--ease);
}
.tile:hover { transform: translateY(-4px); box-shadow: var(--sh-2); }
.tile img { width: 100%; aspect-ratio: 4/3; object-fit: cover; }
.tile .cap { padding: .85rem 1rem; font-size: .88rem; font-weight: 500; }
.tile .cap span {
  display: block; font-family: var(--mono); font-size: .67rem;
  color: var(--ink-3); margin-top: .25rem; font-weight: 400;
}

/* ---------------------------------- forms --------------------------------- */
.field { margin-bottom: 1.3rem; }
.field label { display: block; font-size: .85rem; font-weight: 600; margin-bottom: .4rem; color: var(--ink); }
.field .help { font-size: .8rem; color: var(--ink-3); margin: .35rem 0 0; line-height: 1.5; }
.req { color: var(--magenta); }

input[type=text], input[type=email], input[type=url], input[type=password], input[type=number],
input[type=date], input[type=search], input[type=tel], select, textarea {
  width: 100%; font: inherit; font-size: .93rem; padding: .68rem .85rem;
  border: 1px solid var(--rule); border-radius: 10px;
  background: var(--paper); color: var(--ink);
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease);
}
input::placeholder, textarea::placeholder { color: #9aa4bd; }
textarea { min-height: 130px; resize: vertical; line-height: 1.6; }
textarea.tall { min-height: 280px; font-family: var(--mono); font-size: .85rem; }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--indigo);
  box-shadow: 0 0 0 4px rgba(var(--accent-rgb),.13);
}
select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364708c' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right .7rem center; background-size: 18px;
  padding-right: 2.4rem;
}
input[type=file] {
  width: 100%; font-size: .88rem; padding: .6rem;
  border: 1px dashed var(--rule); border-radius: 10px; background: var(--paper-2); cursor: pointer;
}
input[type=file]:hover { border-color: var(--indigo); background: rgba(var(--accent-rgb),.04); }
input[type=checkbox] { width: 17px; height: 17px; accent-color: var(--indigo-lo); cursor: pointer; }

.checkline { display: flex; align-items: flex-start; gap: .6rem; }
.checkline input { margin-top: .25rem; }
.checkline label { font-weight: 500; margin: 0; cursor: pointer; }

fieldset { border: 1px solid var(--rule); border-radius: var(--r-lg); padding: 1.5rem; margin: 0 0 1.5rem; }
legend {
  font-family: var(--mono); font-size: .68rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink-3); padding: 0 .5rem; font-weight: 500;
}

.searchform { display: flex; gap: .5rem; }
.searchform input { flex: 1; }

/* --------------------------------- notices -------------------------------- */
.notice {
  display: flex; gap: .8rem; align-items: flex-start;
  padding: 1rem 1.15rem; border-radius: var(--r); margin-bottom: 1.5rem;
  border: 1px solid rgba(var(--accent-rgb),.25); background: rgba(var(--accent-rgb),.06);
  font-size: .93rem; color: var(--ink-2);
}
.notice .ic { color: var(--indigo-lo); margin-top: .15rem; }
.notice strong { display: block; margin-bottom: .2rem; color: var(--ink); }
.notice.good { border-color: rgba(16,185,129,.3); background: rgba(16,185,129,.07); }
.notice.good .ic { color: var(--green); }
.notice.bad { border-color: rgba(244,63,126,.3); background: rgba(244,63,126,.06); }
.notice.bad .ic { color: var(--magenta); }
.notice.warn { border-color: rgba(245,158,11,.32); background: rgba(245,158,11,.07); }
.notice.warn .ic { color: var(--amber); }

.empty {
  padding: 3.2rem 1.5rem; text-align: center;
  border: 1px dashed var(--rule); border-radius: var(--r-lg);
  color: var(--ink-3); background: var(--paper-2);
}
.empty .ic { width: 34px; height: 34px; color: #b3bdd4; margin: 0 auto .8rem; display: block; }
.empty strong {
  display: block; font-family: var(--display); font-size: 1.05rem;
  color: var(--ink); margin-bottom: .4rem; font-weight: 600;
}

/* --------------------------------- footer --------------------------------- */
.footer {
  background: var(--foot-bg); color: var(--hero-ink-2); border-top: 1px solid var(--hero-edge);
  padding: 4rem 0 2rem; margin-top: 5rem; font-size: .92rem;
  position: relative; overflow: hidden;
}
.footer::before {
  content: ''; position: absolute; inset: auto -20% -60% -20%; height: 120%;
  background: radial-gradient(40% 60% at 30% 20%, rgba(var(--accent-rgb), calc(.2 * var(--hero-glow))), transparent 70%);
}
.footer .wrap { position: relative; z-index: 1; }
.footer a { color: var(--hero-ink-2); text-decoration: none; transition: color .18s var(--ease); }
.footer a:hover { color: var(--hero-link); }
.footer-grid { display: grid; grid-template-columns: 1.7fr 1fr 1fr 1fr; gap: 2.5rem; }
@media (max-width: 860px) { .footer-grid { grid-template-columns: 1fr 1fr; gap: 2rem; } }
@media (max-width: 520px) { .footer-grid { grid-template-columns: 1fr; } }
.footer h4 {
  font-family: var(--mono); font-size: .67rem; letter-spacing: .16em; text-transform: uppercase;
  color: var(--hero-ink-3); margin: 0 0 1rem; font-weight: 500;
}
.footer ul { list-style: none; margin: 0; padding: 0; }
.footer li { margin-bottom: .5rem; }
.footer li a { display: inline-flex; align-items: center; gap: .4rem; }
.footer address { font-style: normal; white-space: pre-line; line-height: 1.7; }
.footer .colophon {
  margin-top: 3rem; padding-top: 1.6rem; border-top: 1px solid var(--hero-edge);
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  font-size: .84rem; color: var(--hero-ink-3);
}

/* --------------------------------- sundries ------------------------------- */
.skip {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  background: var(--void); color: #fff; padding: .8rem 1.2rem; border-radius: 0 0 var(--r) 0;
}
.skip:focus { left: 0; }
.muted { color: var(--ink-3); }
.mono { font-family: var(--mono); }
.small { font-size: .86rem; }
.stack > * + * { margin-top: 1rem; }
.rowbetween { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.logos { display: flex; gap: 2.4rem; flex-wrap: wrap; align-items: center; }
.logos img { max-height: 54px; width: auto; filter: grayscale(1); opacity: .55; transition: all .22s var(--ease); }
.logos img:hover { filter: none; opacity: 1; }
hr.rule { border: 0; border-top: 1px solid var(--rule); margin: 2.8rem 0; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

.deflist { display: grid; grid-template-columns: auto minmax(0,1fr); gap: .5rem 1.2rem; margin: 0 0 1.8rem; font-size: .92rem; }
.deflist dt { font-family: var(--mono); font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); padding-top: .2rem; }
.deflist dd { margin: 0; }

/* =============================================================================
   HIGHLIGHTS CAROUSEL  (home page)
   One picture at a time, crossfading. Works without JavaScript: the first
   slide is marked .on server-side, so something sensible shows regardless.
   ========================================================================== */
.highlights { padding: 3.5rem 0 1rem; background: var(--paper-2); border-block: 1px solid var(--rule); }
.hl-strip {
  position: relative; max-width: var(--wrap); margin: 0 auto; padding: 0 1.5rem;
}
.hl-track {
  position: relative; border-radius: var(--r-xl); overflow: hidden;
  background: var(--void); aspect-ratio: 21/9; box-shadow: var(--sh-3);
}
@media (max-width: 760px) { .hl-track { aspect-ratio: 4/3; } }
.hl-slide {
  position: absolute; inset: 0; margin: 0;
  opacity: 0; transition: opacity .7s var(--ease);
  pointer-events: none;
}
.hl-slide.on { opacity: 1; pointer-events: auto; }
.hl-slide img { width: 100%; height: 100%; object-fit: cover; }
.hl-slide figcaption {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 2.4rem 1.8rem 1.4rem;
  color: #fff; background: linear-gradient(transparent, rgba(5,7,15,.85));
}
.hl-slide figcaption strong {
  display: block; font-family: var(--display); font-size: 1.15rem;
  letter-spacing: calc(-.02em * var(--tight, 1)); font-weight: 600;
}
.hl-slide figcaption span {
  font-family: var(--mono); font-size: .7rem; letter-spacing: .1em;
  text-transform: uppercase; color: rgba(255,255,255,.72);
}
.hl-arrow {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 3;
  width: 42px; height: 42px; display: grid; place-items: center;
  border: 0; border-radius: 50%; cursor: pointer;
  background: rgba(5,7,15,.55); color: #fff;
  backdrop-filter: blur(6px); transition: background .18s var(--ease);
}
.hl-arrow:hover { background: var(--indigo-lo); }
.hl-arrow.prev { left: 2.4rem; }
.hl-arrow.next { right: 2.4rem; }
.hl-arrow.prev .ic { transform: rotate(180deg); }
.hl-dots {
  position: absolute; bottom: 1rem; left: 50%; transform: translateX(-50%);
  display: flex; gap: .4rem; z-index: 3;
}
.hl-dot {
  width: 8px; height: 8px; border-radius: 50%; border: 0; cursor: pointer; padding: 0;
  background: rgba(255,255,255,.4); transition: all .2s var(--ease);
}
.hl-dot.on { background: #fff; width: 22px; border-radius: 4px; }

/* =============================================================================
   PHOTO GRIDS  (gallery, member upload screen)
   ========================================================================== */
.photo-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .9rem;
}
.photo-cell { margin: 0; position: relative; }
.photo-cell img {
  width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--r);
  border: 1px solid var(--rule); background: var(--paper-3);
  transition: transform .2s var(--ease), box-shadow .22s var(--ease);
}
.photo-cell figcaption {
  font-size: .78rem; color: var(--ink-3); margin-top: .4rem;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
a.photo-cell:hover img, button.photo-cell:hover img {
  transform: translateY(-3px); box-shadow: var(--sh-2);
}
button.photo-cell { border: 0; background: none; padding: 0; cursor: pointer; text-align: left; font: inherit; }

/* Thumbnails of what has just been chosen in the file picker */
.photo-preview { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .8rem; }
.photo-preview img {
  width: 76px; height: 76px; object-fit: cover; border-radius: 9px; border: 1px solid var(--rule);
}
.photo-preview .more {
  width: 76px; height: 76px; border-radius: 9px; border: 1px dashed var(--rule);
  display: grid; place-items: center; font-family: var(--mono); font-size: .75rem; color: var(--ink-3);
}

/* Event grouping on the gallery page */
.event-head {
  display: flex; align-items: baseline; gap: .8rem; flex-wrap: wrap;
  margin: 2.6rem 0 1rem;
}
.event-head h3 {
  font-family: var(--display); font-size: 1.2rem; letter-spacing: calc(-.025em * var(--tight, 1));
  margin: 0; font-weight: 600;
}
.event-head .meta { font-family: var(--mono); font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }

/* =============================================================================
   LIGHTBOX
   ========================================================================== */
.lightbox {
  position: fixed; inset: 0; z-index: 200; display: none;
  background: rgba(5,7,15,.94); backdrop-filter: blur(8px);
  align-items: center; justify-content: center; padding: 2rem;
}
.lightbox.on { display: flex; }
.lightbox img { max-width: 100%; max-height: 82vh; border-radius: var(--r); box-shadow: var(--sh-3); }
.lightbox figcaption {
  position: absolute; bottom: 1.6rem; left: 0; right: 0; text-align: center;
  color: rgba(255,255,255,.85); font-size: .9rem; padding: 0 2rem;
}
.lightbox .lb-close, .lightbox .lb-prev, .lightbox .lb-next {
  position: absolute; width: 44px; height: 44px; display: grid; place-items: center;
  border: 0; border-radius: 50%; cursor: pointer;
  background: rgba(255,255,255,.12); color: #fff; transition: background .18s var(--ease);
}
.lightbox .lb-close:hover, .lightbox .lb-prev:hover, .lightbox .lb-next:hover { background: var(--indigo-lo); }
.lightbox .lb-close { top: 1.5rem; right: 1.5rem; }
.lightbox .lb-prev { left: 1.5rem; top: 50%; transform: translateY(-50%); }
.lightbox .lb-next { right: 1.5rem; top: 50%; transform: translateY(-50%); }
.lightbox .lb-prev .ic { transform: rotate(180deg); }

/* =============================================================================
   CONFERENCE DEADLINES
   ========================================================================== */
.deadlines {
  border: 1px solid var(--rule); border-radius: var(--r-lg);
  padding: 1.4rem 1.6rem; margin-bottom: 2.4rem; background: var(--paper-2);
}
.deadlines ul { list-style: none; margin: .8rem 0 1.2rem; padding: 0; }
.deadlines li {
  display: flex; align-items: center; gap: 1rem;
  padding: .6rem 0; border-bottom: 1px solid var(--rule);
}
.deadlines li:last-child { border-bottom: 0; }
.dl-days {
  display: grid; place-items: center; min-width: 56px; padding: .4rem .3rem;
  border-radius: 10px; background: var(--grad-soft); border: 1px solid rgba(var(--accent-rgb),.2);
  line-height: 1;
}
.dl-days strong { font-family: var(--display); font-size: 1.25rem; color: var(--indigo-lo); font-weight: 700; }
.dl-days span { font-family: var(--mono); font-size: .58rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); margin-top: .2rem; }
.dl-days.urgent { background: rgba(244,63,126,.08); border-color: rgba(244,63,126,.28); }
.dl-days.urgent strong { color: var(--magenta); }
.dl-what strong { display: block; font-weight: 600; }

.conf .conf-head { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start; }
.conf h3 { margin: 0; }

/* =============================================================================
   DARK MODE
   The toggle sets data-theme on <html>; with no choice saved we follow the
   operating system. Every colour below is a surface or ink token, so the rest
   of the stylesheet needs no changes at all.
   ========================================================================== */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0a0d16;  --paper-2: #10141f; --paper-3: #171c2a; --rule: #242b3d;
    --ink: #eef1fa;    --ink-2: #b6c0d8;   --ink-3: #8491ae;
    --sh-1: 0 1px 2px rgba(0,0,0,.4);
    --sh-2: 0 4px 12px rgba(0,0,0,.45), 0 18px 40px -12px rgba(0,0,0,.6);
    --sh-3: 0 20px 60px -16px rgba(0,0,0,.7);
  }
}
:root[data-theme="dark"] {
  --paper: #0a0d16;  --paper-2: #10141f; --paper-3: #171c2a; --rule: #242b3d;
  --ink: #eef1fa;    --ink-2: #b6c0d8;   --ink-3: #8491ae;
  --sh-1: 0 1px 2px rgba(0,0,0,.4);
  --sh-2: 0 4px 12px rgba(0,0,0,.45), 0 18px 40px -12px rgba(0,0,0,.6);
  --sh-3: 0 20px 60px -16px rgba(0,0,0,.7);
}
:root[data-theme="dark"] .masthead { background: rgba(10,13,22,.82); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .masthead { background: rgba(10,13,22,.82); }
}
:root[data-theme="dark"] .chip.magenta { background: rgba(244,63,126,.12); border-color: rgba(244,63,126,.3); color: #fb9ec2; }
:root[data-theme="dark"] .chip.green   { background: rgba(16,185,129,.12); border-color: rgba(16,185,129,.3); color: #6ee7b7; }
:root[data-theme="dark"] .chip.violet  { background: rgba(var(--accent2-rgb),.12); border-color: rgba(var(--accent2-rgb),.3); color: #d8b4fe; }
:root[data-theme="dark"] .chip.cyan    { background: rgba(var(--accent3-rgb),.12); border-color: rgba(var(--accent3-rgb),.3); color: #89e2f5; }
:root[data-theme="dark"] .chip.amber   { background: rgba(245,158,11,.12); border-color: rgba(245,158,11,.3); color: #fcd34d; }

.themetoggle {
  display: inline-grid; place-items: center; width: 36px; height: 36px;
  margin-left: .4rem; border-radius: 50%; cursor: pointer;
  border: 1px solid var(--rule); background: var(--paper); color: var(--ink-2);
  transition: all .18s var(--ease);
}
.themetoggle:hover { border-color: var(--indigo); color: var(--indigo-lo); }
.themetoggle .ic-sun { display: none; }
:root[data-theme="dark"] .themetoggle .ic-sun { display: block; }
:root[data-theme="dark"] .themetoggle .ic-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .themetoggle .ic-sun { display: block; }
  :root:not([data-theme="light"]) .themetoggle .ic-moon { display: none; }
}

/* Storage meter in the admin area */
.meter { height: 8px; border-radius: 999px; background: var(--paper-3); overflow: hidden; margin: .6rem 0 .4rem; }
.meter span { display: block; height: 100%; border-radius: 999px; background: var(--grad); }
.meter.warn span { background: linear-gradient(90deg, var(--amber), var(--magenta)); }

/* =============================================================================
   STATIC EXPORT
   Pages saved by "npm run export" carry class="static-site" on <body>. Plain
   files cannot filter by "?year=2024" or search, so controls marked
   data-dynamic in the templates are hidden
   rather than left to do nothing when clicked.
   ========================================================================== */
.static-site [data-dynamic] { display: none !important; }

/* Header order: logo, menu, then the light/dark switch at the far right. */
.masthead .nav, .masthead .navtoggle { order: 2; }
.masthead .themetoggle { order: 3; }

/* =============================================================================
   PHONES, TABLETS AND TOUCH SCREENS
   Everything above is written for a desktop first; this section adjusts it for
   small screens and fingers. Two kinds of rule:
     (max-width: …)    the screen is narrow — rearrange the layout
     (pointer: coarse) the visitor uses a finger — make things easier to hit
   ========================================================================== */

/* Headings never inherit the loose line spacing of body text. */
h1, h2, h3 { line-height: 1.18; }

/* A caption under one gallery photo must not push it out of line with the
   photos beside it. */
.photo-grid { align-items: start; }
.photo-cell { display: flex; flex-direction: column; align-items: stretch; }

/* --- iPhones zoom the whole page when a box with text under 16px is tapped.
       At exactly 16px they do not. ------------------------------------------ */
@media (max-width: 768px), (pointer: coarse) {
  input[type=text], input[type=email], input[type=url], input[type=password],
  input[type=number], input[type=date], input[type=search], input[type=tel],
  select, textarea { font-size: 16px; }
}

/* --- Finger-sized targets: at least 36–44 px, the size phone makers advise. */
@media (pointer: coarse), (max-width: 768px) {
  .btn { min-height: 44px; }
  .btn-sm { min-height: 40px; padding: .55rem 1rem; font-size: .84rem; }
  .btn-icon { min-width: 44px; }
  a.chip, button.chip { min-height: 36px; padding: .45rem .8rem; }
  .pub .links a, .pub .links button { min-height: 32px; padding: .3rem .65rem; }
  .pub .links .pub-tags a { min-height: 0; padding: 0; }
  .card-go { padding-block: .6rem; }
  .footer li { margin-bottom: 0; }
  .footer li a { padding-block: .5rem; }
  input[type=checkbox] { width: 22px; height: 22px; }
  .checkline { align-items: center; }
  .checkline input { margin-top: 0; }
  .themetoggle { width: 42px; height: 42px; }
  /* Carousel dots: small to look at, large to touch. */
  .hl-dot { box-sizing: content-box; padding: 9px; background-clip: content-box; }
  .hl-dots { gap: 0; bottom: .3rem; }
  .hl-arrow { width: 44px; height: 44px; }
}

/* --- Narrow screens: tighter spacing, rearranged grids ------------------- */
@media (max-width: 640px) {
  .wrap { padding: 0 1.1rem; }
  .masthead-inner { padding: .7rem 1.1rem; }
  .section { padding-block: 2.8rem; }
  .pagehead { padding: 2.4rem 0 1.8rem; }
  .hero { padding: 3.4rem 0 3rem; }
  .figures { margin-top: 2.2rem; gap: .7rem; }
  .figures div { padding: .9rem 1rem; }
  .figures strong { font-size: 1.7rem; }
  .highlights { padding-top: 2.6rem; }
  .hl-strip { padding: 0 1.1rem; }
  .hl-arrow.prev { left: 1.6rem; }
  .hl-arrow.next { right: 1.6rem; }
  .section-head { margin-bottom: 1.6rem; }
  .footer { margin-top: 3rem; padding-top: 3rem; }

  /* Two people side by side instead of one enormous photo per row. */
  .person-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.4rem .9rem; }
  .person strong { font-size: .92rem; }
  .person span { font-size: .78rem; }
  .profile-head .shot { max-width: 220px; }

  /* Three photos across, like a phone's own photo gallery. */
  .photo-grid { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; gap: .45rem; }
  .photo-cell img { border-radius: 8px; }
  .photo-cell figcaption { font-size: .7rem; }

  /* Publications: the [3] counter moves above the title instead of taking a
     column of its own, and entries use the full width. */
  .pub { flex-direction: column; gap: .2rem; padding: .8rem .15rem; }
  .pub:hover { background: transparent; border-color: transparent; }
  .pub-num { min-width: 0; padding-top: 0; }

  /* Filter rows scroll sideways instead of stacking into a wall of labels. */
  .filterbar {
    flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none;
    padding-bottom: .3rem;
    -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 2rem), transparent);
            mask-image: linear-gradient(90deg, #000 calc(100% - 2rem), transparent);
  }
  .filterbar::-webkit-scrollbar { display: none; }
  .filterbar > * { flex: none; }

  .newsitem { padding: 1.2rem .15rem; }
  .card { padding: 1.25rem; }
  .split { gap: 2rem; }
  .deadlines { padding: 1.1rem 1.1rem; }
}

/* Shown only where the layout is a single column (e.g. "Apply" on Join us). */
.only-narrow { display: none; }
@media (max-width: 920px) { .only-narrow { display: inline-flex; } }

/* Jumping to #apply and similar must not hide the target under the fixed top bar. */
[id] { scroll-margin-top: 90px; }

/* A whole news item is one tap target, not just its title. */
.newsitem { position: relative; }
.newsitem h3 a::after { content: ''; position: absolute; inset: 0; border-radius: var(--r); }

@media (pointer: coarse), (max-width: 768px) {
  /* Links that stand alone in a list (lecture slides, related items) get room. */
  li > a:only-child { display: inline-block; padding-block: .4rem; }
}

/* The Menu button must use the page's text colour, not the browser's default
   black — otherwise it disappears in dark mode. */
.navtoggle { color: var(--ink); }

/* The active carousel dot keeps its touch padding transparent. */
@media (pointer: coarse), (max-width: 768px) {
  .hl-dot.on { background-color: #fff; background-clip: content-box; }
}

/* Coloured labels in dark mode for visitors whose device is set to dark (the
   rules further up cover only those who pressed the moon button). */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .chip.magenta { background: rgba(244,63,126,.12); border-color: rgba(244,63,126,.3); color: #fb9ec2; }
  :root:not([data-theme="light"]) .chip.green   { background: rgba(16,185,129,.12); border-color: rgba(16,185,129,.3); color: #6ee7b7; }
  :root:not([data-theme="light"]) .chip.violet  { background: rgba(var(--accent2-rgb),.12); border-color: rgba(var(--accent2-rgb),.3); color: #d8b4fe; }
  :root:not([data-theme="light"]) .chip.cyan    { background: rgba(var(--accent3-rgb),.12); border-color: rgba(var(--accent3-rgb),.3); color: #89e2f5; }
  :root:not([data-theme="light"]) .chip.amber   { background: rgba(245,158,11,.12); border-color: rgba(245,158,11,.3); color: #fcd34d; }
}

/* ===== Staging copy marker (STAGING=1 in .env) ============================= */
.stagingbar {
  position: relative; z-index: 70;
  padding: .45rem 1rem; text-align: center;
  font: 600 .82rem/1.3 var(--text);
  color: #fff;
  background: repeating-linear-gradient(135deg, #b91c1c 0 14px, #991b1b 14px 28px);
}
.pausebar { margin-bottom: 1.2rem; }

/* =============================================================================
   LOOK AND COLOURS  (Settings → Look and colours; src/theme.js)
   -----------------------------------------------------------------------------
   The top of the home page, the page headers and the footer share one set of
   "surface" variables. Three sets follow: dark (the original look), white,
   and tinted. <html data-hero="…"> picks one. A visitor in dark mode always
   gets the dark set, whatever the administrator chose for daylight.
   ========================================================================== */
:root, :root[data-hero="dark"] {
  --hero-bg: var(--void);           --foot-bg: var(--void);
  --hero-ink: var(--on-dark);       --hero-ink-2: var(--on-dark-2);  --hero-ink-3: var(--on-dark-3);
  --hero-eyebrow: color-mix(in srgb, var(--indigo) 55%, #fff);
  --hero-link: color-mix(in srgb, var(--indigo) 45%, #fff);
  --hero-grid: rgba(255,255,255,.055);  --hero-glow: 1;  --hero-edge: transparent;
  --hero-card: rgba(255,255,255,.045);  --hero-card-line: rgba(255,255,255,.09);  --hero-card-shadow: none;
  --hero-ghost: rgba(255,255,255,.07);  --hero-ghost-line: rgba(255,255,255,.22);
  --hero-ghost-hover: rgba(255,255,255,.14);  --hero-ghost-line-hover: rgba(255,255,255,.4);
  --hero-grad: var(--grad);
  --hero-disc: #fff;
}
:root[data-hero="light"], :root[data-hero="tint"] {
  --hero-bg: linear-gradient(180deg, #ffffff 0%, #f6f8fc 100%);
  --foot-bg: var(--paper-2);
  --hero-ink: var(--ink);           --hero-ink-2: var(--ink-2);      --hero-ink-3: var(--ink-3);
  --hero-eyebrow: var(--indigo-lo); --hero-link: var(--indigo-lo);
  --hero-grid: rgba(15,23,42,.045); --hero-glow: .38;  --hero-edge: var(--rule);
  --hero-card: #fff;                --hero-card-line: var(--rule);   --hero-card-shadow: var(--sh-1);
  --hero-ghost: #fff;               --hero-ghost-line: var(--rule);
  --hero-ghost-hover: var(--paper-2);  --hero-ghost-line-hover: var(--indigo);
  --hero-grad: var(--grad-ink);
}
:root[data-hero="tint"] {
  --hero-bg: linear-gradient(160deg, rgba(var(--accent-rgb),.11) 0%, rgba(var(--accent2-rgb),.06) 50%, rgba(var(--accent3-rgb),.09) 100%), #fff;
  --foot-bg: linear-gradient(160deg, rgba(var(--accent-rgb),.07), rgba(var(--accent3-rgb),.05)), var(--paper-2);
  --hero-glow: .6;
  --hero-card: rgba(255,255,255,.78);
}
/* Dark mode, chosen or automatic: the dark surfaces, always. */
:root[data-theme="dark"][data-hero] {
  --hero-bg: #05070f; --foot-bg: #05070f;
  --hero-ink: var(--on-dark); --hero-ink-2: var(--on-dark-2); --hero-ink-3: var(--on-dark-3);
  --hero-eyebrow: color-mix(in srgb, var(--indigo) 55%, #fff);
  --hero-link: color-mix(in srgb, var(--indigo) 45%, #fff);
  --hero-grid: rgba(255,255,255,.055); --hero-glow: 1; --hero-edge: transparent;
  --hero-card: rgba(255,255,255,.045); --hero-card-line: rgba(255,255,255,.09); --hero-card-shadow: none;
  --hero-ghost: rgba(255,255,255,.07); --hero-ghost-line: rgba(255,255,255,.22);
  --hero-ghost-hover: rgba(255,255,255,.14); --hero-ghost-line-hover: rgba(255,255,255,.4);
  --hero-grad: var(--grad);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"])[data-hero] {
    --hero-bg: #05070f; --foot-bg: #05070f;
    --hero-ink: var(--on-dark); --hero-ink-2: var(--on-dark-2); --hero-ink-3: var(--on-dark-3);
    --hero-eyebrow: color-mix(in srgb, var(--indigo) 55%, #fff);
    --hero-link: color-mix(in srgb, var(--indigo) 45%, #fff);
    --hero-grid: rgba(255,255,255,.055); --hero-glow: 1; --hero-edge: transparent;
    --hero-card: rgba(255,255,255,.045); --hero-card-line: rgba(255,255,255,.09); --hero-card-shadow: none;
    --hero-ghost: rgba(255,255,255,.07); --hero-ghost-line: rgba(255,255,255,.22);
    --hero-ghost-hover: rgba(255,255,255,.14); --hero-ghost-line-hover: rgba(255,255,255,.4);
    --hero-grad: var(--grad);
  }
}
.figures div { box-shadow: var(--hero-card-shadow); }

/* ---- Wide screens: a gentle zoom ------------------------------------------
   Above 1440 px everything measured in rem — text, spacing, the content width
   — grows smoothly, reaching about 130% on a 2560 px monitor. The page fills a
   large screen the way it fills a laptop's, instead of floating in the middle.
   Public pages only; the admin area keeps its compact size.                  */
@media (min-width: 1440px) {
  html.is-public { font-size: clamp(16px, calc(9px + .5vw), 21px); }
}

/* ---- The top of the home page: words on the left, a picture on the right -- */
@media (min-width: 1000px) { .hero { padding: clamp(4.5rem, 6vw, 6.5rem) 0 clamp(3.5rem, 4.5vw, 5rem); } }
.hero-grid { display: grid; gap: 3rem; align-items: center; }
@media (min-width: 1000px) {
  .hero-grid { grid-template-columns: minmax(0, 1.12fr) minmax(0, .88fr); gap: clamp(2.5rem, 5vw, 5.5rem); }
  .hero-grid.solo { grid-template-columns: minmax(0, 1fr); }
}
/* Phones and tablets keep the single column that already works well there. */
@media (max-width: 999px) { .hero-visual { display: none !important; } }
.hero-copy h1 { max-width: 16ch; }
.hero-grid.solo .hero-copy h1 { max-width: 20ch; }
.hero .figures { margin-top: clamp(2.6rem, 4vw, 3.6rem); }

/* the lab logo, on a disc with two quiet orbits */
.hv-logo {
  position: relative; display: grid; place-items: center;
  width: 100%; max-width: 30rem; aspect-ratio: 1; margin-left: auto;
}
.hv-orbit {
  position: absolute; inset: 0; border-radius: 50%;
  border: 1px dashed rgba(var(--accent-rgb), .32);
  animation: hv-spin 60s linear infinite;
}
.hv-orbit::before {
  content: ''; position: absolute; inset: 8%; border-radius: 50%;
  border: 1px solid rgba(var(--accent3-rgb), .28);
}
.hv-orbit::after {
  content: ''; position: absolute; top: 50%; left: -7px; width: 14px; height: 14px; margin-top: -7px;
  border-radius: 50%; background: var(--grad); box-shadow: 0 0 0 5px rgba(var(--accent-rgb), .14);
}
@keyframes hv-spin { to { transform: rotate(360deg); } }
.hv-disc {
  position: relative; width: 74%; aspect-ratio: 1; border-radius: 50%;
  display: grid; place-items: center; padding: 6%;
  background: var(--hero-disc);
  box-shadow: 0 0 0 1px var(--hero-card-line), 0 40px 90px -36px rgba(var(--accent-rgb), .6);
}
.hv-disc img { width: 100%; height: 100%; object-fit: contain; }

/* up to three highlight photographs */
.hv-photos {
  display: grid; gap: .9rem; text-decoration: none;
  grid-template-columns: 1.35fr 1fr; grid-template-rows: 1fr 1fr;
  height: clamp(20rem, 30vw, 31rem);
}
.hv-photos.n1 { grid-template-columns: 1fr; grid-template-rows: 1fr; }
.hv-photos.n2 { grid-template-rows: 1fr; }
.hv-photo {
  position: relative; margin: 0; overflow: hidden; border-radius: var(--r-lg);
  background: var(--paper-3); box-shadow: var(--sh-2);
}
.hv-photo.p0 { grid-row: 1 / -1; }
.hv-photo img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.hv-photos:hover .hv-photo img { transform: scale(1.03); }
.hv-photo figcaption {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 2rem 1.1rem .9rem;
  color: #fff; font-size: .85rem; font-weight: 600;
  background: linear-gradient(transparent, rgba(5,7,15,.78));
}

/* latest news / research directions, as a card */
.hv-panel {
  background: var(--hero-card); border: 1px solid var(--hero-card-line);
  border-radius: var(--r-xl); padding: 1.7rem 1.8rem 1.2rem;
  box-shadow: var(--hero-card-shadow), 0 30px 70px -40px rgba(var(--accent-rgb), .45);
  backdrop-filter: blur(8px);
}
.hv-panel .eyebrow { margin-bottom: .6rem; }
.hv-item {
  display: block; padding: .95rem 0; text-decoration: none; color: var(--hero-ink);
  border-top: 1px solid var(--hero-card-line);
}
.hv-panel .eyebrow + .hv-item { border-top: 0; }
.hv-item time {
  display: block; font-family: var(--mono); font-size: .72rem; letter-spacing: .06em;
  color: var(--hero-ink-3); margin-bottom: .2rem;
}
.hv-item strong { display: block; font-weight: 600; line-height: 1.35; }
.hv-item:hover strong { color: var(--hero-link); }
.hv-deadline time { color: var(--magenta); }
.hv-area { display: flex; align-items: center; gap: .8rem; }
.hv-area .card-icon { margin: 0; flex: none; }

/* ---- The footer's logo and name ------------------------------------------ */
.footer .footer-brand {
  display: flex; align-items: center; gap: .85rem; margin-bottom: 1.8rem;
  text-decoration: none; color: var(--hero-ink);
}
.footer-brand img { height: 3.4rem; width: auto; max-width: 10rem; object-fit: contain; }
.footer-brand span { font-size: .88rem; line-height: 1.35; color: var(--hero-ink-2); max-width: 28ch; }
.footer-brand strong {
  display: block; font-family: var(--display); font-size: 1.2rem; letter-spacing: calc(-.02em * var(--tight, 1));
  color: var(--hero-ink);
}

/* ---- Live updates: "Updated — refresh" (public/js/site.js, src/live.js) --- */
.live-pill {
  position: fixed; left: 50%; bottom: 1.2rem; transform: translateX(-50%); z-index: 300;
  padding: .65rem 1.2rem; border: 0; border-radius: 999px; cursor: pointer;
  font: 600 .88rem/1 var(--text); color: #fff; background: var(--grad-btn);
  box-shadow: var(--sh-3); animation: live-in .3s var(--ease);
}
.live-pill:hover { filter: brightness(1.08); }
@keyframes live-in { from { opacity: 0; transform: translate(-50%, 1rem); } }
.nav .cta .pip[hidden] { display: none; }

/* "Edit this heading" — shown to the administrator only */
.pagehead .pagehead-edit { display: inline-block; margin-top: .9rem; font-size: .8rem; color: var(--hero-link); opacity: .75; text-decoration: none; border-bottom: 1px dashed currentColor; }
.pagehead .pagehead-edit:hover { opacity: 1; }

/* Publications page: search and filters kept tight above the list */
.pub-filters { margin-bottom: 1.2rem; }
.pub-filters .filterbar { margin-bottom: .55rem; gap: .3rem; }
.pub-filters .chip { padding: .2rem .55rem; font-size: .64rem; }
.pub-search { display: flex; gap: .5rem; max-width: 560px; margin-bottom: .8rem; }
.pub-search input { padding-block: .5rem; }
.filter-gap { width: 1px; align-self: stretch; background: var(--rule); margin: 0 .35rem; }
.pub-shown { font-size: .85rem; margin: .2rem 0 0; }
.pubs-section { padding-top: 2.2rem; }
