/* OneSPIN site. Colours, fonts and text size live in <style id="site-theme"> inside the page
   (the editor's Theme panel changes them). Everything else is here. */

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 76px; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body), Georgia, serif;
  font-size: var(--size);
  line-height: 1.6;
  font-optical-sizing: auto;
}

img, video { max-width: 100%; height: auto; }
main, .hero { overflow-x: clip; }   /* a block moved past the edge never makes the page scroll sideways */
a { color: var(--accent); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

h1, h2, h3, h4 {
  font-family: var(--font-head), "Helvetica Neue", Arial, sans-serif;
  line-height: 1.15;
  margin: 0 0 .5em;
  letter-spacing: -.01em;
}
h1 { font-size: clamp(2.6rem, 1.6rem + 4vw, 5rem); font-weight: 800; font-stretch: 120%; letter-spacing: -.03em; }
h2 { font-size: clamp(2rem, 1.4rem + 2.2vw, 3rem); font-weight: 750; font-stretch: 112%; margin-bottom: .7em; }
h3 { font-size: 1.15rem; font-weight: 700; }
p { margin: 0 0 1em; }

.wrap { width: min(var(--page, 92%), 100% - 2.5rem); max-width: 2000px; margin-inline: auto; }
.prose { max-width: var(--text, 90ch); }
.intro { max-width: var(--text, 90ch); color: color-mix(in srgb, var(--ink) 80%, var(--paper)); }
.small { font-size: .82em; }

/* ---------- buttons ---------- */
.btn, .pill {
  display: inline-block;
  font-family: var(--font-head), sans-serif;
  font-weight: 600;
  font-size: .9rem;
  text-decoration: none;
  border-radius: 999px;
  padding: .6em 1.25em;
  border: 1.5px solid var(--accent);
  background: var(--accent);
  color: #fff;
}
.btn:hover { background: color-mix(in srgb, var(--accent) 85%, #000); }
.btn-ghost { background: transparent; color: var(--accent); }
.btn-ghost:hover { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.pill { background: transparent; border-color: rgba(255,255,255,.55); color: #fff; padding: .45em 1em; font-weight: 500; }
.pill:hover { background: rgba(255,255,255,.14); }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--paper) 94%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid color-mix(in srgb, var(--ink) 10%, transparent);
}
.topbar-in { display: flex; align-items: center; gap: 1.5rem; min-height: 68px; }
.logos { display: flex; align-items: center; gap: 1rem; margin-right: auto; flex: 1 1 auto; min-width: 0; }
.logos img { min-width: 0; max-width: 100%; max-height: 72px; object-fit: contain; object-position: left center; }
.logos img { height: 44px; width: auto; }
.nav { display: flex; gap: .3rem; flex-wrap: nowrap; flex: none; }
.nav a {
  font-family: var(--font-head), sans-serif; font-weight: 600; font-size: .92rem;
  color: var(--ink); text-decoration: none; padding: .45em .75em; border-radius: 6px; white-space: nowrap;
}
.nav a:hover { background: var(--mist); }
.nav a.is-current { color: var(--accent); }
.nav-toggle { display: none; }

/* ---------- hero ---------- */
.hero { position: relative; min-height: min(88vh, 820px); display: flex; align-items: flex-end; color: #fff; overflow: hidden; background: #0b1d25; }
.hero-slides img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  opacity: 0; transition: opacity 1.6s ease;
}
.hero-slides img:first-child { opacity: 1; }
.hero-slides.is-live img { opacity: 0; }
.hero-slides.is-live img.is-active { opacity: 1; }
.hero-shade {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(8,22,29,0) 30%, rgba(8,22,29,.55) 62%, rgba(8,22,29,.9) 100%);
}
.hero-in { position: relative; padding: 0 0 clamp(2.5rem, 6vw, 5rem); }
.hero-title { display: flex; align-items: center; gap: clamp(.8rem, 2vw, 1.6rem); }
.hero h1 {
  font-size: clamp(3.6rem, 2rem + 8vw, 8.5rem);
  font-weight: 800; font-stretch: 125%; letter-spacing: -.035em; line-height: .95; margin: 0;
}
.hero-sub { font-size: clamp(1.15rem, 1rem + .8vw, 1.6rem); max-width: 36ch; margin: 1rem 0 .4rem; line-height: 1.35; }
.hero-pi { font-family: var(--font-head), sans-serif; opacity: .85; font-size: .98rem; margin-bottom: 1.5rem; }
.hero-links { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin: 0; }
/* centred title block (Theme panel → Title block: Centred) */
.hero-in.is-centered { text-align: center; }
.hero-in.is-centered .hero-title { justify-content: center; }
.hero-in.is-centered .hero-sub { margin-inline: auto; }
.hero-in.is-centered .hero-links { justify-content: center; }

/* the precessing spin next to the title (the one animated thing on the page) */
.spin-mark { width: clamp(56px, 2.6rem + 5vw, 128px); height: auto; flex: none; overflow: visible; }
@media (prefers-reduced-motion: reduce) {
  .hero-slides img { transition: none; }
  html { scroll-behavior: auto; }
}

/* ---------- sections ---------- */
.sec { padding: clamp(3rem, 8vw, var(--gap, 7rem)) 0; }
.sec-mist { background: var(--mist); }
.sec-ink { background: var(--ink); color: #fff; }
.sec-ink a { color: #fff; }

/* blocks placed side by side (editor: "Side by side") */
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 2rem 2.5rem; align-items: start; }
.cols > * { min-width: 0; }

/* centred section (editor: click inside a section, then "⇹ Centre section") */
.sec.is-centered h2,
.sec.is-centered .eq-group h3 { text-align: center; }
.sec.is-centered .news,
.sec.is-centered .prose,
.sec.is-centered .intro,
.sec.is-centered .pubs,
.sec.is-centered .contact-list { margin-inline: auto; }
.sec.is-centered .news-more { display: block; margin-inline: auto; }
.sec.is-centered .gallery { display: flex; flex-wrap: wrap; justify-content: center; }
.sec.is-centered .gallery > figure { flex: 0 1 340px; min-width: 240px; }
.sec.is-centered .wide { max-width: 1400px; margin-inline: auto; }

/* about */
.about { display: grid; grid-template-columns: minmax(220px, 300px) 1fr; gap: clamp(2rem, 6vw, 5rem); align-items: start; }
.about-logo { width: 100%; height: auto; border-radius: 6px; }
.facts { margin: 1.5rem 0 0; display: grid; grid-template-columns: auto 1fr; gap: .55rem 1rem; font-size: .92em; }
.facts dt { font-family: var(--font-head), sans-serif; font-weight: 600; color: var(--gold); }
.facts dd { margin: 0; }
.lead { font-family: var(--font-head), sans-serif; font-size: 1.35em; font-weight: 600; }
.about-main h3 { margin-top: 2rem; }
.orcid { font-size: .92em; }
.buttons { display: flex; gap: .7rem; flex-wrap: wrap; margin-top: 1.6rem; }

/* news */
.news { list-style: none; margin: 0; padding: 0; max-width: var(--text, 90ch); }
.news-year {
  font-family: var(--font-head), sans-serif; font-weight: 800; font-stretch: 118%;
  font-size: clamp(2.2rem, 1.6rem + 2vw, 3.2rem); color: var(--gold); line-height: 1;
  padding: 2.4rem 0 1rem; border-bottom: 2px solid var(--gold); margin-bottom: .4rem;
}
.news-year:first-child { padding-top: 0; }
.news-item {
  display: grid; grid-template-columns: 7.2rem 1fr; gap: 1.2rem;
  padding: .95rem 0; border-bottom: 1px solid color-mix(in srgb, var(--ink) 12%, transparent);
}
.news-item time {
  font-family: var(--font-head), sans-serif; font-weight: 600; font-size: .88rem;
  font-variant-numeric: tabular-nums; color: color-mix(in srgb, var(--ink) 70%, var(--paper)); padding-top: .25em;
}
.news-text img { display: inline-block; vertical-align: middle; border-radius: 4px; }
.news.is-folded .is-old { display: none; }
.news-more { margin-top: 1.6rem; cursor: pointer; }

/* team */
.team-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 2.2rem 2.5rem; margin: 2.5rem 0 3.5rem; }
.team-group h3 { color: var(--gold); padding-bottom: .5rem; border-bottom: 2px solid var(--gold); }
.people { list-style: none; margin: 0; padding: 0; }
.people li {
  display: grid; grid-template-columns: auto 1fr; column-gap: .9rem; align-items: center;
  padding: .6rem 0; border-bottom: 1px solid color-mix(in srgb, var(--ink) 10%, transparent);
}
.people li > :not(.avatar) { grid-column: 2; }
.avatar {
  grid-column: 1; grid-row: 1 / span 2;
  width: 54px; height: 54px; border-radius: 50%; object-fit: cover; display: grid; place-items: center;
  background: var(--mist); color: var(--gold); font-family: var(--font-head), sans-serif; font-weight: 700; font-size: .95rem;
  box-shadow: 0 0 0 2px var(--paper), 0 0 0 3px color-mix(in srgb, var(--gold) 55%, transparent);
}
.people .name { display: block; font-family: var(--font-head), sans-serif; font-weight: 600; }
.people a.name { text-decoration: none; }
.people a.name:hover { text-decoration: underline; }
.people .role { display: block; font-size: .9em; color: color-mix(in srgb, var(--ink) 75%, var(--paper)); }

/* figures & galleries */
figure { margin: 0; }
figcaption { font-size: .86em; color: color-mix(in srgb, var(--ink) 72%, var(--paper)); margin-top: .6rem; line-height: 1.45; }
.wide { margin: 2.5rem 0; }
.wide img { width: 100%; border-radius: 8px; display: block; }
.eq-group { margin-top: 3.5rem; }
.eq-group h3 { font-size: 1.35rem; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1.8rem 1.5rem; }
.gallery img, .gallery video {
  display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 6px; background: #0b1d25;
}
.gallery img { cursor: zoom-in; }

/* publications */
.pubs { margin: 2rem 0 0; padding: 0; list-style: none; max-width: var(--text, 90ch); counter-reset: pub; }
.pubs li { padding: 1.1rem 0; border-bottom: 1px solid color-mix(in srgb, var(--ink) 12%, transparent); }
.pub-title { display: block; font-family: var(--font-head), sans-serif; font-weight: 600; font-size: 1.08em; color: var(--ink); text-decoration: none; line-height: 1.35; }
.pub-title:hover { color: var(--accent); text-decoration: underline; }
.pub-venue { display: block; font-style: italic; margin-top: .25rem; color: color-mix(in srgb, var(--ink) 72%, var(--paper)); }

/* contact */
.contact-list { display: grid; grid-template-columns: 9rem 1fr; gap: 1rem 1.5rem; margin: 1rem 0 0; max-width: 760px; }
.contact-list dt { font-family: var(--font-head), sans-serif; font-weight: 600; color: color-mix(in srgb, var(--gold) 70%, #fff); }
.contact-list dd { margin: 0; }

/* footer */
.footer { padding: 2.5rem 0 3rem; background: color-mix(in srgb, var(--ink) 92%, #000); color: rgba(255,255,255,.8); }
.footer-in { display: flex; gap: 2rem; align-items: flex-start; }
.footer-in img { height: 64px; width: auto; background: #fff; padding: 6px; border-radius: 4px; flex: none; }
.footer p { margin: 0 0 .5rem; }
.footer p:first-child { font-family: var(--font-head), sans-serif; font-weight: 600; color: #fff; }

/* lightbox */
.lightbox { position: fixed; inset: 0; z-index: 100; background: rgba(6,16,21,.94); display: none; flex-direction: column; align-items: center; justify-content: center; padding: 3.5rem 4.5rem 2rem; color: #fff; }
.lightbox.is-open { display: flex; }
.lightbox img, .lightbox video { max-width: 100%; max-height: calc(100vh - 10rem); object-fit: contain; border-radius: 4px; }
.lightbox p { max-width: 70ch; text-align: center; margin: 1rem 0 0; font-size: .95rem; color: rgba(255,255,255,.85); }
.lightbox button {
  position: absolute; background: rgba(255,255,255,.1); color: #fff; border: 0; border-radius: 999px;
  width: 46px; height: 46px; font-size: 1.4rem; cursor: pointer;
}
.lightbox button:hover { background: rgba(255,255,255,.22); }
.lb-close { top: 1rem; right: 1rem; }
.lb-prev { left: 1rem; top: 50%; }
.lb-next { right: 1rem; top: 50%; }

/* ---------- small screens ---------- */
@media (max-width: 860px) {
  .nav-toggle {
    display: block; font: 600 .9rem var(--font-head), sans-serif; color: var(--ink);
    background: var(--mist); border: 0; border-radius: 6px; padding: .55em 1em; cursor: pointer;
  }
  .nav { display: none; flex-wrap: wrap; position: absolute; left: 0; right: 0; top: 100%; background: var(--paper); flex-direction: column; padding: .5rem 1.25rem 1rem; border-bottom: 1px solid color-mix(in srgb, var(--ink) 12%, transparent); }
  .nav.is-open { display: flex; }
  .logos img { height: 36px; }
  .about { grid-template-columns: 1fr; }
  .about-side { display: grid; grid-template-columns: minmax(110px, 200px) 1fr; gap: 1.5rem; align-items: center; }
  .facts { margin: 0; }
  /* blocks moved or resized freely in the editor go back to the normal layout on small screens */
  [data-free] { position: static !important; left: auto !important; top: auto !important; }
  [data-free]:not(.avatar):not(svg) { width: auto !important; max-width: 100% !important; }
  /* justified text spreads words apart on narrow screens */
  [style*="justify"] { text-align: left !important; }
  .hero-in.is-centered [style*="justify"] { text-align: center !important; }
  /* widths set in the editor only apply on large screens */
  [data-w] { max-width: none !important; margin-left: 0 !important; margin-right: 0 !important; }
  img[data-w], video[data-w] { min-width: min(100%, 280px); }
  .news-item { grid-template-columns: 1fr; gap: .2rem; }
  .contact-list { grid-template-columns: 1fr; gap: .2rem; }
  .contact-list dd { margin-bottom: .8rem; }
  .footer-in { flex-direction: column; }
  .lightbox { padding: 3.5rem 1rem 1.5rem; }
  .lb-prev, .lb-next { top: auto; bottom: 1rem; }
}
