/* ============================================================
   CLAB · Computational Comparative Cognition Lab
   ============================================================ */

/* Inter is self-hosted so no visitor data goes to Google Fonts (licence: assets/fonts/OFL.txt) */
@font-face {
  font-family: 'Inter'; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url('../fonts/inter-latin-wght-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter'; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url('../fonts/inter-latin-ext-wght-normal.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* Aleo (titles) and IBM Plex Mono (instructions only), both self-hosted
   (licences: assets/fonts/OFL-Aleo.txt, assets/fonts/OFL-IBM-Plex-Mono.txt) */
@font-face {
  font-family: 'Aleo'; font-style: normal; font-weight: 100 900; font-display: swap; size-adjust: 91%; /* letters as tall as the old title font (Fraunces) */
  src: url('../fonts/aleo-latin-wght-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Aleo'; font-style: normal; font-weight: 100 900; font-display: swap; size-adjust: 91%; /* letters as tall as the old title font (Fraunces) */
  src: url('../fonts/aleo-latin-ext-wght-normal.woff2') format('woff2');
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 400; font-display: swap;
  src: url('../fonts/ibm-plex-mono-latin-400-normal.woff2') format('woff2');
}

:root {
  /* Solarpunk palette: greens for nature, greys and violet for computation */
  --ink: #1b2b24;
  --ink-soft: #5a616a;
  --muted: #61686f;
  --line: #dce3d7;
  --bg: #f7f8f3;          /* Paper */
  --bg-alt: #e4ecdf;      /* Lichen */
  --accent: #043e29;      /* the logo's green */
  --accent-bright: #3f6b4e; /* Moss */
  --moss: #3f6b4e;
  --violet: #6b5ba6;
  --slate: #6d747e;
  --f-head: 'Aleo', Rockwell, Georgia, serif;
  --f-mono: 'IBM Plex Mono', ui-monospace, Consolas, monospace;
  --radius: 16px;
  --maxw: 1160px;
  --header-h: 72px;
  --ease: cubic-bezier(.16, 1, .3, 1);
}

* { box-sizing: border-box; }

html { scroll-padding-top: var(--header-h); } /* menu links jump straight to their section */
html { -webkit-tap-highlight-color: transparent; } /* phones: no grey box flashing over what is tapped */

body {
  margin: 0;
  font-family: 'Inter', system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.narrow { max-width: 760px; }

/* ============ HEADER ============ */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(247,248,243,.86);
  backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s var(--ease), box-shadow .3s var(--ease);
}
.site-header.scrolled {
  border-bottom-color: var(--line);
  box-shadow: 0 4px 24px rgba(8,38,26,.04);
}
.header-inner {
  height: var(--header-h);
  display: flex; align-items: center; justify-content: space-between;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; }
.brand-logo { height: 52px; width: auto; }
.brand-logo--green { height: 44px; }
/* Main page: the Max Planck logos sit in the bar, the lab logo sits above the title */
.brand--mpi { gap: 14px; }
.brand--mpi img { height: 42px; width: auto; }
@media (max-width: 420px) { .brand--mpi { gap: 8px; } .brand--mpi img { height: 34px; } }

.main-nav { display: flex; align-items: center; gap: 28px; }
.main-nav > a {
  font-size: .95rem; font-weight: 500; color: var(--ink-soft);
  position: relative; transition: color .2s var(--ease);
}
.main-nav > a:hover { color: var(--ink); }
.main-nav > a::after {
  content: ""; position: absolute; left: 0; bottom: -6px; height: 2px; width: 0;
  background: var(--accent-bright);
}
.main-nav > a:hover::after { width: 100%; }

.nav-cta {
  background: var(--accent); color: #fff !important;
  padding: 9px 18px; border-radius: 999px;
}
.nav-cta::after { display: none; }
.nav-cta:hover { background: var(--accent-bright); }

.lang-toggle { display: flex; gap: 2px; border: 1px solid var(--line); border-radius: 999px; padding: 2px; }
.lang-btn {
  border: 0; background: transparent; cursor: pointer;
  font: inherit; font-size: .8rem; font-weight: 600; color: var(--muted);
  padding: 4px 10px; border-radius: 999px; transition: .2s var(--ease);
}
.lang-btn.is-active { background: var(--ink); color: #fff; }

.nav-toggle {
  display: none; flex-direction: column; gap: 5px;
  background: none; border: 0; cursor: pointer; padding: 8px;
}
.nav-toggle span { width: 24px; height: 2px; background: var(--ink); transition: .3s var(--ease); }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ============ HERO (network + footprints, solarpunk) ============ */
.hero {
  position: relative; overflow: hidden;
  height: calc(100svh - var(--header-h)); min-height: 600px;
  background:
    radial-gradient(70% 60% at 92% -8%, rgba(226,179,60,.20), transparent 60%),
    radial-gradient(60% 55% at 0% 0%, rgba(169,196,162,.30), transparent 65%),
    var(--bg);
}
.hero::before { /* fine grain, like printed paper (made in place, no image file) */
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none; opacity: .32;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .12 0 0 0 0 .18 0 0 0 0 .14 0 0 0 .5 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.hero-tracks { position: absolute; inset: 0; z-index: 0; width: 100%; height: 100%; pointer-events: none; }
.hero-net { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; touch-action: pan-y; cursor: pointer; }
.hero-inner { position: relative; z-index: 2; padding-top: clamp(28px, 7vh, 90px); pointer-events: none; }
@media (min-width: 900px) { .hero-inner { padding-top: clamp(34px, 8.4vh, 108px); } } /* wide screens: 20% more room on top (the hero height is set by main.js) */
/* The logo sits centred over the widest title line ("Computational") */
.hero-head { display: flex; flex-direction: column; width: fit-content; }
.hero-logo { align-self: center; width: clamp(100px, 16vh, 156px); height: auto; margin-bottom: clamp(14px, 2.6vh, 26px); }
.hero-title {
  margin: 0; font-family: var(--f-head); font-optical-sizing: auto;
  font-size: clamp(2.5rem, 5.95vw, 5.18rem); line-height: 1.02; font-weight: 600; letter-spacing: -.01em;
  /* on large screens 4% smaller than before: at big sizes the old font (Fraunces) was narrower */
}
.hero-title .w-comp { color: var(--violet); }
.hero-title .w-compar { color: var(--moss); }
.hero-title .w-cog { color: var(--accent); }
.hero-tagline { margin: 22px 0 0; font-size: clamp(1.05rem, 1.6vw, 1.3rem); color: var(--ink-soft); white-space: nowrap; }
@media (max-width: 700px) { .hero-tagline { white-space: normal; max-width: 34ch; } } /* one line does not fit on phones */
@media (max-width: 899px) { /* narrow screens: everything centred, the network centred below */
  .hero-inner { text-align: center; }
  .hero-head { margin-inline: auto; }
  .hero-tagline { margin-inline: auto; }
}
/* The hint sits right under the network (placed by main.js) */
.hero-hint {
  position: absolute; z-index: 2; left: 50%; top: 0; transform: translateX(-50%); margin: 0;
  display: flex; align-items: center; gap: 10px; white-space: nowrap; pointer-events: none;
  font-family: var(--f-mono); font-size: .78rem; letter-spacing: .04em; color: var(--ink-soft);
}
.hero-hint[hidden] { display: none; }
.hint-text { display: flex; align-items: center; gap: 10px; margin: 0; }
.hint-info {
  pointer-events: auto; flex: none; display: grid; place-items: center; width: 22px; height: 22px; padding: 0;
  border-radius: 50%; border: 1.5px solid var(--slate); background: rgba(247,248,243,.9); color: var(--ink-soft);
  font: 600 .8rem/1 'Inter', system-ui, sans-serif; cursor: pointer; transition: border-color .2s var(--ease), color .2s var(--ease);
}
.hint-info:hover, .hint-info[aria-expanded="true"] { border-color: var(--violet); color: var(--violet); }
.hint-info:focus-visible { outline: 2px solid var(--violet); outline-offset: 2px; }
.hint-note {
  position: absolute; top: calc(100% + 10px); right: 0; margin: 0; padding: 9px 14px; pointer-events: auto;
  border-radius: 12px; background: var(--bg); border: 1px solid var(--line); box-shadow: 0 10px 28px -12px rgba(8,38,26,.35);
  font-family: 'Inter', system-ui, sans-serif; font-size: .9rem; letter-spacing: 0; color: var(--ink); white-space: nowrap;
}
.hint-note[hidden] { display: none; }
@media (max-width: 899px) { /* the hint is centred here: centre the note under it, and let it wrap if needed */
  .hint-note { right: auto; left: 50%; transform: translateX(-50%); width: max-content; max-width: calc(100vw - 32px); white-space: normal; text-align: center; }
}
.hero-hint.note-up .hint-note { top: auto; bottom: calc(100% + 10px); }
.hint-note a { color: var(--violet); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.hero-hint i { flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--violet); box-shadow: 0 0 0 4px rgba(107,91,166,.18), 0 0 12px 2px rgba(184,174,219,.8); }
.hint-touch { display: none; }
@media (hover: none) { .hint-mouse { display: none; } .hint-touch { display: inline; } }

/* Footprints fade in when stepped on, then slowly fade away; "still" ones wait */
.fp { opacity: 0; animation: fp-fade 10s linear forwards; }
.fp.still { opacity: var(--o); animation: none; }
@keyframes fp-fade { 0% { opacity: 0; } 3% { opacity: var(--o); } 50% { opacity: var(--o); } 100% { opacity: 0; } }
.fp.gone { opacity: var(--o); animation: fp-out 9s linear forwards; }
@keyframes fp-out { from { opacity: var(--o); } to { opacity: 0; } }
/* The bird's trail down the page margin */
.page-trail { position: absolute; top: 0; left: 0; width: 100%; height: 0; z-index: 3; pointer-events: none; overflow: hidden; }

/* ============ GENERIC SECTION ============ */
.section { padding: clamp(32px, 5vw, 65px) 0; }
.research, .news, .join { background: var(--bg-alt); }
.team, .resources { background: var(--bg); }

/* ============ WHERE TO FIND US (image footer: address + map + legal) ============ */
.findus { position: relative; overflow: hidden; background: var(--ink); }
.findus-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0; }
.findus::after {
  content: ""; position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(to bottom, rgba(8,38,26,.55), rgba(8,38,26,.35) 35%, rgba(8,38,26,.8));
}
.findus-content {
  position: relative; z-index: 2; max-width: var(--maxw); margin: 0 auto; color: #fff;
  padding: clamp(30px, 5vw, 60px) 24px clamp(20px, 3vw, 32px);
  display: flex; flex-direction: column; gap: clamp(22px, 4vw, 38px);
}
.findus-title {
  margin: 0; text-align: center; font-weight: 800; letter-spacing: -.02em;
  font-size: clamp(2rem, 4.5vw, 3.2rem); text-shadow: 0 2px 18px rgba(0,0,0,.35);
}
.findus-cols {
  display: flex; align-items: center; justify-content: space-between;
  gap: clamp(24px, 4vw, 56px); flex-wrap: wrap;
}
.findus-address { flex: 1 1 320px; text-shadow: 0 1px 12px rgba(0,0,0,.5); }
.findus-address p { margin: 0 0 16px; line-height: 1.6; font-size: clamp(.92rem, 1.3vw, 1.05rem); color: rgba(255,255,255,.92); }
.findus-address strong { display: inline-block; margin-bottom: 2px; font-size: clamp(1.05rem, 1.6vw, 1.3rem); font-weight: 800; color: #fff; }
.findus-bsky {
  display: inline-flex; align-items: center; justify-content: center; width: 46px; height: 46px;
  border-radius: 50%; background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.4); color: #fff;
  transition: background .25s var(--ease), transform .25s var(--ease);
}
.findus-bsky:hover { background: rgba(255,255,255,.32); transform: translateY(-2px); }
.findus-bsky svg { width: 22px; height: 22px; }
.findus-map {
  position: relative; flex: 0 0 auto; display: block;
  width: clamp(260px, 34vw, 400px); height: clamp(190px, 22vw, 250px);
  border-radius: 14px; overflow: hidden; border: 3px solid #fff; box-shadow: 0 16px 40px rgba(8,38,26,.4);
}
.findus-map { background: var(--bg-alt); }
.findus-map iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.map-consent {
  position: absolute; inset: 0; padding: 14px 18px 56px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  text-align: center; color: var(--ink-soft);
}
.map-consent[hidden] { display: none; }
.map-consent p { margin: 0; max-width: 300px; font-size: .78rem; line-height: 1.4; }
.map-consent a { color: var(--accent); text-decoration: underline; }
.map-load {
  border: 0; cursor: pointer; font: inherit; font-weight: 600; font-size: .92rem;
  padding: 9px 22px; border-radius: 999px; background: var(--ink); color: #fff;
  transition: background .25s var(--ease);
}
.map-load:hover { background: var(--accent-bright); }
.findus-cta {
  position: absolute; right: 10px; bottom: 10px;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 13px; border-radius: 999px;
  background: var(--accent); color: #fff; font-weight: 600; font-size: .82rem;
  box-shadow: 0 6px 18px rgba(8,38,26,.3); transition: background .25s var(--ease);
}
.findus-cta:hover { background: var(--accent-bright); }
.findus-legal {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px;
  padding-top: 16px; border-top: 1px solid rgba(255,255,255,.22);
  font-size: .82rem; color: rgba(255,255,255,.8);
}
.findus-legal a { color: rgba(255,255,255,.8); }
.findus-legal a:hover { color: #fff; text-decoration: underline; }
@media (max-width: 700px) {
  .findus-cols { flex-direction: column; align-items: stretch; }
  .findus-map { width: 100%; height: clamp(180px, 50vw, 240px); }
}

.section-title {
  font-size: clamp(1.9rem, 4vw, 3rem); font-weight: 800; letter-spacing: -.02em; color: var(--accent); /* the logo green, as in "Cognition Lab" */
  margin: 0 0 14px;
}
.section-sub { font-size: 1.1rem; color: var(--muted); margin: 0; }
.section-head { margin-bottom: 56px; }
.lead { font-size: clamp(1.1rem, 2vw, 1.4rem); color: var(--ink-soft); }
.muted { color: var(--muted); font-weight: 600; }

/* ============ RESEARCH (a menu on the left; What, Where or How on the right) ============ */
/* Captionless sections: pull content up right under the title */
.team .section-head, .news .section-head, .research .section-head { margin-bottom: 16px; }
.team .section-title, .news .section-title, .research .section-title { margin-bottom: 0; }

.rs {
  display: grid; grid-template-columns: minmax(220px, 290px) minmax(0, 1fr);
  gap: clamp(24px, 4vw, 64px); align-items: center; padding-top: 4px;
}

/* The menu: a light panel with three titles; only the open one shows its three options */
.rs-menu {
  padding: clamp(10px, 1.4vw, 16px) clamp(18px, 2vw, 26px);
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 10px 30px rgba(8, 38, 26, .06);
}
.rs-group + .rs-group { border-top: 1px solid var(--line); }
.rs-head, .rs-item {
  margin: 0; border: 0; background: none; cursor: pointer; text-align: left;
  font-family: var(--f-head); line-height: 1.25;
  text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 4px; text-decoration-thickness: 1.5px;
  transition: color .3s var(--ease), text-decoration-color .2s var(--ease);
}
.rs-head {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 0; font-size: clamp(1.15rem, 1.6vw, 1.35rem); font-weight: 600; color: var(--violet);
}
.rs-head::after { /* a small arrow: pointing right when closed, down when open */
  content: ''; flex: none; width: 8px; height: 8px; margin-right: 4px;
  border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: rotate(-45deg); transition: transform .3s var(--ease);
}
.rs-group.is-open .rs-head::after { transform: rotate(45deg); }
.rs-sub { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .4s var(--ease); }
.rs-group.is-open .rs-sub { grid-template-rows: 1fr; }
.rs-sub > ul { min-height: 0; overflow: hidden; list-style: none; margin: 0; padding: 0; }
.rs-sub li:last-child { padding-bottom: 12px; }
.rs-item {
  position: relative; display: inline-block; padding: 4px 0 4px 16px;
  font-size: clamp(1rem, 1.2vw, 1.08rem); font-weight: 500; color: var(--moss);
}
.rs-item::before { /* a dot marks the option being shown */
  content: ''; position: absolute; left: 2px; top: calc(50% - 3px); width: 6px; height: 6px; border-radius: 50%;
  background: currentColor; opacity: 0; transform: scale(.4); transition: opacity .3s var(--ease), transform .3s var(--ease);
}
.rs-item.is-active { color: var(--accent); font-weight: 600; }
.rs-item.is-active::before { opacity: 1; transform: none; }
.rs-head:hover, .rs-item:hover { text-decoration-color: currentColor; }
.rs-head:focus-visible, .rs-item:focus-visible { outline: 2px solid var(--violet); outline-offset: 3px; border-radius: 4px; }

.rs-panel > .rs-label { display: none; }

/* The panels share one spot, so the section keeps its height whichever is open */
.rs-panels { display: grid; }
.rs-panel {
  grid-area: 1 / 1; min-width: 0; align-self: center;
  opacity: 0; visibility: hidden; transform: translateY(10px);
  transition: opacity .35s var(--ease), transform .45s var(--ease), visibility 0s .35s;
}
.rs-panel.is-open { opacity: 1; visibility: visible; transform: none; transition: opacity .45s var(--ease) .05s, transform .5s var(--ease) .05s, visibility 0s; }

/* What: the three questions in full */
.what-list { display: grid; gap: clamp(18px, 3.4vh, 34px); }
.what-item { border-radius: 10px; }
.what-item h3 { margin: 0 0 6px; font-size: clamp(1.7rem, 3.4vw, 2.7rem); line-height: 1.1; color: var(--moss); }
.what-item p { margin: 0; font-size: clamp(1rem, 1.6vw, 1.15rem); line-height: 1.55; color: var(--ink-soft); }
@keyframes what-flash { 0% { background: color-mix(in srgb, var(--moss) 16%, transparent); } 100% { background: transparent; } }
.what-item.is-flash { animation: what-flash 1.4s var(--ease); }

/* Where and How: the text on the left, the picture on the right */
.rs-panel--where, .rs-panel--how { display: flex; align-items: center; gap: clamp(24px, 4vw, 56px); }
.rs-text { flex: 1; min-width: 0; display: grid; }
.rs-text > * { grid-area: 1 / 1; align-self: center; }
.rs-pick {
  margin: 0; font-family: var(--f-mono); font-size: .8rem; letter-spacing: .04em; color: var(--ink-soft);
  transition: opacity .3s var(--ease);
}
.rs-text.has-pick .rs-pick { opacity: 0; }
.pick-phone { display: none; }
@media (max-width: 760px) { .pick-wide { display: none; } .pick-phone { display: inline; } } /* phones have no menu */
.rs-desc { opacity: 0; transform: translateY(12px); pointer-events: none; transition: opacity .4s var(--ease), transform .4s var(--ease); }
.rs-desc.is-active { opacity: 1; transform: none; pointer-events: auto; }
.rs-desc h3 { margin: 0 0 12px; font-size: clamp(1.3rem, 2.2vw, 2rem); color: var(--c); }
.rs-desc p { margin: 0; max-width: 560px; font-size: clamp(1rem, 1.6vw, 1.15rem); line-height: 1.55; color: var(--ink-soft); }

/* The picture: each part is grey with a soft glow until it is picked, then stays in colour */
.rs-art { position: relative; flex: none; order: -1; aspect-ratio: 827 / 800; width: clamp(220px, 26vw, 350px); } /* the picture first, its text beside it */
.rs-art--how { aspect-ratio: 414 / 400; }
.art-layer, .art-base {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; pointer-events: none;
  transition: filter .3s var(--ease), opacity .3s var(--ease);
}
@keyframes cue-glow {
  0%, 100% { filter: grayscale(1) drop-shadow(0 0 2px rgba(255, 190, 60, .45)); }
  50%      { filter: grayscale(1) drop-shadow(0 0 11px rgba(255, 190, 60, .95)); }
}
.art-layer:not(.is-revealed) { filter: grayscale(1); animation: cue-glow 1.9s ease-in-out infinite; }
.art-layer.is-revealed { filter: none; }
.art-layer.is-active { filter: drop-shadow(0 0 5px var(--halo)) drop-shadow(0 0 13px var(--halo)); }
.art-hot {
  position: absolute; left: var(--x); top: var(--y); width: var(--w); height: var(--h);
  transform: translate(-50%, -50%);
  margin: 0; padding: 0; border: 0; background: transparent;
  border-radius: 50%; cursor: pointer; outline: none;
}
/* the small network: a live copy of the one at the top (drag a node, click for a spark) */
.how-net { inset: auto; left: 2%; top: 50%; width: 50%; height: 47%; pointer-events: auto; cursor: pointer; touch-action: pan-y; }

/* Phones: the menu on top (each group on its own line), then the panel */
@media (max-width: 760px) {
  /* phones: no menu; What, Where and How one below the other, each with its heading */
  .rs-menu { display: none; }
  .rs-panels { gap: clamp(36px, 9vw, 52px); }
  .rs-panel, .rs-panel.is-open { grid-area: auto; opacity: 1; visibility: visible; transform: none; transition: none; }
  .rs-panel > .rs-label {
    display: block; margin: 0 0 14px; font-family: var(--f-head);
    font-size: 1.35rem; font-weight: 600; color: var(--violet); order: -2; /* above the picture */
  }
  .what-item h3 { font-size: 1.6rem; }
  .rs { grid-template-columns: minmax(0, 1fr); gap: 22px; }
  .rs-panel--where, .rs-panel--how { flex-direction: column; align-items: stretch; gap: 14px; }
  .rs-art { order: -1; align-self: center; width: min(66vw, 300px); }
  .rs-panel { align-self: start; }
  .rs-text { min-height: 12em; }
  .rs-text > * { align-self: start; }
  /* the brain a bit smaller (30%) than on large screens, with its click area */
  .rs-art--how svg[data-item="brain"] image { transform-box: fill-box; transform-origin: center; transform: scale(.7); }
  .rs-art--how .art-hot[data-item="brain"] { --w: 31% !important; --h: 27% !important; }
}
@media (prefers-reduced-motion: reduce) {
  .art-layer:not(.is-revealed), .what-item.is-flash { animation: none !important; }
  .rs-panel, .rs-desc, .rs-pick, .rs-head, .rs-head::after, .rs-item, .rs-item::before, .rs-sub { transition: none !important; }
}


/* ============ NEWS CARDS (horizontal scroller: newest left, oldest right) ============ */
.news-scroller { position: relative; }
.card-grid {
  display: flex; gap: 24px; overflow-x: auto; overscroll-behavior-x: contain;
  scroll-snap-type: x proximity; scroll-behavior: smooth;
  padding: 4px 2px 16px;
  scrollbar-width: thin; scrollbar-color: var(--line) transparent;
}
.card-grid::-webkit-scrollbar { height: 8px; }
.card-grid::-webkit-scrollbar-thumb { background: var(--line); border-radius: 99px; }
.news-card {
  flex: 0 0 clamp(238px, 26vw, 288px); scroll-snap-align: start;
  display: flex; flex-direction: column; text-decoration: none; color: inherit;
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; transition: transform .3s var(--ease);
}
.news-arrow {
  position: absolute; top: 36%; transform: translateY(-50%); z-index: 3;
  width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line);
  background: rgba(255,255,255,.96); color: var(--ink); cursor: pointer;
  display: grid; place-items: center; font-size: 1.6rem; line-height: 1; padding-bottom: 3px;
  box-shadow: 0 8px 22px rgba(8,38,26,.16); transition: background .2s var(--ease), color .2s var(--ease);
}
.news-arrow:hover { background: #fff; color: var(--accent-bright); }
.news-arrow--prev { left: -10px; }
.news-arrow--next { right: -10px; }
.news-arrow[hidden] { display: none; }
.news-card:hover { transform: translateY(-6px); }
.news-media { position: relative; aspect-ratio: 16/10; overflow: hidden; }
.news-media img { width: 100%; height: 100%; object-fit: cover; }
.play-btn {
  position: absolute; inset: 0; margin: auto; pointer-events: none;
  width: 56px; height: 56px; border-radius: 50%;
  background: rgba(255,255,255,.92); color: var(--accent); font-size: 1rem;
  display: grid; place-items: center; transition: transform .25s var(--ease);
}
.news-card:hover .play-btn { transform: scale(1.12); background: #fff; }
.news-media--light { border-bottom: 1px solid var(--line); } /* separates white images from the card text */
.card-text { padding: 18px 20px 22px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card-tag {
  display: inline-block; width: max-content; font-size: .72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .1em; color: var(--accent-bright);
}
.card-text h3 { font-size: 1.05rem; margin: 0; line-height: 1.35; }

/* ============ TEAM (fixed-size cards, max 4 per row, info revealed on hover) ============ */
.people-grid {
  --cols: 4; --gap: 12px;
  display: flex; flex-wrap: wrap; justify-content: center; gap: var(--gap);
}
@media (max-width: 1023px) { .people-grid { --cols: 2; } } /* 4 cards get too narrow for the bio */
.person {
  position: relative; margin: 0; min-width: 0; height: 380px;
  flex: 0 0 calc((100% - (var(--cols) - 1) * var(--gap)) / var(--cols));
  border-radius: var(--radius); overflow: hidden; cursor: pointer; outline: none;
}
.person-photo {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  transition: filter .35s var(--ease);
}
.person-info {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 18px;
  color: #fff;
  background: linear-gradient(to top, rgba(8,38,26,.92) 12%, rgba(8,38,26,.55) 55%, rgba(8,38,26,0));
}
.person-name strong { display: block; font-size: 1.1rem; line-height: 1.2; white-space: nowrap; }
.person-name span { font-size: .85rem; opacity: .82; white-space: nowrap; }
.person-bio {
  margin: 0; max-width: 360px;
  font-size: .92rem; line-height: 1.5; color: #e6eee8;
  opacity: 0; max-height: 0; transform: translateY(6px);
  transition: opacity .35s var(--ease) .08s, max-height .5s var(--ease), transform .35s var(--ease), margin-top .4s var(--ease);
}
/* Reveal on hover / keyboard focus: the card keeps its size, the photo darkens behind the text */
.person:has(.person-bio):hover .person-photo, .person:has(.person-bio):focus-visible .person-photo { filter: brightness(.5); }
.person:hover .person-bio,
.person:focus-visible .person-bio {
  opacity: 1; max-height: 200px; transform: none; margin-top: 12px;
}

.person-bio a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.person-bio a:hover { text-decoration-thickness: 2px; }

/* PI Bluesky + website button + email (revealed with the bio) */
.person-actions, .person-email {
  opacity: 0; max-height: 0; overflow: hidden; transform: translateY(6px);
  transition: opacity .35s var(--ease), max-height .5s var(--ease), transform .35s var(--ease), margin-top .4s var(--ease);
}
.person-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.person-link {
  display: inline-flex; align-items: center; gap: 8px; width: max-content;
  height: 38px; padding: 0 13px; border-radius: 999px; white-space: nowrap;
  background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.4);
  color: #fff; font-weight: 600; font-size: .85rem; text-decoration: none;
  transition: background .25s var(--ease);
}
.person-link:hover { background: rgba(255,255,255,.3); }
.person-bsky {
  flex: none; width: 38px; height: 38px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%; background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.4);
  color: #fff; text-decoration: none; transition: background .25s var(--ease);
}
.person-bsky:hover { background: rgba(255,255,255,.3); }
.person-bsky svg { width: 20px; height: 20px; }
.arrow-x { display: inline-block; animation: bob-x 1.4s var(--ease) infinite; }
@keyframes bob-x { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(6px); } }
.person-email { display: block; color: #dce8e0; font-size: .85rem; }
.person-email:hover { color: #fff; text-decoration: underline; }

.person:hover .person-actions, .person:focus-visible .person-actions {
  opacity: 1; max-height: 90px; transform: none; margin-top: 14px;
}
.person:hover .person-email, .person:focus-visible .person-email {
  opacity: 1; max-height: 30px; transform: none; margin-top: 10px;
}
@media (prefers-reduced-motion: reduce) { .arrow-x { animation: none; } }

/* Dim siblings of the hovered card for focus */
.people-grid:has(.person:hover) .person:not(:hover) { filter: saturate(.8) brightness(.94); }

/* ============ RESOURCES (floating circles) ============ */
.res-deck {
  --res-h: clamp(180px, 22vw, 250px);          /* default circle size (4 fit in a row) */
  --res-exp: clamp(340px, 36vw, 420px);         /* the panel size when one is expanded  */
  display: flex; align-items: center; justify-content: center;
  gap: clamp(12px, 2vw, 24px);
  min-height: var(--res-exp);                   /* fixed height: no vertical jump on hover */
}
.res-circle {
  position: relative; flex: 0 0 auto; min-width: 0;
  width: var(--res-h); height: var(--res-h); border-radius: 50%;
  display: grid; place-items: center; overflow: hidden; cursor: pointer; outline: none;
  color: #fff; text-align: center;
  box-shadow: 0 16px 36px rgba(8, 38, 26, .14);
  transition: width .5s var(--ease), height .5s var(--ease),
              flex-grow .5s var(--ease), border-radius .5s var(--ease);
}
.res-methods  { background: linear-gradient(150deg, #1f9aa6, #18808a); animation-delay: 0s;    }
.res-readings { background: linear-gradient(150deg, #3f6b4e, #043e29); animation-delay: -1.2s; }
.res-values   { background: linear-gradient(150deg, #9b72cf, #7d57b8); animation-delay: -2.4s; }
.res-collabs  { background: linear-gradient(150deg, #d98a2b, #bd7320); animation-delay: -3.6s; }

@keyframes res-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }

.res-inner { padding: clamp(14px, 1.8vw, 24px) clamp(16px, 2.4vw, 34px); width: 100%; min-width: 0; max-width: 640px; }
.res-methods .res-inner, .res-values .res-inner { max-width: 840px; }
.res-title {
  margin: 0; font-weight: 800; letter-spacing: -.01em; line-height: 1.15;
  font-size: clamp(1.5rem, 2.6vw, 2.2rem); transition: font-size .4s var(--ease);
}
.res-title { text-decoration: underline 2px transparent; text-underline-offset: .18em; }
@media (hover: hover) {
  .res-circle:hover .res-title, .res-circle:focus-visible .res-title { text-decoration-color: #fff; }
}
.res-body {
  opacity: 0; max-height: 0; margin-top: 0; overflow: hidden;
  font-size: clamp(.95rem, 1.4vw, 1.1rem); line-height: 1.55; color: rgba(255,255,255,.92);
  transition: opacity .4s var(--ease) .1s, max-height .5s var(--ease), margin-top .4s var(--ease);
}
.res-body p { margin: 0; }

/* The four main circles open on CLICK (.is-open), not hover; leaving resets.
   Stop floating once one is open. */
.res-deck.has-open .res-circle { animation-play-state: paused; }

.res-deck.has-open .res-circle {
  width: clamp(64px, 7.5vw, 92px); height: clamp(64px, 7.5vw, 92px);
}
.res-deck.has-open .res-circle:not(.is-open) .res-title {
  font-size: clamp(.62rem, 1vw, .8rem);
}
.res-deck.has-open .res-circle:not(.is-open) .res-inner {
  padding: 8px; max-width: none;   /* small padding so the label stays centred when shrunk */
}
.res-deck.has-open .res-circle.is-open {
  flex: 1 1 auto; width: auto; height: var(--res-exp); border-radius: 32px;
}
.res-deck.has-open .res-circle.is-open .res-title { font-size: clamp(1.5rem, 2.6vw, 2.2rem); }
.res-deck.has-open .res-circle.is-open .res-body {
  opacity: 1; max-height: 360px; margin-top: 14px;
}
/* Titles stay anchored at the top of the panel */
.res-methods.is-open .res-inner,
.res-values.is-open .res-inner { align-self: start; }
/* Methods: tagline stays right under the title; drop only the logos lower */
.res-methods.is-open .methods-row { margin-top: clamp(34px, 5vw, 60px); }
/* Values: keep the title at the top; drop the bubbles (and text) lower */
.res-values.is-open .values-row { margin-top: clamp(34px, 5vw, 58px); }

/* "Our Values": three value circles; hovering one shows its text below */
.values-row { display: flex; gap: clamp(12px, 2vw, 26px); justify-content: center; align-items: center; margin-bottom: 14px; }
.value-bubble {
  border: 0; cursor: pointer; font: inherit; padding: 6px;
  display: grid; place-items: center; text-align: center;
  width: clamp(66px, 7.5vw, 92px); aspect-ratio: 1; border-radius: 50%;
  background: #fff; color: #7d57b8; font-weight: 800; line-height: 1.1;
  font-size: clamp(.64rem, .98vw, .8rem); box-shadow: 0 6px 16px rgba(8, 38, 26, .18);
  transition: transform .25s var(--ease), box-shadow .25s var(--ease);
}
.value-bubble:hover, .value-bubble:focus-visible, .value-bubble.is-active {
  transform: translateY(-3px) scale(1.07);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, .55), 0 12px 24px rgba(8, 38, 26, .26);
}
.value-detail { display: grid; max-width: 760px; margin: 0 auto; }
.value-text {
  grid-area: 1 / 1; margin: 0; text-align: center;
  color: rgba(255, 255, 255, .96); font-size: clamp(.82rem, 1.05vw, .95rem); line-height: 1.5;
  opacity: 0; pointer-events: none; transition: opacity .3s var(--ease);
}
.value-text.is-active { opacity: 1; pointer-events: auto; }
.value-link {
  display: block; width: fit-content; margin: 14px auto 0;
  padding: 8px 16px; border-radius: 999px;
  background: rgba(255, 255, 255, .18); border: 1px solid rgba(255, 255, 255, .45);
  color: #fff; font-weight: 600; font-size: .85rem; text-decoration: none;
  transition: background .25s var(--ease);
}
.value-link:hover { background: rgba(255, 255, 255, .32); }

/* "Collabs": floating collaborator avatars linking to Google Scholar */
.collabs-row {
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: clamp(10px, 1.5vw, 16px) clamp(10px, 1.6vw, 20px);
  max-width: 580px; margin: clamp(14px, 2.6vw, 26px) auto 0;
}
.collab {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  width: clamp(68px, 7.4vw, 92px); color: #fff; text-decoration: none;
}
.collab-photo {
  width: 100%; aspect-ratio: 1; border-radius: 50%; overflow: hidden; background: #fff;
  box-shadow: 0 8px 18px rgba(8, 38, 26, .2);
  animation: res-float 5s var(--ease) infinite;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease);
}
.collab-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.collab-name { font-size: clamp(.68rem, .92vw, .8rem); font-weight: 600; line-height: 1.2; text-align: center; }
.collab:hover .collab-photo, .collab:focus-visible .collab-photo {
  animation-play-state: paused; transform: translateY(-5px);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, .6), 0 14px 28px rgba(8, 38, 26, .28);
}
.collab:hover .collab-name, .collab:focus-visible .collab-name { text-decoration: underline; }
.collab:nth-child(2) .collab-photo { animation-delay: -.6s; }
.collab:nth-child(3) .collab-photo { animation-delay: -1.2s; }
.collab:nth-child(4) .collab-photo { animation-delay: -1.8s; }
.collab:nth-child(5) .collab-photo { animation-delay: -2.4s; }
.collab:nth-child(6) .collab-photo { animation-delay: -3s; }
.collab:nth-child(7) .collab-photo { animation-delay: -3.6s; }
.collab:nth-child(8) .collab-photo { animation-delay: -4.2s; }
.collab:nth-child(9) .collab-photo { animation-delay: -4.8s; }
.collab:nth-child(10) .collab-photo { animation-delay: -2.1s; }
@media (prefers-reduced-motion: reduce) { .collab-photo { animation: none; } }
.vt-name { display: none; }

/* "Suggested Readings": a linked reading list */
.readings-list {
  list-style: none; margin: 0 auto; padding: 0; max-width: 720px;
  display: grid; gap: clamp(8px, 1.2vw, 12px); text-align: left;
}
.readings-list a {
  display: block; color: #fff; text-decoration: none; line-height: 1.4;
  font-size: clamp(.86rem, 1.15vw, 1rem);
  padding: 11px 16px; border-radius: 12px;
  background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .2);
  transition: background .2s var(--ease), transform .2s var(--ease);
}
.readings-list a:hover, .readings-list a:focus-visible { background: rgba(255, 255, 255, .22); transform: translateY(-2px); }
.reading-cite { font-weight: 800; }

/* "Methods": tagline + three linked resource badges */
.methods-tagline {
  margin: 0 0 24px; color: #fff; font-weight: 600;
  font-size: clamp(.98rem, 1.5vw, 1.18rem); line-height: 1.4;
}
.methods-row { display: flex; gap: clamp(14px, 2.4vw, 30px); justify-content: center; align-items: flex-start; }
.method-item {
  flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 9px;
  color: #fff; text-align: center;
}
.method-logo {
  width: clamp(82px, 10vw, 112px); height: clamp(82px, 10vw, 112px); object-fit: contain;
  transition: transform .25s var(--ease), filter .25s var(--ease);
}
.method-item:hover .method-logo, .method-item:focus-visible .method-logo {
  transform: translateY(-5px);
  filter: drop-shadow(0 0 6px rgba(255, 255, 255, .95)) drop-shadow(0 0 16px rgba(255, 255, 255, .7));
}
.method-name { font-weight: 800; font-size: clamp(.85rem, 1.15vw, 1rem); }
.method-item:hover .method-name, .method-item:focus-visible .method-name { text-decoration: underline; }
.method-desc { margin: 0; font-size: clamp(.7rem, .95vw, .82rem); line-height: 1.35; color: rgba(255, 255, 255, .9); }

@media (prefers-reduced-motion: reduce) { .res-circle { animation: none; } }

/* Touch / small screens: stack as open cards (no hover) */
@media (max-width: 760px) {
  .res-deck { flex-direction: column; gap: 14px; min-height: 0; }
  .res-circle,
  .res-deck.has-open .res-circle,
  .res-deck.has-open .res-circle.is-open {
    width: 100%; height: auto; border-radius: 18px; flex: none; animation: none;
  }
  /* tapping a card changes nothing in the others: same title size, padding and spacing */
  .res-inner,
  .res-deck.has-open .res-circle:not(.is-open) .res-inner { max-width: none; padding: 22px 24px; }
  .res-title,
  .res-deck.has-open .res-circle:not(.is-open) .res-title,
  .res-deck.has-open .res-circle.is-open .res-title { font-size: 1.4rem; }
  .methods-row, .res-methods.is-open .methods-row { margin-top: 32px; } /* room between the tagline and the logos */
  .res-values.is-open .values-row { margin-top: 0; }
  .res-body,
  .res-deck.has-open .res-circle.is-open .res-body {
    opacity: 1; max-height: none; margin-top: 10px;
  }
  /* Values: tap a bubble to read it, one at a time (as on larger screens) */
  .res-values .res-inner,
  .res-deck.has-open .res-values.res-circle:not(.is-open) .res-inner { padding-inline: 12px; }
  .values-row { margin-bottom: 14px; gap: 8px; padding: 14px 6px 8px; } /* room for the picked bubble to grow (and its ring) */
  .value-bubble { width: calc((100% - 28px) / 3); max-width: 108px; padding: 4px; font-size: .76rem; }
  .value-text { padding-inline: 6px; }
  .value-text { text-align: left; }
  /* Methods: DevStart and Neuromatch side by side, Experimentology centred below */
  .methods-row { flex-wrap: wrap; column-gap: 14px; row-gap: 22px; }
  .method-item { flex: 0 1 calc((100% - 14px) / 2); }
  .methods-row > .method-item:nth-child(2) { order: 1; } /* Experimentology */
}

/* ============ JOIN ============ */
.join { text-align: center; position: relative; overflow: hidden; }
.join > .container { position: relative; z-index: 1; }
/* Roots on both sides (drawn by main.js); faded out towards the centre where the text is */
.join-roots {
  position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0;
  -webkit-mask-image: linear-gradient(90deg, #000 0, #000 19%, transparent 31%, transparent 69%, #000 81%, #000 100%);
  mask-image: linear-gradient(90deg, #000 0, #000 19%, transparent 31%, transparent 69%, #000 81%, #000 100%);
}
@media (max-width: 700px) {
  .join-roots {
    -webkit-mask-image: linear-gradient(90deg, #000 0, #000 6%, transparent 15%, transparent 85%, #000 94%, #000 100%);
    mask-image: linear-gradient(90deg, #000 0, #000 6%, transparent 15%, transparent 85%, #000 94%, #000 100%);
  }
}
.join-actions { display: flex; gap: 14px; justify-content: center; margin-top: 32px; flex-wrap: wrap; }
.btn {
  display: inline-block; padding: 14px 30px; border-radius: 999px;
  font-weight: 600; font-size: 1rem; font-family: inherit; line-height: 1.2;
  cursor: pointer; text-decoration: none; transition: .25s var(--ease);
}
.btn-primary { background: var(--accent); color: #fff; border: 1px solid var(--accent); }
.btn-primary:hover { background: var(--accent-bright); border-color: var(--accent-bright); transform: translateY(-2px); }
.btn-ghost { border: 1px solid var(--line); color: var(--ink); background: #fff; }
.btn-ghost:hover { border-color: var(--accent-bright); color: var(--accent-bright); }

/* Open-positions popup */
.positions-dialog { border: 0; padding: 0; background: transparent; max-width: 460px; width: calc(100% - 40px); }
.positions-dialog::backdrop { background: rgba(8, 38, 26, .5); backdrop-filter: blur(2px); }
.positions-dialog[open] { animation: dialog-in .25s var(--ease); }
@keyframes dialog-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.dialog-inner {
  position: relative; background: var(--bg); color: var(--ink); border-radius: var(--radius);
  padding: clamp(30px, 4vw, 42px); text-align: center; box-shadow: 0 30px 80px rgba(8, 38, 26, .35);
}
.dialog-inner p { margin: 0 0 24px; font-size: 1.05rem; line-height: 1.55; color: var(--ink-soft); }
.dialog-close {
  position: absolute; top: 8px; right: 14px; border: 0; background: none; cursor: pointer;
  font-size: 1.7rem; line-height: 1; color: var(--muted); transition: color .2s var(--ease);
}
.dialog-close:hover { color: var(--ink); }

/* ============ IMPRINT / PRIVACY PAGES ============ */
.legal-back { font-size: .95rem; font-weight: 500; color: var(--ink-soft); }
.legal-back:hover { color: var(--ink); }
.legal h1 { font-size: clamp(1.9rem, 4vw, 3rem); font-weight: 800; letter-spacing: -.02em; margin: 0 0 24px; }
.legal h2 { font-size: 1.1rem; font-weight: 700; margin: 28px 0 6px; }
.legal p { margin: 0 0 14px; color: var(--ink-soft); }
.legal a { color: var(--accent); text-decoration: underline; }
.legal-foot { padding: 20px 0 32px; border-top: 1px solid var(--line); font-size: .85rem; color: var(--muted); }
.legal-foot a { color: var(--muted); }
.legal-foot a:hover { color: var(--ink); text-decoration: underline; }

/* ============ SCROLL REVEAL ============ */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.in-view { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .scroll-arrow { animation: none; }
  html { scroll-behavior: auto; }
}

/* ============ RESPONSIVE ============ */
@media (max-width: 900px) {
  .card-grid { grid-template-columns: 1fr; }
  .logo-grid { grid-template-columns: repeat(3, 1fr); }
}

/* Team grid → stacked cards (no hover on touch) */
@media (max-width: 720px) {
  .people-grid { flex-direction: column; flex-wrap: nowrap; gap: 14px; }
  .person {
    display: grid; grid-template-columns: 40% minmax(0, 1fr); grid-template-rows: auto 1fr; align-items: start;
    flex: none; height: auto; min-width: 0; border: 1px solid var(--line); background: var(--bg);
  }
  .person-photo { position: static; grid-column: 1; grid-row: 1; width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; }
  .person-info { display: contents; } /* its parts go into the card's grid */
  .person-name { grid-column: 1; grid-row: 2; padding: 10px 12px 14px; }
  .person-name strong { font-size: 1rem; }
  .person-name span { display: block; margin-top: 3px; line-height: 1.3; }
  .person-more { grid-column: 2; grid-row: 1 / span 2; padding: 12px 16px 16px; }
  .person-more > .person-bio { margin-top: 0; }
  /* cards with just a name (open positions): the name beside the picture */
  .person:not(:has(.person-more)) .person-name { grid-column: 2; grid-row: 1; align-self: center; padding: 14px 16px; }
  .person:not(:has(.person-more)) .person-name strong { font-size: 1.1rem; }
  .person:has(.person-bio):hover .person-photo, .person:has(.person-bio):focus-visible .person-photo { filter: none; }
  .person:hover .person-bio, .person:focus-visible .person-bio { margin-top: 0; }
  .person:hover .person-actions, .person:focus-visible .person-actions { margin-top: 12px; }
  /* nothing is revealed on touch screens: everything shows, at full height */
  .person:hover .person-bio, .person:focus-visible .person-bio,
  .person:hover .person-actions, .person:focus-visible .person-actions,
  .person:hover .person-email, .person:focus-visible .person-email { max-height: none; }
  .person-info { position: static; color: var(--ink); background: none; }
  .person-name strong, .person-name span { white-space: normal; }
  .person-link { white-space: normal; height: auto; min-height: 38px; padding: 7px 13px; width: auto; }
  .person-name span { color: var(--muted); }
  .person-bio { opacity: 1; max-height: none; transform: none; margin-top: 0; color: var(--ink-soft); }
  .person-actions, .person-email { opacity: 1; max-height: none; transform: none; }
  .person-actions { margin-top: 12px; }
  .person-link, .person-bsky {
    background: var(--accent); border-color: var(--accent); color: #fff;
  }
  .person-email { margin-top: 10px; color: var(--accent); overflow-wrap: anywhere; }
  .people-grid:has(.person:hover) .person:not(:hover) { filter: none; }
}

@media (max-width: 720px) {
  .main-nav {
    position: fixed; inset: var(--header-h) 0 auto 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--bg); border-bottom: 1px solid var(--line);
    padding: 12px 24px 24px; transform: translateY(-120%);
    transition: transform .35s var(--ease); box-shadow: 0 20px 40px rgba(8,38,26,.08);
  }
  .main-nav.open { transform: translateY(0); }
  .main-nav > a { padding: 14px 0; border-bottom: 1px solid var(--line); }
  .main-nav > a::after { display: none; }
  .nav-cta { text-align: center; margin-top: 12px; }
  .lang-toggle { margin-top: 16px; align-self: flex-start; }
  .nav-toggle { display: flex; }
}

@media (max-width: 480px) {
  .logo-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ============ SMALL CHANGES FOR THE SOLARPUNK HERO ============ */
/* Headings share the title's serif (small change to match the new hero) */
.section-title, .findus-title, .what-item h3, .rs-desc h3, .res-title, .legal h1 {
  font-family: var(--f-head); font-optical-sizing: auto;
  font-weight: 600; letter-spacing: -.005em;
}
