/* Self-hosted fonts: the site makes no requests to third-party servers (GDPR-friendly). */
@font-face {
  font-family: "Bricolage Grotesque";
  src: url("fonts/bricolage-grotesque.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
}
@font-face {
  font-family: "Source Serif 4";
  src: url("fonts/source-serif-4.woff2") format("woff2");
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Source Serif 4";
  src: url("fonts/source-serif-4-italic.woff2") format("woff2");
  font-weight: 200 900;
  font-style: italic;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --night: #12142e;
  --night-2: #171a3b;
  --line: #2c3062;
  --ink: #eceaf7;
  --muted: #a3a5cb;
  --radical: #e58cff;
  --heat: #ffb46a;
  --bond: #8b93d6;
  --paper: #e9e6f5;
  --paper-ink: #16183a;
  --paper-muted: #4d5082;
  --paper-accent: #2a2e6e;

  --display: "Bricolage Grotesque", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --text: "Source Serif 4", "Iowan Old Style", Georgia, serif;

  --gutter: clamp(16px, 4vw, 40px);
  --wide: 72rem;
  --measure: 38rem;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--night);
  color: var(--ink);
  font-family: var(--text);
  font-size: 1.125rem;
  line-height: 1.65;
  font-optical-sizing: auto;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration-color: color-mix(in srgb, var(--radical) 55%, transparent); text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
a:hover { text-decoration-color: var(--radical); text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--radical); outline-offset: 3px; border-radius: 3px; }

h1, h2, h3 { font-family: var(--display); font-weight: 650; line-height: 1.1; margin: 0; letter-spacing: -0.015em; }
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

.wrap { width: 100%; max-width: var(--wide); margin: 0 auto; padding: 0 var(--gutter); }

.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--night); padding: 8px 14px; border-radius: 6px; z-index: 100; font-family: var(--display); }
.skip:focus { left: 8px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--night) 82%, transparent);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
}
.site-header .wrap { display: flex; align-items: center; gap: 24px; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--display); font-weight: 600; font-size: 1rem; letter-spacing: -0.01em; white-space: nowrap; }
.brand svg { flex: none; }
.nav { display: flex; gap: 22px; margin-left: auto; font-family: var(--display); font-size: 0.9375rem; }
.nav a { text-decoration: none; color: var(--muted); }
.nav a:hover { color: var(--ink); }
.lang {
  margin-left: 8px;
  font: 600 0.8125rem/1 var(--display);
  color: var(--ink); background: transparent;
  border: 1px solid var(--line); border-radius: 999px;
  padding: 7px 12px; cursor: pointer;
}
.lang:hover { border-color: var(--muted); }
@media (max-width: 760px) {
  .nav { display: none; }
  .lang { margin-left: auto; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: min(calc(100svh - 60px), 860px);
  display: flex; align-items: flex-end;
  overflow: hidden;
  isolation: isolate;
  touch-action: pan-y;
}
@supports not (height: 100svh) { .hero { min-height: min(calc(100vh - 60px), 860px); } }
.hero canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -2; display: block; }
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    linear-gradient(to top, var(--night) 0%, color-mix(in srgb, var(--night) 80%, transparent) 28%, transparent 62%),
    linear-gradient(to right, color-mix(in srgb, var(--night) 70%, transparent) 0%, transparent 55%);
}
.hero-content { padding-top: 120px; padding-bottom: clamp(40px, 8vh, 88px); }
.hero h1 {
  font-size: clamp(3.25rem, 10.5vw, 8.5rem);
  font-weight: 760;
  letter-spacing: -0.04em;
  line-height: 0.92;
  font-variation-settings: "opsz" 96;
  margin-bottom: 28px;
}
.hero h1 span { display: block; }
.role { font-family: var(--display); font-size: clamp(1.0625rem, 1.6vw, 1.3125rem); color: var(--muted); margin-bottom: 14px; max-width: 34rem; line-height: 1.4; }
.lead { font-size: clamp(1.1875rem, 1.9vw, 1.5rem); line-height: 1.45; max-width: 36rem; margin-bottom: 32px; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 28px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font: 600 1rem/1 var(--display);
  padding: 14px 20px; border-radius: 10px; text-decoration: none;
  border: 1px solid var(--line); color: var(--ink); background: color-mix(in srgb, var(--night-2) 70%, transparent);
}
.btn:hover { border-color: var(--muted); }
.btn-primary { background: var(--radical); border-color: var(--radical); color: #1a0f2e; }
.btn-primary:hover { background: #eea6ff; border-color: #eea6ff; }
.hint { font-size: 0.9375rem; color: var(--muted); max-width: 34rem; line-height: 1.5; display: flex; gap: 10px; align-items: baseline; }
.hint::before { content: ""; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--radical); box-shadow: 0 0 10px 2px color-mix(in srgb, var(--radical) 60%, transparent); transform: translateY(-1px); }
.hint .touch { display: none; }
@media (hover: none) { .hint .mouse { display: none; } .hint .touch { display: inline; } }

/* ---------- Sections ---------- */
section { padding: clamp(72px, 11vw, 128px) 0; scroll-margin-top: 60px; }
section + section { border-top: 1px solid var(--line); }
.section-head { margin-bottom: clamp(32px, 5vw, 56px); max-width: var(--measure); }
.section-head h2 { font-size: clamp(2rem, 4.2vw, 3rem); letter-spacing: -0.025em; margin-bottom: 14px; }
.section-head p { color: var(--muted); }

/* About */
.about-grid { display: grid; gap: 48px; }
@media (min-width: 700px) {
  .about-grid { grid-template-columns: 16rem minmax(0, 1fr); gap: 40px 48px; align-items: start; }
  .about-text { grid-column: 1 / -1; }
}
@media (min-width: 1100px) {
  .about-grid { grid-template-columns: minmax(0, 1fr) 16.5rem 15rem; gap: 56px; }
  .about-text { grid-column: auto; }
}
.about-text { max-width: var(--measure); }
.facts { margin: 0; display: grid; gap: 22px; align-content: start; font-size: 1rem; }
.facts dt { font-family: var(--display); color: var(--muted); font-size: 0.875rem; margin-bottom: 2px; }
.facts dd { margin: 0; line-height: 1.45; }

/* Research */
.themes { list-style: none; margin: 0; padding: 0; }
.theme {
  display: grid; gap: 14px 40px;
  padding: 32px 0; border-top: 1px solid var(--line);
}
.theme:last-child { border-bottom: 1px solid var(--line); }
@media (min-width: 760px) { .theme { grid-template-columns: 96px minmax(0, 18rem) minmax(0, 1fr); align-items: start; } }
.theme svg { width: 80px; height: 50px; }
.theme h3 { font-size: 1.375rem; line-height: 1.25; }
.theme p { max-width: var(--measure); }

/* Publications: expandable list; selecting a paper shows its abstract */
.pubs-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.pub { border-bottom: 1px solid var(--line); }
.pub-d > summary {
  list-style: none; cursor: pointer;
  display: grid; grid-template-columns: 4.5rem minmax(0, 1fr) auto auto; gap: 6px 28px; align-items: center;
  padding: 26px 12px; margin: 0 -12px; border-radius: 12px;
  transition: background-color .2s ease;
}
.pub-d > summary::-webkit-details-marker { display: none; }
.pub-d > summary:hover { background: color-mix(in srgb, var(--night-2) 85%, transparent); }
.pub-d > summary:focus-visible { outline-offset: -2px; }
.pub-year { font-family: var(--display); font-weight: 600; font-size: 1.125rem; color: var(--muted); align-self: start; line-height: 1.5; }
.pub-head { display: block; min-width: 0; }
.pub-title { font-size: 1.25rem; font-weight: 600; line-height: 1.3; letter-spacing: -0.01em; margin-bottom: 8px; }
.pub-cite { display: block; font-size: 1rem; line-height: 1.55; color: var(--muted); }
.pub-cite u { text-underline-offset: 0.18em; text-decoration-thickness: 1px; color: var(--ink); }
.pub-cite i, .pub-cite b { color: var(--ink); }
.pub-cite sup, .pubs-foot sup { font-size: 0.7em; line-height: 0; }
.pub-thumb {
  width: 124px; height: 86px; border-radius: 8px; background: #fff; overflow: hidden;
  display: grid; place-items: center; padding: 6px;
  transition: opacity .25s ease, transform .25s ease;
}
.pub-thumb img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
.pub-d[open] .pub-thumb { opacity: 0; transform: scale(.92); }
.pub-thumb.is-empty { visibility: hidden; }
.pub-toggle svg { width: 30px; height: 30px; display: block; overflow: visible; }
.pub-toggle .hx { fill: none; stroke: var(--muted); stroke-width: 1.6; stroke-linejoin: round; transform-origin: 14px 14px; transition: transform .35s ease, stroke .25s ease; }
.pub-toggle .dot { fill: transparent; stroke: var(--muted); stroke-width: 1.4; transition: fill .25s ease, stroke .25s ease, filter .25s ease; }
.pub-d > summary:hover .hx { stroke: var(--ink); }
.pub-d[open] .hx { stroke: var(--ink); transform: rotate(30deg); }
.pub-d[open] .dot { fill: var(--radical); stroke: var(--radical); filter: drop-shadow(0 0 5px var(--radical)); }

.pub-body { display: grid; gap: 28px 48px; padding: 6px 0 44px calc(4.5rem + 28px); animation: pub-in .35s ease both; }
@media (min-width: 960px) { .pub-body.has-fig { grid-template-columns: minmax(0, 1fr) minmax(0, 25rem); } }
@keyframes pub-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.pub-label { font-family: var(--display); font-weight: 600; font-size: 0.9375rem; color: var(--muted); margin-bottom: 8px; }
.pub-abs p { max-width: var(--measure); font-size: 1.0625rem; }
.pub-abs .pub-credit { margin-top: 18px; font-size: 0.8125rem; color: var(--muted); }
.pub-fig { margin: 0; align-self: start; background: #fff; border-radius: 12px; padding: 14px; }
.pub-fig img { display: block; width: 100%; height: auto; }

@media (max-width: 760px) {
  .pub-d > summary { grid-template-columns: minmax(0, 1fr) auto; gap: 6px 16px; }
  .pub-year { grid-column: 1 / -1; }
  .pub-thumb { display: none; }
  .pub-body { padding-left: 0; }
}
@media (prefers-reduced-motion: reduce) { .pub-body { animation: none; } }

.pubs-foot { padding-top: 28px; color: var(--muted); font-size: 1rem; display: grid; gap: 6px; }

/* Pill button: a liquid fills it from the bottom on hover */
.btn-fill {
  --c: var(--radical); --on: #1a0f2e;
  position: relative; isolation: isolate; overflow: hidden;
  display: inline-flex; align-items: center; gap: 8px;
  margin-top: 10px; padding: 13px 22px;
  border: 1.5px solid var(--c); border-radius: 999px;
  color: var(--c); font: 600 1rem/1 var(--display); text-decoration: none;
  transition: color .25s ease .1s;
}
.btn-fill::before {
  content: ""; position: absolute; z-index: -1;
  left: -15%; width: 130%; height: 260%; top: 108%;
  background: var(--c); border-radius: 45% 50% 0 0 / 22% 26% 0 0;
  transition: top .55s cubic-bezier(.3, .7, .3, 1);
}
.btn-fill:hover, .btn-fill:focus-visible { color: var(--on); }
.btn-fill:hover::before, .btn-fill:focus-visible::before { top: -40%; }
.btn-fill:focus-visible { outline-offset: 4px; }
@media (prefers-reduced-motion: reduce) { .btn-fill::before { transition: none; } }

/* Methods */
.methods { margin: 0; display: grid; gap: 0; max-width: 56rem; }
.methods > div { display: grid; gap: 4px 40px; padding: 20px 0; border-top: 1px solid var(--line); }
.methods > div:last-child { border-bottom: 1px solid var(--line); }
@media (min-width: 760px) { .methods > div { grid-template-columns: 14rem minmax(0, 1fr); } }
.methods dt { font-family: var(--display); font-weight: 600; }
.methods dd { margin: 0; color: var(--muted); }

/* Contact */
.contact p { max-width: var(--measure); }
.mail {
  display: inline-block; margin: 20px 0 40px;
  font-family: var(--display); font-weight: 650; letter-spacing: -0.02em;
  font-size: clamp(1.5rem, 5vw, 3rem); line-height: 1.15;
  text-decoration: none; overflow-wrap: anywhere;
  background-image: linear-gradient(var(--radical), var(--radical));
  background-size: 100% 2px; background-position: 0 100%; background-repeat: no-repeat;
  padding-bottom: 4px;
}
.mail:hover { color: var(--radical); }
.profiles { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 12px; }
.profiles a { display: inline-block; font: 600 1rem/1 var(--display); padding: 13px 18px; border: 1px solid var(--line); border-radius: 10px; text-decoration: none; }
.profiles a:hover { border-color: var(--muted); }
/* Profile links still pointing at a placeholder stay hidden until a real URL is filled in. */
.profiles li:has(a[href*="DEIN-"]) { display: none; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: 32px 0 48px; color: var(--muted); font-size: 0.9375rem; }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; }

/* About: text, portrait and facts side by side, top-aligned */
.portrait {
  display: block; width: 100%; max-width: 16.5rem; height: auto; aspect-ratio: 5 / 6; object-fit: cover;
  border-radius: 14px; box-shadow: 0 0 0 1px var(--line);
}

/* Artwork gallery */
.gallery-track {
  display: grid; grid-auto-flow: column; grid-auto-columns: 100%;
  overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
  overscroll-behavior-x: contain;
}
.gallery-track::-webkit-scrollbar { display: none; }
.art { margin: 0; scroll-snap-align: start; display: grid; gap: 32px 64px; align-items: center; }
@media (min-width: 860px) { .art { grid-template-columns: minmax(0, 27rem) minmax(0, 1fr); } }
.art-img { max-width: 27rem; }
.art-img img { display: block; width: 100%; height: auto; }
.art-img.round img {
  border-radius: 50%;
  box-shadow: 0 0 0 1px var(--line);
}
.art figcaption { display: grid; gap: 10px; max-width: 30rem; }
.art-title { font-family: var(--display); font-weight: 650; font-size: clamp(1.5rem, 2.6vw, 2rem); letter-spacing: -0.02em; line-height: 1.15; }
.art-ref { font-size: 1.0625rem; color: var(--muted); }
.art-ref a { text-decoration-color: color-mix(in srgb, var(--radical) 55%, transparent); }
.art-ref i, .art-ref b { color: var(--ink); }
.art-credit { font-size: 0.8125rem; color: var(--muted); }
.gallery-nav { display: flex; align-items: center; gap: 16px; margin-top: 32px; }
.gallery-nav[hidden] { display: none; }
.gal-btn { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: transparent; color: var(--ink); display: grid; place-items: center; cursor: pointer; }
.gal-btn:hover { border-color: var(--muted); }
.gal-btn svg { width: 20px; height: 20px; }
.gal-btn.next svg { transform: scaleX(-1); }
.gal-dots { display: flex; gap: 8px; }
.gal-dot { width: 8px; height: 8px; padding: 0; border-radius: 50%; border: 0; background: var(--line); cursor: pointer; }
.gal-dot[aria-current="true"] { background: var(--radical); box-shadow: 0 0 8px var(--radical); }

/* Teaser linking to the Molecule Hall of Fame */
.hof-teaser {
  margin-top: 40px; display: grid; grid-template-columns: 112px minmax(0, 1fr) auto; gap: 16px 28px; align-items: center;
  padding: 16px 24px 16px 16px; border: 1px solid var(--line); border-radius: 18px; text-decoration: none;
  background: radial-gradient(ellipse 60% 120% at 0% 50%, color-mix(in srgb, var(--radical) 14%, transparent), transparent 70%), var(--night-2);
  transition: border-color .25s ease;
}
.hof-teaser:hover, .hof-teaser:focus-visible { border-color: color-mix(in srgb, var(--radical) 60%, transparent); }
.hof-teaser img { width: 112px; height: 112px; border-radius: 12px; object-fit: cover; display: block; }
.hof-text { display: grid; gap: 4px; }
.hof-title { font-family: var(--display); font-weight: 650; font-size: 1.375rem; letter-spacing: -0.015em; }
.hof-sub { color: var(--muted); font-size: 1rem; }
.hof-teaser .btn-fill { margin-top: 0; }
.hof-teaser:hover .btn-fill, .hof-teaser:focus-visible .btn-fill { color: var(--on); }
.hof-teaser:hover .btn-fill::before, .hof-teaser:focus-visible .btn-fill::before { top: -40%; }
@media (max-width: 700px) {
  .hof-teaser { grid-template-columns: 88px minmax(0, 1fr); }
  .hof-teaser img { width: 88px; height: 88px; }
  .hof-teaser .btn-fill { grid-column: 1 / -1; justify-self: start; }
}
