/* ==========================================================================
   Palette: forest, moss, fern, lichen, river, ochre, rust, bark, paper
   ========================================================================== */
:root {
  --forest: #1f3b2d;
  --forest-2: #2a4b39;
  --moss: #3e6b48;
  --fern: #6f9a5b;
  --lichen: #b9c98f;
  --river: #2f6f73;
  --river-soft: #a9c8c6;
  --ochre: #c98b2b;
  --rust: #b8552c;
  --bark: #6b4e36;
  --paper: #f6f3ea;
  --paper-2: #fbf9f3;
  --sage: #e8ecdc;
  --sand: #e8dfc9;
  --ink: #1d2a22;
  --muted: #5a6658;
  --line: #d6d8c6;

  /* roles (these flip in dark mode) */
  --cream: #f6f3ea;          /* light text on dark green panels: never flips */
  --heading: #1f3b2d;
  --surface: #ffffff;
  --accent-text: #3e6b48;
  --link: #2f6f73;

  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Karla", system-ui, -apple-system, "Segoe UI", sans-serif;

  --header-h: 72px;
  --radius: 18px;
  --radius-sm: 10px;
  --shadow: 0 18px 50px -20px rgba(31, 59, 45, .35);
  --shadow-sm: 0 6px 18px -8px rgba(31, 59, 45, .35);
  --ease: cubic-bezier(.2, .8, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 8px); }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background-color .35s, color .35s;
}
img { display: block; max-width: 100%; }
a { color: var(--link); text-underline-offset: 3px; }
a:hover { color: var(--rust); }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; line-height: 1.15; margin: 0 0 .5em; color: var(--heading); }
p { margin: 0 0 1em; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--ochre); outline-offset: 3px; border-radius: 6px; }

.icon {
  width: 1.15em; height: 1.15em; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
  vertical-align: -0.2em;
}
.container { width: min(1180px, 100% - 2.5rem); margin-inline: auto; }
.kicker {
  font-size: .8rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent-text); margin-bottom: .6rem;
}
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--forest); color: #fff; padding: .5rem 1rem; z-index: 100; border-radius: 8px; }
.skip-link:focus { left: 8px; }

/* ==========================================================================
   Header & running trail
   ========================================================================== */
.site-header {
  --header-signal: #a2691d;
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  display: grid; grid-template: var(--header-h) / minmax(0, 1fr);
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
}
[data-theme="dark"] .site-header { --header-signal: #e8b65e; }
.header-inner {
  grid-area: 1 / 1;
  z-index: 1;
  width: min(1180px, 100% - 2.5rem); margin-inline: auto;
  display: flex; align-items: center; gap: 1rem;
  pointer-events: none;
}
.header-inner > * { pointer-events: auto; }
.header-inner .nav { margin: .3rem 0 0 auto; align-self: flex-start; }
.theme-toggle {
  flex: none; width: 36px; height: 36px; border-radius: 50%; cursor: pointer;
  display: grid; place-items: center;
  border: 1px solid var(--line); background: var(--paper-2); color: var(--heading);
  transition: transform .5s var(--ease), background .2s;
}
.theme-toggle:hover { transform: rotate(25deg); background: var(--surface); }
.theme-toggle .icon { width: 18px; height: 18px; }
.theme-toggle .i-sun { display: none; }
[data-theme="dark"] .theme-toggle .i-sun { display: block; }
[data-theme="dark"] .theme-toggle .i-moon { display: none; }
.brand {
  display: inline-flex; align-items: center; align-self: stretch; gap: .42rem; flex: none;
  font-family: var(--font-display); font-weight: 600; font-size: 1.18rem;
  color: var(--heading); text-decoration: none;
}
.brand:hover { color: var(--heading); }
.brand-brain { width: 76px; height: auto; flex: none; overflow: visible; }
.brand-brain-line { fill: none; stroke: currentColor; stroke-width: 3.3; stroke-linecap: round; stroke-linejoin: round; }
.brand-name { width: min-content; line-height: 1.32; }
.brand-eeg, .trail-lead {
  fill: none; stroke: var(--header-signal); stroke-width: 2.05;
  stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke;
}
.affiliation-list {
  display: flex; align-items: center; gap: clamp(.4rem, 1vw, .95rem);
  width: fit-content; margin: 0; padding: 0; list-style: none; pointer-events: auto;
}
.affiliation-link {
  display: flex; align-items: center; gap: .35rem;
  color: var(--heading); text-decoration: none; border-radius: 5px;
}
.affiliation-link:hover { text-decoration: underline; }
.affiliation-logo {
  display: block; height: 32px; padding: 4px 6px; border-radius: 5px;
  object-fit: contain;
}
.affiliation-logo--cambridge { width: 126px; background: #fcfaf5; }
.affiliation-logo--cca { width: 42px; padding: 0; background: #26372e; }
.affiliation-logo--churchill { width: 32px; padding: 0; }
.affiliation-logo--neurocivitas { width: 104px; background: #26372e; }
.affiliation-label { font-size: .82rem; font-weight: 600; }
.nav { display: flex; gap: clamp(.5rem, 3vw, 2.6rem); }
.nav a {
  position: relative;
  color: var(--muted); text-decoration: none; font-weight: 500; font-size: .98rem;
  line-height: 1.45; padding: .2rem .2rem;
  transition: color .2s;
}
.nav a:hover, .nav a.is-active { color: var(--heading); }
.nav a.is-active::after {
  content: ""; position: absolute; left: 50%; bottom: -2px; width: 5px; height: 5px; border-radius: 50%;
  background: var(--ochre); transform: translateX(-50%);
}

.trail { grid-area: 1 / 1; position: relative; overflow: hidden; pointer-events: none; }
.trail-path {
  position: absolute; left: var(--trail-start, 0px); right: 0; bottom: 7px; height: 3px;
  background-image: linear-gradient(90deg, var(--lichen) 0 55%, transparent 55% 100%);
  background-size: 12px 3px;
}
.trail-walked {
  position: absolute; inset: 0 auto 0 0; width: 0;
  background: linear-gradient(90deg, var(--fern), var(--moss));
  border-radius: 3px;
}
.trail-checkpoints { position: absolute; inset: 0; pointer-events: none; }
.checkpoint {
  position: absolute; bottom: 9px; width: 14px; height: 18px; margin-left: -2px;
  color: var(--lichen); transition: color .3s;
}
.checkpoint .icon { width: 14px; height: 18px; stroke-width: 2.2; }
.checkpoint.is-reached { color: var(--rust); }

.runner {
  position: absolute; left: 0; bottom: 4px; width: 36px; height: 42px;
  transform: translateX(var(--x, 0px));
  will-change: transform;
}
.trail .runner { width: 38px; height: 44px; }
.runner-svg { width: 100%; height: 100%; overflow: visible; }
.runner.is-left .runner-svg { transform: scaleX(-1); }
.runner-shadow {
  position: absolute; left: 6px; right: 4px; bottom: 0; height: 3px; border-radius: 50%;
  background: rgba(31, 59, 45, .25);
}
.runner-svg line { stroke-linecap: round; }
.runner-outfit .torso { stroke: var(--shirt, var(--moss)); stroke-width: 6.5; stroke-linecap: round; }
.runner-outfit .hair { fill: #2a201b; }
.runner-outfit .backpack { fill: #a9542f; stroke: #7d3b20; stroke-width: .6; }
.runner-outfit .strap { stroke: #7d3b20; stroke-width: 1.3; stroke-linecap: round; }
.runner-outfit .shorts { fill: var(--forest); }
.runner-outfit .head { fill: #e2b48a; }
.runner .cap { fill: var(--rust); }
.runner .cap-visor { stroke: var(--rust); stroke-width: 2; }
:is(.runner, .surfer-rider) .leg :is(line, polyline) { stroke: var(--forest); stroke-width: 4; }
:is(.runner, .surfer-rider) .leg-back :is(line, polyline) { stroke: #4b5e50; }
:is(.runner, .surfer-rider) .arm :is(line, polyline) { stroke: #e2b48a; stroke-width: 3.2; }
:is(.runner, .surfer-rider) .arm-back :is(line, polyline) { stroke: #c89a71; }
:is(.runner, .surfer-rider) .leg .foot { stroke: var(--ochre); stroke-width: 3.4; }

/* rotation pivots, in SVG user units */
.runner .limb, .runner .shin, .runner .forearm, .runner-body { transform-box: view-box; }
.runner .leg { transform-origin: 22px 31px; }
.runner .shin { transform-origin: 24px 41px; }
.runner .arm { transform-origin: 25px 18px; }
.runner .forearm { transform-origin: 21px 26px; }

/* standing pose */
.runner .leg-front { transform: rotate(-6deg); }
.runner .leg-back { transform: rotate(8deg); }
.runner .arm-front { transform: rotate(-10deg); }
.runner .arm-back { transform: rotate(14deg); }
.runner .forearm { transform: rotate(-70deg); }
.runner-body { animation: breathe 2.4s ease-in-out infinite; }

/* running cycle */
.runner.is-running .runner-body { animation: bob .28s ease-in-out infinite alternate; }
.runner.is-running .leg-front { animation: thigh .56s linear infinite; }
.runner.is-running .leg-back  { animation: thigh .56s linear infinite; animation-delay: -.28s; }
.runner.is-running .leg-front .shin { animation: knee .56s linear infinite; }
.runner.is-running .leg-back .shin  { animation: knee .56s linear infinite; animation-delay: -.28s; }
.runner.is-running .arm-front { animation: arm .56s ease-in-out infinite; animation-delay: -.28s; }
.runner.is-running .arm-back  { animation: arm .56s ease-in-out infinite; }

@keyframes thigh {
  0%   { transform: rotate(-42deg); }
  50%  { transform: rotate(32deg); }
  100% { transform: rotate(-42deg); }
}
@keyframes knee {
  0%   { transform: rotate(20deg); }
  40%  { transform: rotate(30deg); }
  65%  { transform: rotate(95deg); }
  85%  { transform: rotate(70deg); }
  100% { transform: rotate(20deg); }
}
@keyframes arm {
  0%   { transform: rotate(40deg); }
  50%  { transform: rotate(-55deg); }
  100% { transform: rotate(40deg); }
}
@keyframes bob { from { transform: translateY(0); } to { transform: translateY(-2.5px); } }
@keyframes breathe { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-.6px); } }

/* ==========================================================================
   Sections
   ========================================================================== */
.section { position: relative; padding: 5.5rem 0 7rem; }
.section-sage { background: var(--sage); }
.section-head { max-width: 640px; margin-bottom: 2.5rem; }
.section-head h2 { font-size: clamp(2.2rem, 4.5vw, 3.2rem); }
.section-lede { color: var(--muted); font-size: 1.08rem; }

#projects > .container { position: relative; }
.research-waves {
  position: absolute; inset: 0 0 auto; width: 100%; height: clamp(5.75rem, 11vw, 9.25rem);
  pointer-events: none;
  mask-image: linear-gradient(90deg, #0005, #000 46%), linear-gradient(#000 55%, transparent 95%);
  mask-composite: intersect;
}
.research-water-far { fill: color-mix(in srgb, var(--river-soft) 47%, transparent); }
.research-water-near { fill: color-mix(in srgb, var(--river) 13%, transparent); }
.research-wave-horizon, .research-eeg-trace {
  fill: none; stroke: var(--river); stroke-linecap: round; stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}
.research-wave-horizon { stroke-width: .9; opacity: .22; }
.research-eeg-trace { stroke-width: 1.4; opacity: .58; }
.research-surfer {
  position: absolute; inset: 0 auto auto 0; width: clamp(2.6rem, 4.3vw, 3.9rem);
  height: auto; overflow: visible; pointer-events: none;
  transform-origin: 50% 100%;
  transform: translate(var(--surf-x, 76vw), var(--surf-y, 3rem)) translate(-50%, -100%) rotate(var(--surf-tilt, 0deg));
  opacity: var(--surf-opacity, 0);
}
.surfer-board { fill: #c4674c; stroke: #753f34; stroke-width: .85; }
.surfer-deck { fill: none; stroke: #f5d4b0; stroke-width: 1.15; stroke-linecap: round; }
.surfer-wake { fill: none; stroke: var(--river); stroke-width: 1; stroke-linecap: round; opacity: .7; }
.surfer-rider :is(line, polyline) { fill: none; stroke-linecap: round; stroke-linejoin: round; }
@media (max-width: 740px) { #projects { padding-top: 4.45rem; } }
[data-theme="dark"] .research-water-far { fill: #619c9c2e; }
[data-theme="dark"] .research-water-near { fill: #47888436; }
[data-theme="dark"] :is(.research-wave-horizon, .research-eeg-trace) { stroke: #9ecfc5; }

.terrain { position: absolute; left: 0; bottom: -1px; width: 100%; height: 70px; display: block; }
.terrain-to-sage path { fill: var(--sage); }
.terrain-to-paper path { fill: var(--paper); }

/* reveal on scroll */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.reveal.is-visible { opacity: 1; transform: none; }

/* ==========================================================================
   About
   ========================================================================== */
.section-about {
  padding-top: calc(var(--header-h) + 4rem);
  background:
    radial-gradient(900px 500px at 85% 10%, color-mix(in srgb, var(--lichen) 35%, transparent), transparent 70%),
    radial-gradient(700px 400px at 0% 90%, color-mix(in srgb, var(--river-soft) 35%, transparent), transparent 70%),
    var(--paper);
}
.about-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: clamp(2rem, 6vw, 5rem); align-items: center; }
.about-name { font-size: clamp(2.8rem, 7vw, 5rem); font-weight: 700; letter-spacing: -.02em; margin-bottom: .2rem; }
.about-role { color: var(--muted); font-weight: 500; margin-bottom: 1.6rem; }
.about-headline {
  font-family: var(--font-display); font-size: clamp(1.35rem, 2.4vw, 1.75rem); line-height: 1.3;
  color: var(--accent-text); margin-bottom: 1.2rem;
}
.about-paragraphs p { max-width: 60ch; }
.contact-links { list-style: none; padding: 0; margin: 1.6rem 0 0; display: flex; flex-wrap: wrap; gap: .6rem; }
.pill {
  display: inline-flex; align-items: center; gap: .45rem;
  padding: .45rem .9rem; border-radius: 999px;
  border: 1px solid var(--line); background: var(--paper-2);
  color: var(--heading); text-decoration: none; font-weight: 500; font-size: .94rem;
  transition: background .2s, border-color .2s, transform .2s;
}
.pill:hover { background: var(--surface); border-color: var(--fern); color: var(--heading); transform: translateY(-2px); }
.pill-primary { background: var(--forest); color: var(--cream); border-color: var(--forest); }
.pill-primary:hover { background: var(--moss); color: #fff; border-color: var(--moss); }

.about-visual { position: relative; display: grid; justify-items: center; }
.portrait {
  margin: 0; width: min(210px, 50%); aspect-ratio: 1; border-radius: 50%; overflow: hidden;
  border: 6px solid var(--paper-2); box-shadow: var(--shadow);
  position: absolute; top: -10px; right: 0; z-index: 2;
}
.portrait img { width: 100%; height: 100%; object-fit: cover; }
.sport-card {
  margin-top: 4rem;
  display: grid; grid-template-columns: auto 1fr auto; gap: 2rem; align-items: center;
  background: var(--forest); color: var(--cream);
  border-radius: var(--radius); padding: 1.8rem 2.2rem;
  box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.sport-card::after {
  content: ""; position: absolute; right: -60px; bottom: -80px; width: 260px; height: 260px; border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--fern) 45%, transparent), transparent 70%);
  pointer-events: none;
}
.sport-card h2 { color: var(--cream); font-size: 1.5rem; margin-bottom: .3rem; }
.sport-card p { margin: 0; color: color-mix(in srgb, var(--cream) 82%, transparent); max-width: 62ch; }
.sport-icons { display: flex; gap: .5rem; }
.sport-icons span {
  width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center;
  background: color-mix(in srgb, var(--cream) 12%, transparent); color: var(--lichen);
}
.sport-icons .icon { width: 26px; height: 26px; }
.sport-stats { display: flex; gap: 1.6rem; margin: 0; position: relative; z-index: 1; }
.sport-stats div { text-align: right; }
.sport-stats dt { font-size: .75rem; letter-spacing: .12em; text-transform: uppercase; color: var(--lichen); }
.sport-stats dd { margin: 0; font-family: var(--font-display); font-size: 1.7rem; font-weight: 600; white-space: nowrap; }
.sport-stats dd small { font-size: .9rem; font-weight: 400; opacity: .8; }
.sample-badge {
  display: inline-block; font-size: .7rem; letter-spacing: .08em; text-transform: uppercase;
  padding: .1rem .5rem; border-radius: 999px; background: var(--ochre); color: var(--forest); font-weight: 700;
}

/* ==========================================================================
   Projects: tiles + in-place details panel
   ========================================================================== */
.vignette.project-tile { cursor: pointer; }
.tile-meta { display: flex; gap: .8rem; margin-top: .6rem; font-size: .8rem; color: var(--lichen); }
.tile-meta span { display: inline-flex; align-items: center; gap: .3rem; }
.tile-meta:not(:has(> span:not([hidden]))) { display: none; }
.project-tile[aria-expanded="true"] { outline: 3px solid var(--ochre); outline-offset: 3px; }

.project-panel {
  grid-column: 1 / -1;
  display: grid; grid-template-rows: 0fr;
  transition: grid-template-rows .55s var(--ease), margin .55s var(--ease);
}
.project-panel.is-open { grid-template-rows: 1fr; }
.project-panel > .panel-clip { overflow: hidden; min-height: 0; }
.panel-inner {
  position: relative;
  background: var(--paper-2); border-radius: var(--radius); border: 1px solid var(--line);
  padding: 2rem 2.2rem; margin: .3rem 0 .6rem;
  display: grid; grid-template-columns: 1fr 1fr; gap: 2.2rem;
  box-shadow: var(--shadow-sm);
}
.panel-inner h3 { font-size: 1.8rem; }
.panel-close {
  position: absolute; top: 1rem; right: 1rem; border: 0; background: transparent; cursor: pointer;
  width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; color: var(--muted);
}
.panel-close:hover { background: var(--sage); color: var(--heading); }
.panel-links { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1rem 0 1.4rem; }
.block-title {
  font-family: var(--font-body); font-size: .8rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent-text); font-weight: 700; margin: 0 0 .8rem; display: flex; align-items: center; gap: .45rem;
}
.pubs { list-style: none; padding: 0; margin: 0; counter-reset: pub; }
.pubs li {
  position: relative; padding: .75rem 0 .75rem 2.4rem; border-top: 1px dashed var(--line); font-size: .95rem; line-height: 1.45;
}
.pubs li:first-child { border-top: 0; }
.pubs li::before {
  counter-increment: pub; content: counter(pub);
  position: absolute; left: 0; top: .78rem; width: 1.7rem; height: 1.7rem; border-radius: 50%;
  display: grid; place-items: center; background: var(--sage); color: var(--accent-text); font-size: .78rem; font-weight: 700;
}
.pub-title { font-weight: 700; color: var(--heading); text-decoration: none; }
a.pub-title:hover { color: var(--rust); text-decoration: underline; }
.pub-authors { display: block; color: var(--muted); }
.pub-authors strong { color: var(--ink); }
.pub-venue { font-style: italic; color: var(--muted); }
.empty-note { color: var(--muted); font-style: italic; font-size: .95rem; }

/* video (click-to-load YouTube) */
.videos { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.video {
  position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius-sm); overflow: hidden;
  background: var(--forest); border: 0; padding: 0; width: 100%; cursor: pointer; display: block;
}
.video img { width: 100%; height: 100%; object-fit: cover; opacity: .85; transition: opacity .3s, transform .6s var(--ease); }
.video:hover img { opacity: 1; transform: scale(1.03); }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-play {
  position: absolute; left: 50%; top: 50%; translate: -50% -50%;
  width: 62px; height: 62px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(246, 243, 234, .92); color: var(--rust); box-shadow: var(--shadow-sm);
}
.video-play .icon { width: 26px; height: 26px; margin-left: 3px; }
.video-title {
  position: absolute; inset: auto 0 0 0; padding: .6rem .8rem; font-size: .85rem; text-align: left;
  color: var(--cream); background: linear-gradient(transparent, rgba(20, 38, 29, .85));
}
.video.is-placeholder {
  cursor: default; display: grid; place-items: center; text-align: center; padding: 1rem;
  background: repeating-linear-gradient(135deg, var(--sage) 0 12px, var(--paper-2) 12px 24px);
  color: var(--muted); border: 1px dashed var(--fern); font-size: .9rem;
}

/* ==========================================================================
   Methods: sensor garden simulation
   ========================================================================== */
.section-forest { background: var(--forest); color: color-mix(in srgb, var(--cream) 86%, transparent); }
.section-forest h2 { color: var(--cream); }
.section-forest .kicker { color: var(--lichen); }
.section-forest .section-lede { color: color-mix(in srgb, var(--cream) 78%, transparent); }
.section-forest .section-head { max-width: 760px; }
.terrain-to-forest path { fill: var(--forest); }

.sim { display: grid; gap: 1rem; }
.sim > * { min-width: 0; }
.sim-toolbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1.4rem;
  padding: .6rem .8rem; background: var(--forest-2); border-radius: 14px;
}
.sim-btn {
  width: 40px; height: 40px; border-radius: 50%; border: 0; display: grid; place-items: center; cursor: pointer;
  background: color-mix(in srgb, var(--cream) 10%, transparent); color: var(--cream);
  transition: background .2s, color .2s, transform .2s;
}
.sim-btn:hover { background: color-mix(in srgb, var(--cream) 22%, transparent); }
.sim-btn[aria-pressed="true"] { background: var(--ochre); color: var(--forest); }
.sim-btn-play { background: var(--cream); color: var(--forest); }
.sim-btn-play:hover { background: #fff; transform: scale(1.06); }
.sim-btn .icon { width: 20px; height: 20px; }
.sim-range { display: flex; align-items: center; gap: .5rem; font-size: .85rem; color: var(--lichen); font-weight: 700; }
.sim-range input { accent-color: var(--ochre); width: 120px; }
.sim-range output { color: var(--cream); min-width: 2.4em; font-variant-numeric: tabular-nums; }
.sim-tools { display: flex; flex-wrap: wrap; gap: .4rem; margin-left: auto; align-items: center; }
.sim-sep { width: 1px; height: 26px; margin: 0 .2rem; background: color-mix(in srgb, var(--cream) 20%, transparent); }

.sim-stage { display: grid; grid-template-columns: minmax(0, 1fr) 350px; gap: 1rem; align-items: start; }
.sim-arena { position: relative; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); background: #e2e8cc; }
#sim-canvas { display: block; width: 100%; aspect-ratio: 8 / 5; touch-action: pan-y; user-select: none; }
#sim-canvas[data-tool="brush"], #sim-canvas[data-tool="eraser"] { cursor: crosshair; touch-action: none; }
.sim-hint {
  position: absolute; left: 12px; bottom: 10px; margin: 0; pointer-events: none;
  font-size: .78rem; font-weight: 500; color: var(--forest);
  background: rgba(246, 243, 234, .88); padding: .2rem .65rem; border-radius: 999px;
}
.sim-panel {
  background: var(--paper-2); color: var(--ink); border-radius: var(--radius); padding: .7rem;
  box-shadow: var(--shadow); max-height: var(--arena-h, 500px); overflow: auto; scrollbar-width: thin;
}
.sim-panel-title {
  display: flex; justify-content: space-between; align-items: baseline; margin: .2rem .3rem .6rem;
  font-size: .74rem; letter-spacing: .12em; text-transform: uppercase; font-weight: 700; color: var(--accent-text);
}
.sim-panel-title span { letter-spacing: .02em; text-transform: none; font-weight: 500; font-style: italic; color: var(--muted); }
.sim-agents { list-style: none; margin: 0; padding: 0; display: grid; gap: .4rem; }
.sim-agent {
  border-radius: 12px; padding: .45rem .6rem .5rem; background: var(--surface);
  border: 1px solid var(--line); border-left: 4px solid var(--c);
  transition: box-shadow .2s;
}
.sim-agent.is-hover { box-shadow: 0 0 0 2px var(--c); }
.sim-agent-head { display: flex; align-items: center; gap: .4rem; font-size: .8rem; min-width: 0; }
.sim-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c); flex: none; }
.sim-name { font-weight: 700; }
.sim-state {
  font-size: .7rem; color: var(--muted); background: var(--sage); border-radius: 999px; padding: 0 .45rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 9.5em;
}
.sim-state.is-talk { background: var(--c); color: #fff; }
.sim-chip { display: inline-flex; align-items: center; gap: .2rem; color: var(--muted); font-size: .74rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sim-push { margin-left: auto; }
.sim-agent .icon { color: var(--c); width: 15px; height: 15px; }
.sim-agent-signals { display: flex; align-items: center; gap: .6rem; margin-top: .3rem; }
.sim-sig { display: inline-flex; align-items: center; gap: .3rem; }
.sim-sig-eeg { flex: 1; min-width: 0; align-items: center; gap: .4rem; }
.sim-topos { display: flex; gap: .25rem; flex: none; }
.sim-topo { display: grid; justify-items: center; line-height: 1; }
.sim-topo canvas { width: 34px; height: 37px; display: block; }
.sim-topo small { font-size: .68rem; font-weight: 700; color: var(--muted); margin-top: 1px; }
.sim-sig-eeg canvas.sim-traces { height: 54px; }
.sim-agent-physio { display: flex; align-items: center; gap: 1rem; margin-top: .25rem; padding-left: .1rem; }
.sim-agent-physio .sim-sig-hr { min-width: 0; justify-content: flex-start; }
.sim-topo-legend {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .3rem .6rem;
  margin: -.2rem .3rem .6rem; font-size: .72rem; color: var(--muted);
}
.sim-topo-scale { display: inline-flex; align-items: center; gap: .35rem; }
.sim-topo-scale i { width: 70px; height: 8px; border-radius: 999px; background: linear-gradient(90deg, rgb(76,116,204), rgb(250,249,245), rgb(214,74,60)); box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); }
.sim-sig-eeg canvas.sim-traces {
  flex: 1; min-width: 0; width: 100%; height: 54px; display: block; border-radius: 6px;
  background:
    linear-gradient(transparent calc(50% - .5px), rgba(31, 59, 45, .1) calc(50% - .5px) calc(50% + .5px), transparent calc(50% + .5px)),
    repeating-linear-gradient(90deg, transparent 0 22px, rgba(31, 59, 45, .06) 22px 23px),
    var(--paper);
}
.sim-sig-hr { min-width: 76px; justify-content: flex-end; font-variant-numeric: tabular-nums; }
.sim-sig-hr b { font-family: var(--font-display); font-size: 1.05rem; color: var(--ink); min-width: 1.6em; text-align: right; }
.sim-sig-hr small { color: var(--muted); font-size: .7rem; }
.sim-agent .sim-heart { fill: var(--c); width: 17px; height: 17px; transform-origin: 50% 55%; }
.sim.hide-gaze [data-layer="gaze"], .sim.hide-eeg [data-layer="eeg"],
.sim.hide-location [data-layer="location"], .sim.hide-physio [data-layer="physio"] { display: none; }
.sim.hide-gaze .sim-chip[data-layer="location"] { margin-left: auto; }

.sim-modalities { display: grid; grid-template-columns: repeat(4, 1fr); gap: .7rem; }
.sim-modality {
  position: relative; text-align: left; cursor: pointer; color: inherit;
  border: 1px solid color-mix(in srgb, var(--cream) 16%, transparent);
  background: color-mix(in srgb, var(--cream) 4%, transparent);
  border-radius: 14px; padding: .75rem 3.4rem .8rem .8rem; display: grid; gap: .35rem .65rem; align-content: start;
  grid-template-columns: auto 1fr; align-items: center;
  transition: background .25s, border-color .25s, opacity .25s;
}
.sim-modality p { grid-column: 1 / -1; }
.sim-modality:hover { background: color-mix(in srgb, var(--cream) 10%, transparent); }
.sim-modality[aria-pressed="true"] { border-color: color-mix(in srgb, var(--lichen) 70%, transparent); background: var(--forest-2); }
.sim-modality[aria-pressed="false"] { opacity: .62; }
.sim-modality-icon {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  background: color-mix(in srgb, var(--lichen) 20%, transparent); color: var(--lichen);
}
.sim-modality-icon .icon { width: 19px; height: 19px; }
.sim-modality h3 { color: var(--cream); font-size: 1rem; margin: 0; }
.sim-modality p { margin: 0; font-size: .8rem; line-height: 1.45; color: color-mix(in srgb, var(--cream) 74%, transparent); }
.sim-switch {
  position: absolute; top: .9rem; right: .8rem; width: 36px; height: 20px; border-radius: 999px;
  background: color-mix(in srgb, var(--cream) 22%, transparent); transition: background .25s;
}
.sim-switch::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%;
  background: var(--cream); transition: transform .25s var(--ease);
}
.sim-modality[aria-pressed="true"] .sim-switch { background: var(--ochre); }
.sim-modality[aria-pressed="true"] .sim-switch::after { transform: translateX(16px); }
.sim-state.is-rest { background: color-mix(in srgb, var(--fern) 30%, var(--paper-2)); color: var(--heading); }
.sim-green { min-width: 3.2em; justify-content: flex-end; }

/* first-person (scene camera) view */
.sim-pov {
  position: absolute; top: 10px; right: 10px; z-index: 2; width: min(46%, 440px);
  border-radius: 12px; overflow: hidden; background: #14261d;
  border: 2px solid var(--c, var(--ochre)); box-shadow: 0 14px 34px rgba(0, 0, 0, .35);
}
.sim-pov[hidden] { display: none; }
.sim-pov canvas { display: block; width: 100%; aspect-ratio: 16 / 10; }
.sim-pov-bar {
  display: flex; align-items: center; gap: .45rem; padding: .28rem .35rem .28rem .65rem;
  font-size: .74rem; font-weight: 700; color: var(--cream); background: rgba(20, 38, 29, .94);
}
.sim-pov-rec { width: 8px; height: 8px; border-radius: 50%; background: #e0523a; flex: none; animation: sim-rec 1.2s steps(2) infinite; }
@keyframes sim-rec { 50% { opacity: .2; } }
.sim-pov-close {
  margin-left: auto; width: 26px; height: 26px; border-radius: 50%; border: 0; cursor: pointer;
  display: grid; place-items: center; background: rgba(246, 243, 234, .12); color: var(--cream);
}
.sim-pov-close:hover { background: rgba(246, 243, 234, .25); }
.sim-pov-close .icon { width: 14px; height: 14px; }
.sim-who {
  display: inline-flex; align-items: center; gap: .35rem; border: 0; background: transparent; cursor: pointer;
  padding: .1rem .4rem .1rem .15rem; margin-left: -.15rem; border-radius: 999px; color: inherit; font: inherit;
}
.sim-who:hover, .sim-agent.is-pov .sim-who { background: color-mix(in srgb, var(--c) 18%, transparent); }
.sim-agent .sim-cam { width: 14px; height: 14px; animation: sim-cam-flash 1.3s steps(1) infinite; }
@keyframes sim-cam-flash { 0% { fill: currentColor; } 50% { fill: none; } }
.sim-agent.is-pov { box-shadow: 0 0 0 2px var(--c); }
.sim-agent.is-pov .sim-cam { animation: none; fill: currentColor; }

.sim-analysis { display: grid; grid-template-columns: 1fr; gap: 1rem; }
.sim-measure-groups { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem 1.2rem; }
.sim-measure-plain { grid-column: 1 / -1; justify-self: start; min-width: 16rem; }
.sim-group-title { margin: 0 0 .45rem; font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; font-weight: 700; color: color-mix(in srgb, var(--cream) 70%, transparent); }
.sim-measure-foot { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: .4rem 1rem; }
.sim-measure-foot .sim-measure-desc { flex: 1 1 26rem; }
.sim-rec { display: flex; align-items: center; gap: .6rem; margin: .6rem 0 0; font-size: .8rem; color: color-mix(in srgb, var(--cream) 70%, transparent); }
.sim-rec[hidden] { display: none; }
.sim-rec .sim-mini-btn { margin-left: 0; }
.sim-range .icon { width: 15px; height: 15px; vertical-align: -3px; }
.sim-card {
  border-radius: var(--radius); padding: 1rem 1.1rem 1.1rem; color: var(--cream);
  background: color-mix(in srgb, var(--cream) 5%, transparent);
  border: 1px solid color-mix(in srgb, var(--cream) 14%, transparent);
}
.sim-card-title {
  display: flex; align-items: baseline; flex-wrap: wrap; gap: .3rem .6rem; margin: 0 0 .8rem;
  font-size: .74rem; letter-spacing: .12em; text-transform: uppercase; font-weight: 700; color: var(--lichen);
}
.sim-card-title span { text-transform: none; letter-spacing: .02em; font-weight: 500; font-style: italic; color: color-mix(in srgb, var(--cream) 62%, transparent); }
.sim-mini-btn {
  margin-left: auto; border: 1px solid color-mix(in srgb, var(--cream) 25%, transparent); background: transparent;
  color: var(--cream); border-radius: 999px; padding: .15rem .7rem; font-size: .75rem; letter-spacing: .04em; text-transform: none; cursor: pointer;
}
.sim-mini-btn:hover { background: color-mix(in srgb, var(--cream) 12%, transparent); }
.sim-measures { display: grid; grid-template-columns: 1fr 1fr; gap: .45rem; }
.sim-measure {
  display: flex; align-items: center; gap: .65rem; text-align: left; cursor: pointer; color: var(--cream);
  padding: .5rem .7rem; border-radius: 12px; background: transparent;
  border: 1px solid color-mix(in srgb, var(--cream) 14%, transparent);
  transition: background .2s, border-color .2s;
}
.sim-measure:hover { background: color-mix(in srgb, var(--cream) 8%, transparent); }
.sim-measure[aria-checked="true"] { border-color: var(--ochre); background: color-mix(in srgb, var(--ochre) 14%, transparent); }
.sim-measure b { display: block; font-size: .9rem; line-height: 1.25; }
.sim-measure small { display: block; font-size: .74rem; opacity: .65; line-height: 1.3; }
.sim-radio { width: 16px; height: 16px; flex: none; border-radius: 50%; border: 2px solid color-mix(in srgb, var(--cream) 45%, transparent); }
.sim-measure[aria-checked="true"] .sim-radio { border-color: var(--ochre); background: radial-gradient(circle, var(--ochre) 0 3.5px, transparent 4.5px); }
.sim-colorbar { display: flex; align-items: center; gap: .6rem; margin-top: .8rem; font-size: .74rem; color: color-mix(in srgb, var(--cream) 65%, transparent); }
.sim-colorbar[hidden] { display: none; }
.sim-colorbar i { flex: 1; height: 10px; border-radius: 999px; }
.sim-measure-desc { margin: .6rem 0 0; font-size: .86rem; line-height: 1.5; min-height: 2.6em; color: color-mix(in srgb, var(--cream) 78%, transparent); }
#sim-occ { display: block; width: 100%; border-radius: 12px; background: #e8e1cf; }

.sim-note { margin: 0; font-size: .8rem; font-style: italic; color: color-mix(in srgb, var(--cream) 58%, transparent); }

/* ==========================================================================
   Journey: timeline + globe
   ========================================================================== */
.journey-layout {
  display: grid; grid-template-columns: minmax(340px, .95fr) minmax(0, 1.25fr); gap: 2rem; align-items: start;
}
.journey-totals { display: flex; flex-wrap: wrap; gap: .5rem 1.4rem; margin: -1rem 0 2rem; color: var(--muted); font-size: .95rem; }
.journey-totals span { display: inline-flex; align-items: center; gap: .35rem; }
.journey-totals strong { color: var(--heading); font-family: var(--font-display); font-size: 1.15rem; }

.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before {
  content: ""; position: absolute; left: 23px; top: 24px; bottom: 24px; width: 3px;
  background-image: linear-gradient(var(--lichen) 0 55%, transparent 55% 100%);
  background-size: 3px 12px;
}
.stop { position: relative; padding-left: 68px; margin-bottom: 1rem; }
.stop-node {
  position: absolute; left: 0; top: 10px; width: 49px; height: 49px; border-radius: 50%;
  display: grid; place-items: center; cursor: pointer;
  background: var(--paper-2); color: var(--accent-text); border: 3px solid var(--period, var(--lichen));
  transition: background .3s, color .3s, border-color .3s, transform .3s var(--ease);
}
.stop-node .icon { width: 24px; height: 24px; }
.stop.is-active .stop-node { background: var(--forest); color: var(--cream); border-color: var(--ochre); transform: scale(1.08); }

.stop-card {
  background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); overflow: hidden;
  transition: border-color .3s, box-shadow .3s;
}
.stop.is-active .stop-card { border-color: var(--fern); box-shadow: var(--shadow); }
.stop-head {
  width: 100%; border: 0; background: transparent; cursor: pointer; text-align: left;
  display: grid; grid-template-columns: 1fr auto; gap: .2rem 1rem; padding: 1rem 1.2rem;
}
.stop-head:hover .stop-role { color: var(--accent-text); }
.stop-dates { font-size: .8rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--rust); }
.stop-role { font-family: var(--font-display); font-size: 1.2rem; font-weight: 600; color: var(--heading); line-height: 1.25; grid-column: 1; transition: color .2s; }
.stop-inst { grid-column: 1; color: var(--muted); font-size: .95rem; line-height: 1.4; }
.stop-place { grid-column: 2; grid-row: 1 / span 3; display: flex; flex-direction: column; align-items: flex-end; gap: .35rem; font-size: .8rem; color: var(--muted); }
.flag { width: 30px; height: 21px; border-radius: 4px; object-fit: cover; box-shadow: 0 0 0 1px rgba(0,0,0,.08); }
.stop-chevron { width: 18px; height: 18px; transition: transform .4s var(--ease); color: var(--muted); }
.stop.is-active .stop-chevron { transform: rotate(90deg); color: var(--rust); }

.stop-body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .55s var(--ease); }
.stop.is-active .stop-body { grid-template-rows: 1fr; }
.stop-body > div { overflow: hidden; min-height: 0; }
.stop-content { padding: 0 1.2rem 1.3rem; }
.stop-summary { font-style: italic; color: var(--accent-text); }
.km-row { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0 0 1.1rem; }
.km-chip {
  display: inline-flex; align-items: center; gap: .4rem; padding: .3rem .75rem; border-radius: 999px;
  background: var(--sage); color: var(--heading); font-size: .88rem;
}
.km-chip strong { font-family: var(--font-display); }
.km-chip.is-run { background: color-mix(in srgb, var(--rust) 16%, var(--paper-2)); }

.photo-strip {
  display: flex; gap: .7rem; overflow-x: auto; scroll-snap-type: x mandatory;
  margin: 0 -1.2rem 1rem; padding: 0 1.2rem .5rem; scrollbar-width: thin;
}
.photo-strip figure { margin: 0; flex: 0 0 82%; scroll-snap-align: start; }
.photo-strip img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: var(--radius-sm); }
.photo-strip figcaption { font-size: .82rem; color: var(--muted); margin-top: .3rem; }

.map-wrap {
  position: sticky; top: calc(var(--header-h) + 16px);
  height: calc(100vh - var(--header-h) - 32px); min-height: 440px;
  border-radius: var(--radius); overflow: hidden;
  background: radial-gradient(circle at 50% 45%, #2a4b39 0%, #14261d 70%);
  box-shadow: var(--shadow); border: 1px solid var(--forest);
}
.map { position: absolute; inset: 0; }
.map-overlay {
  position: absolute; left: 12px; right: 12px; top: 12px; z-index: 2; pointer-events: none;
  display: flex; justify-content: space-between; align-items: flex-start; gap: .5rem;
}
.map-overlay > * { pointer-events: auto; }
.map-legend, .map-reset {
  background: color-mix(in srgb, var(--paper) 92%, transparent); backdrop-filter: blur(6px);
  border-radius: 12px; padding: .5rem .8rem; font-size: .82rem; box-shadow: var(--shadow-sm); border: 0;
}
.map-legend { display: grid; gap: .2rem; }
.map-legend span { display: flex; align-items: center; gap: .5rem; }
.map-legend i { display: inline-block; width: 18px; height: 3px; border-radius: 2px; }
.map-reset { cursor: pointer; display: inline-flex; align-items: center; gap: .4rem; font-weight: 700; color: var(--heading); }
.map-reset:hover { background: var(--surface); }
.map-sample {
  position: absolute; left: 12px; bottom: 12px; z-index: 2; margin: 0;
  background: var(--ochre); color: var(--forest); font-size: .78rem; font-weight: 700;
  padding: .25rem .7rem; border-radius: 999px;
}
.map-fallback {
  position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 2rem;
  color: var(--cream);
}
.map-marker {
  width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; cursor: pointer;
  background: var(--paper-2); color: var(--heading); border: 3px solid var(--ochre);
  box-shadow: 0 4px 14px rgba(0,0,0,.35); transition: transform .3s var(--ease), background .3s, color .3s;
  padding: 0;
}
.map-marker .icon { width: 20px; height: 20px; }
.map-marker:hover { transform: scale(1.12); }
.map-marker.is-active { background: var(--forest); color: var(--cream); transform: scale(1.2); }
.maplibregl-ctrl-attrib { font-size: 11px; }

/* ==========================================================================
   Other projects: vignettes + zoom dialog
   ========================================================================== */
.vignette-grid { display: grid; gap: .9rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); }
.vignette {
  position: relative; border: 0; padding: 0; cursor: zoom-in; text-align: left; width: 100%;
  border-radius: var(--radius); overflow: hidden; aspect-ratio: 1 / 1.08; background: var(--forest);
  box-shadow: var(--shadow-sm); transition: transform .45s var(--ease), box-shadow .45s var(--ease);
}
.vignette:focus-visible { outline: 3px solid var(--ochre); outline-offset: 3px; }
.vignette img { width: 100%; height: 100%; object-fit: cover; transition: transform .9s var(--ease); }
.vignette::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(20, 38, 29, 0) 22%, rgba(20, 38, 29, .68) 58%, rgba(20, 38, 29, .96)); }
.vignette-body { text-shadow: 0 1px 12px rgba(10, 20, 15, .55); }
.vignette:hover { box-shadow: var(--shadow); }
.vignette:hover img { transform: scale(1.07); }
.vignette-body { position: absolute; inset: auto 0 0 0; z-index: 1; padding: 1.2rem; color: var(--cream); }
.vignette-kicker { font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--lichen); font-weight: 700; display: block; }
.vignette-title { font-family: var(--font-display); font-size: 1.2rem; font-weight: 600; display: block; line-height: 1.2; margin: .2rem 0 .3rem; }
.vignette-summary { font-size: .9rem; opacity: .85; display: block; line-height: 1.4; }

.vignette-dialog {
  width: min(960px, 100% - 2rem); max-height: calc(100vh - 2rem); padding: 0; border: 0;
  border-radius: var(--radius); background: var(--paper-2); color: var(--ink);
  box-shadow: 0 40px 120px -20px rgba(0,0,0,.5); overflow: auto; overscroll-behavior: contain;
}
.vignette-dialog::backdrop { background: rgba(20, 38, 29, .65); backdrop-filter: blur(4px); }
.dialog-hero { position: relative; aspect-ratio: 16 / 7; overflow: hidden; }
.dialog-hero img { width: 100%; height: 100%; object-fit: cover; }
.dialog-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 40%, rgba(20, 38, 29, .85)); }
.dialog-hero-text { position: absolute; left: 2rem; bottom: 1.4rem; right: 2rem; z-index: 1; color: var(--cream); }
.dialog-hero-text h2 { color: var(--cream); font-size: clamp(1.8rem, 4vw, 2.8rem); margin: .2rem 0 0; }
.dialog-close {
  position: absolute; top: 1rem; right: 1rem; z-index: 3; width: 42px; height: 42px; border-radius: 50%;
  border: 0; cursor: pointer; display: grid; place-items: center;
  background: rgba(246, 243, 234, .92); color: var(--forest); box-shadow: var(--shadow-sm);
}
.dialog-close:hover { background: #fff; }
.dialog-body { padding: 2rem; display: grid; gap: 1.8rem; }
.dialog-body > p:last-child { margin-bottom: 0; }
.gallery { display: grid; gap: .8rem; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.gallery figure { margin: 0; }
.gallery img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: var(--radius-sm); }
.gallery figcaption { font-size: .82rem; color: var(--muted); margin-top: .3rem; }

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer { position: relative; background: var(--forest); color: color-mix(in srgb, var(--cream) 85%, transparent); padding: 4rem 0 5rem; overflow: hidden; }
.site-footer a { color: var(--lichen); }
.site-footer a:hover { color: #fff; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 2rem; position: relative; z-index: 1; }
.footer-name { font-family: var(--font-display); font-size: 1.5rem; color: var(--cream); margin-bottom: .3rem; }
.footer-label { font-size: .75rem; letter-spacing: .14em; text-transform: uppercase; color: var(--lichen); font-weight: 700; margin-bottom: .4rem; }
.footer-hills { position: absolute; left: 0; bottom: 0; width: 100%; height: 60px; }
.footer-hills path { fill: var(--forest-2); }


/* ==========================================================================
   Journey periods: each position has its own pastel (set in content/site.js)
   ========================================================================== */
.stop { --period: var(--lichen); }
.stop-card {
  background: color-mix(in srgb, var(--period) 20%, var(--paper-2));
  border-color: color-mix(in srgb, var(--period) 55%, var(--line));
}
.stop-node { border-color: var(--period); }
.stop.is-active .stop-node { border-color: var(--period); }
.stop.is-active .stop-card {
  border-color: var(--period);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--period) 70%, transparent), var(--shadow);
}
.km-chip { background: color-mix(in srgb, var(--period, var(--sage)) 34%, var(--paper-2)); }
.km-chip.is-run { background: color-mix(in srgb, var(--period, var(--rust)) 55%, var(--paper-2)); }
.map-marker { border-color: var(--period, var(--ochre)); }
.map-marker.is-active { border-color: var(--period, var(--ochre)); box-shadow: 0 0 0 4px color-mix(in srgb, var(--period, var(--ochre)) 55%, transparent), 0 4px 14px rgba(0,0,0,.35); }
.map-legend .swatch { width: 11px; height: 11px; border-radius: 50%; flex: none; }
.map-legend .is-faded { opacity: .55; }

/* ==========================================================================
   Dark mode
   ========================================================================== */
[data-theme="dark"] {
  color-scheme: dark;
  --paper: #121a15;
  --paper-2: #1a241d;
  --sage: #162019;
  --ink: #e2e2d5;
  --muted: #a3ad9d;
  --line: #2e3c32;
  --heading: #eef0e2;
  --surface: #223028;
  --accent-text: #a9c98f;
  --link: #8fc6c4;
  --shadow: 0 18px 50px -20px rgba(0, 0, 0, .7);
  --shadow-sm: 0 6px 18px -8px rgba(0, 0, 0, .7);
}
[data-theme="dark"] .section-about {
  background:
    radial-gradient(900px 500px at 85% 10%, rgba(111, 154, 91, .16), transparent 70%),
    radial-gradient(700px 400px at 0% 90%, rgba(47, 111, 115, .18), transparent 70%),
    var(--paper);
}
[data-theme="dark"] .pill-primary { background: var(--lichen); color: var(--forest); border-color: var(--lichen); }
[data-theme="dark"] .pill-primary:hover { background: #d3dfae; color: var(--forest); }
[data-theme="dark"] .runner .leg line, [data-theme="dark"] .runner .shorts { stroke: #d8dcc6; fill: #d8dcc6; }
[data-theme="dark"] .runner .leg-back line { stroke: #9ba795; }
[data-theme="dark"] .runner-shadow { background: rgba(0, 0, 0, .45); }
[data-theme="dark"] .vignette { box-shadow: 0 0 0 1px var(--line), var(--shadow-sm); }
[data-theme="dark"] .section-forest { background: #183126; }
[data-theme="dark"] .terrain-to-forest path { fill: #183126; }
[data-theme="dark"] #sim-canvas, [data-theme="dark"] #sim-occ { filter: brightness(.84) saturate(.92); }
[data-theme="dark"] .sim-hint { background: rgba(18, 26, 21, .85); color: var(--ink); }
[data-theme="dark"] .site-footer { background: #0d1410; }
[data-theme="dark"] .footer-hills path { fill: #15201a; }
[data-theme="dark"] .map-wrap { border-color: var(--line); }
[data-theme="dark"] .maplibregl-ctrl-group { background: #1a241d; }
[data-theme="dark"] .maplibregl-ctrl-group button + button { border-top-color: #2e3c32; }
[data-theme="dark"] .maplibregl-ctrl button .maplibregl-ctrl-icon { filter: invert(.9); }
[data-theme="dark"] .maplibregl-ctrl-attrib { background: rgba(18, 26, 21, .8); color: #b9c0b2; }
[data-theme="dark"] .maplibregl-ctrl-attrib a { color: #cdd5c4; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1080px) {
  .sim-stage { grid-template-columns: 1fr; }
  .sim-panel { max-height: 380px; }
  .sim-agents { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
  .sim-modalities { grid-template-columns: repeat(2, 1fr); }
  .sim-measure-groups { grid-template-columns: 1fr; }
}
@media (max-width: 960px) {
  .about-grid { grid-template-columns: 1fr; }
  .about-visual { max-width: 400px; margin-inline: auto; width: 100%; }
  .portrait { position: relative; top: 0; width: 140px; margin-bottom: -40px; }
  .sport-card { grid-template-columns: 1fr; gap: 1.2rem; }
  .sport-stats div { text-align: left; }
  .panel-inner { grid-template-columns: 1fr; padding: 1.6rem 1.3rem; }
  .journey-layout { grid-template-columns: 1fr; }
  .map-wrap { order: -1; top: var(--header-h); height: 46vh; min-height: 300px; z-index: 5; border-radius: var(--radius-sm); }
  .footer-grid { grid-template-columns: 1fr; }
}
@media (641px <= width <= 820px) {
  .header-inner { gap: .65rem; }
  .brand { font-size: 1.05rem; }
  .brand-brain { width: 64px; }
  .nav { gap: clamp(.4rem, 1.25vw, .85rem); }
  .nav a { font-size: .9rem; }
}
@media (max-width: 640px) {
  :root { --header-h: 62px; }
  .trail .runner { width: 34px; height: 40px; }
  body { font-size: 16px; }
  .header-inner { width: calc(100% - 1.25rem); }
  .header-inner { gap: .45rem; }
  .brand { align-items: flex-start; }
  .brand-name { display: none; }
  .brand-brain { width: 40px; margin-top: 6px; }
  .theme-toggle { width: 32px; height: 32px; }
  .nav { gap: clamp(.25rem, 1.3vw, .65rem); }
  .nav a { font-size: .84rem; padding-inline: .1rem; }
  .sim-modalities { grid-template-columns: 1fr 1fr; gap: .5rem; }
  .sim-modality { padding: .6rem 3rem .6rem .6rem; }
  .sim-modality p { display: none; }
  .sim-modality h3 { font-size: .88rem; line-height: 1.2; }
  .sim-modality-icon { width: 28px; height: 28px; }
  .sim-switch { top: 50%; margin-top: -10px; right: .55rem; }
  .sim-measures { grid-template-columns: 1fr; }
  .sim-btn { width: 36px; height: 36px; }

  .sim-toolbar { gap: .5rem .9rem; }
  .sim-tools { margin-left: 0; }
  .sim-range input { width: 92px; }
  .sim-hint { font-size: .7rem; }
  .section { padding: 4rem 0 5.5rem; }
  .vignette-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem; }
  .vignette-body { padding: .8rem; }
  .vignette-title { font-size: 1.1rem; }
  .vignette-summary { display: none; }
  .dialog-body { padding: 1.3rem; }
  .stop { padding-left: 0; }
  .timeline::before, .stop-node { display: none; }
  .sport-stats { flex-wrap: wrap; gap: 1rem; }
  .map-legend { font-size: .72rem; padding: .4rem .6rem; }
  .map-reset { padding: .5rem; }
  .map-reset-label { display: none; }
}
@media (max-width: 440px) {
  .affiliation-label { display: none; }
  .affiliation-logo--cambridge { width: clamp(100px, 34vw, 126px); }
  .affiliation-logo--neurocivitas { width: clamp(82px, 27vw, 104px); }
}
@media (max-width: 390px) {
  .header-inner { gap: .25rem; }
  .brand-brain { width: 36px; }
  .nav a { font-size: .78rem; padding-inline: 0; }
}
@media (max-width: 350px) {
  .header-inner { width: calc(100% - 1rem); }
  .brand-brain { width: 32px; }
  .nav { gap: .18rem; }
  .nav a { font-size: .74rem; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .reveal { opacity: 1; transform: none; }
  .trail .runner .leg-front { transform: rotate(-38deg); }
  .trail .runner .leg-back { transform: rotate(31deg); }
  .trail .runner .leg-back .shin { transform: rotate(64deg); }
  .trail .runner .arm-front { transform: rotate(34deg); }
  .trail .runner .arm-back { transform: rotate(-44deg); }
}

/* scenery along the header trail */
.trail-scenery { position: absolute; left: 0; top: 0; pointer-events: none; }
.trail-scenery > g { opacity: .8; }
.sc-forest path { fill: color-mix(in srgb, var(--fern) 70%, transparent); }
.sc-surf-far { fill: color-mix(in srgb, var(--river-soft) 82%, transparent); }
.sc-surf-near { fill: color-mix(in srgb, var(--river) 36%, transparent); }
.sc-surf-trace { fill: none; stroke: var(--river); stroke-width: 1.15; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.sc-city rect { fill: color-mix(in srgb, var(--muted) 40%, transparent); }
.sc-win { stroke: #e9c97a; stroke-width: 1.4; }
.sc-mount path { fill: color-mix(in srgb, var(--river) 35%, transparent); }
.sc-mount .sc-snow { fill: #f4f1e8; }
.sc-moon-disc { fill: #e7d593; }
.sc-star { fill: #d2ad52; }
.sc-hill { fill: color-mix(in srgb, var(--forest) 30%, transparent); }

.project-grid { position: relative; }

/* first-person view now sits at the top of the side panel */
.sim-pov { position: sticky; top: 0; right: auto; width: 100%; margin: 0 0 .7rem; }
/* the hint fades after a few seconds */
.sim-hint { opacity: 0; transition: opacity .5s; }
.sim-hint.is-visible { opacity: 1; }

/* ==========================================================================
   Round 3: Mind · Body · Environment triad, brand brain, denser layout
   ========================================================================== */
/* brand mark: see "Round 4" below */

/* portrait next to the name */
.about-id { display: flex; align-items: center; gap: 1.1rem; margin-bottom: .9rem; }
.about-id .portrait {
  position: static; inset: auto; margin: 0; flex: none; width: clamp(70px, 8.5vw, 100px);
  border-width: 4px; box-shadow: var(--shadow-sm);
}
.about-id .about-name { margin-bottom: .1rem; }

/* ---------- denser layout ---------- */
body { font-size: 16px; line-height: 1.55; }
.section { padding: 3rem 0 4rem; }
.section-head { margin-bottom: 1.3rem; }
.section-head h2 { font-size: clamp(1.9rem, 3.4vw, 2.5rem); margin-bottom: .25em; }
.section-lede { font-size: 1rem; margin-bottom: .3rem; }
.kicker { margin-bottom: .35rem; }
.terrain { height: 40px; }
.section-about { padding-top: calc(var(--header-h) + 1.5rem); }
.about-grid { gap: clamp(1.5rem, 4vw, 3rem); }
.about-name { font-size: clamp(2.2rem, 4.8vw, 3.5rem); }
.about-role { margin-bottom: 0; }
.about-headline { font-size: clamp(1.15rem, 1.9vw, 1.4rem); margin-bottom: .7rem; }
.about-paragraphs p { margin-bottom: .7em; }
.contact-links { margin-top: .9rem; }
.sport-card { margin-top: 1.4rem; padding: .6rem 1.2rem; gap: 1.1rem; border-radius: 14px; }
.sport-card::after { display: none; }
.sport-card h2 { font-size: 1.05rem; margin-bottom: .05rem; }
.sport-card p { font-size: .86rem; line-height: 1.4; }
.sport-icons { gap: .3rem; }
.sport-icons span { width: 30px; height: 30px; }
.sport-icons .icon { width: 17px; height: 17px; }
.sport-stats { gap: 1rem; }
.sport-stats dt { font-size: .64rem; }
.sport-stats dd { font-size: 1.2rem; }
.panel-inner { padding: 1.3rem 1.5rem; gap: 1.5rem; }
.panel-inner h3 { font-size: 1.45rem; }
.journey-totals { margin: -.3rem 0 1.1rem; }
.stop { margin-bottom: .55rem; }
.stop-head { padding: .65rem .95rem; }
.stop-role { font-size: 1.05rem; }
.stop-content { padding: 0 .95rem 1rem; }
.site-footer { padding: 2.2rem 0 3.2rem; }
@media (min-width: 641px) {
  .stop { padding-left: 56px; }
  .stop-node { width: 42px; height: 42px; top: 6px; }
  .timeline::before { left: 20px; top: 20px; }
  #vignettes .vignette:nth-child(even) { translate: 0 .8rem; }
}
@media (max-width: 960px) {
  .about-visual { max-width: 380px; }
}
@media (max-width: 640px) {
  .sport-card { padding: .7rem 1rem; gap: .5rem; }
  .sport-icons { display: none; }
  .sport-card p { font-size: .82rem; }
  .sport-stats dd { font-size: 1.05rem; }
}

/* ==========================================================================
   Collaborations on the globe
   ========================================================================== */
/* collaborations & lab visits on the globe */
.map-link {
  width: 26px; height: 26px; padding: 0; cursor: pointer; display: grid; place-items: center;
  border-radius: 50%; border: 2px solid var(--period, var(--ochre));
  background: var(--paper-2); color: var(--heading);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--period, var(--ochre)) 30%, transparent), 0 3px 10px rgba(0, 0, 0, .35);
  transition: transform .3s var(--ease), opacity .3s, background .3s;
}
.map-link.is-visit { border-radius: 7px; }
.map-link .icon { width: 14px; height: 14px; }
.map-link:hover, .map-link.is-open { transform: scale(1.18); background: color-mix(in srgb, var(--period, var(--ochre)) 45%, var(--paper-2)); }
.map-link.is-faded { opacity: .35; }
.map-popup .maplibregl-popup-content {
  background: var(--paper-2); color: var(--ink); border-radius: 12px; padding: .7rem 2rem .75rem .9rem;
  box-shadow: var(--shadow); border-top: 4px solid var(--period, var(--ochre));
  font-family: var(--font-body); font-size: .86rem; line-height: 1.4;
}
.map-popup .maplibregl-popup-tip { display: none; }
.map-popup .maplibregl-popup-close-button { color: var(--muted); font-size: 1.2rem; width: 26px; height: 26px; right: 4px; top: 4px; border-radius: 50%; }
.map-popup .maplibregl-popup-close-button:hover { background: var(--surface); color: var(--heading); }
.conn-popup { border-top: 0; }
.conn-popup p { margin: 0; }
.conn-popup-kicker { display: flex; align-items: center; gap: .35rem; font-size: .7rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--accent-text); margin-bottom: .25rem !important; }
.conn-popup-title { font-family: var(--font-display); font-weight: 600; font-size: 1.02rem; color: var(--heading); }
.conn-popup-unit, .conn-popup-place { color: var(--muted); }
.conn-popup-people { margin-top: .35rem !important; }
.map-legend .lg-kinds { display: flex; flex-wrap: wrap; gap: .25rem .8rem; margin-top: .15rem; padding-top: .3rem; border-top: 1px solid var(--line); }
.lg-mark { display: inline-block; flex: none; width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--ochre); background: var(--paper-2); }
.lg-mark.lg-chapter { width: 14px; height: 14px; border-width: 3px; }
.lg-mark.lg-collab { width: 11px; height: 11px; }
.lg-mark.lg-visit { width: 11px; height: 11px; border-radius: 3px; }

/* list of connections in a journey card */
.conn-list { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; gap: .55rem; }
.conn { display: flex; gap: .6rem; align-items: flex-start; font-size: .92rem; line-height: 1.4; }
.conn > span:last-child { display: grid; }
.conn-icon {
  flex: none; width: 28px; height: 28px; display: grid; place-items: center; margin-top: .1rem;
  border: 2px solid var(--period, var(--ochre)); border-radius: 50%; background: var(--paper-2); color: var(--heading);
}
.conn.is-visit .conn-icon { border-radius: 8px; }
.conn-icon .icon { width: 15px; height: 15px; }
.conn-place {
  border: 0; background: none; padding: 0; cursor: pointer; text-align: left;
  font-weight: 700; color: var(--heading); text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--period, var(--ochre)) 80%, transparent);
  text-decoration-thickness: 2px; text-underline-offset: 3px;
}
.conn-place:hover { color: var(--link); }
.conn-meta { color: var(--muted); font-size: .82rem; }
.conn-people { font-size: .88rem; }

/* fellowship line under the role */
.about-fellowship { font-size: .92rem; margin-top: .1rem; }

/* open science: societies & commissions of trust (read from a CSV) */
.initiatives { display: grid; gap: 1.4rem; }
.init-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .1rem; }
.init { display: grid; grid-template-columns: 7.5rem 1fr; gap: 1rem; padding: .65rem 0; border-top: 1px solid var(--line); }
.init:first-child { border-top: 0; }
.init p { margin: 0; }
.init-years { font-size: .82rem; font-weight: 700; color: var(--accent-text); padding-top: .15rem; font-variant-numeric: tabular-nums; }
.init-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: .3rem .6rem; }
.init-name { font-family: var(--font-display); font-weight: 600; font-size: 1.08rem; color: var(--heading); }
a.init-name { text-decoration: none; display: inline-flex; align-items: center; gap: .3rem; }
a.init-name .icon { width: .85em; height: .85em; opacity: .6; }
a.init-name:hover { color: var(--link); text-decoration: underline; }
.init-role {
  font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  padding: .1rem .55rem; border-radius: 999px; background: color-mix(in srgb, var(--lichen) 35%, transparent); color: var(--heading);
}
.init-full { color: var(--muted); font-size: .9rem; }
.init-desc { font-size: .92rem; margin-top: .2rem !important; }
@media (max-width: 640px) {
  .init { grid-template-columns: 1fr; gap: .15rem; }
}

.tile-pubs[hidden] { display: none !important; }

/* ---------- legend: chapters are buttons; runs vs rides ---------- */
.lg-stop {
  display: flex; align-items: center; gap: .5rem; width: 100%; text-align: left; cursor: pointer;
  border: 0; background: none; padding: .12rem .35rem; margin: 0 -.35rem; border-radius: 7px; font: inherit; color: inherit;
}
.lg-stop:hover { background: color-mix(in srgb, var(--heading) 9%, transparent); }
.lg-stop.is-on { background: color-mix(in srgb, var(--heading) 13%, transparent); font-weight: 700; }
.lg-stop.is-faded { opacity: .55; }
.lg-line { display: inline-block; width: 18px; height: 3.4px !important; border-radius: 2px; background: var(--heading); }
.lg-line.is-thin { height: 1.6px !important; }

/* ---------- km-per-year breakdown on the map ---------- */
:root { --sp-swim: #2a7fb8; --sp-bike: #b07a12; --sp-run: #b5457e; }
[data-theme="dark"] { --sp-swim: #4a9ad3; --sp-bike: #c4952a; --sp-run: #c56fc0; }
.map-stats {
  position: absolute; left: 12px; bottom: 12px; z-index: 2; width: min(330px, calc(100% - 24px));
  background: color-mix(in srgb, var(--paper) 94%, transparent); backdrop-filter: blur(6px);
  border-radius: 12px; padding: .6rem .8rem .55rem; box-shadow: var(--shadow-sm);
  border-top: 3px solid var(--period, var(--ochre)); font-size: .8rem;
}
.map-stats[hidden] { display: none; }
.stats-title { display: flex; align-items: center; gap: .45rem; margin: 0 0 .45rem; font-weight: 700; color: var(--heading); }
.stats-title .swatch { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.stats-close { margin-left: auto; border: 0; background: none; color: var(--muted); cursor: pointer; padding: 2px; border-radius: 50%; display: grid; }
.stats-close:hover { color: var(--heading); background: color-mix(in srgb, var(--heading) 10%, transparent); }
.stats-close .icon { width: 15px; height: 15px; }
.stats-rows { display: grid; gap: .3rem; }
.stats-row { display: grid; grid-template-columns: 4.3rem 1fr 4.6rem; align-items: end; gap: .5rem; }
.stats-label { display: flex; align-items: center; gap: .3rem; color: var(--ink); padding-bottom: 1px; }
.stats-label .icon { width: 14px; height: 14px; color: var(--muted); }
.stats-key { width: 8px; height: 8px; border-radius: 2px; flex: none; }
.stats-bars { width: 100%; height: 34px; display: block; overflow: visible; }
.stats-base { stroke: color-mix(in srgb, var(--heading) 25%, transparent); stroke-width: 1; vector-effect: non-scaling-stroke; }
.stats-hit { fill: transparent; }
.stats-col.is-hover .stats-hit { fill: color-mix(in srgb, var(--heading) 8%, transparent); }
.sp-swim { fill: var(--sp-swim); background: var(--sp-swim); }
.sp-bike { fill: var(--sp-bike); background: var(--sp-bike); }
.sp-run { fill: var(--sp-run); background: var(--sp-run); }
.stats-total { text-align: right; color: var(--muted); white-space: nowrap; padding-bottom: 1px; }
.stats-total strong { color: var(--heading); font-variant-numeric: tabular-nums; }
.stats-axis { display: flex; justify-content: space-between; margin: -.1rem 5.1rem 0 4.8rem; color: var(--muted); font-size: .72rem; font-variant-numeric: tabular-nums; }
.stats-tip { margin-top: .35rem; color: var(--heading); font-weight: 600; font-variant-numeric: tabular-nums; }
.stats-tip[hidden] { display: block; visibility: hidden; }
.stats-empty { margin: 0; color: var(--muted); }
.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; }
@media (max-width: 640px) { .map-stats { font-size: .74rem; } }

/* project panel: team and figures */
.team { margin: .4rem 0 1rem; }
.team p { margin: 0; }
.team-names { line-height: 1.5; }
.team-inst { color: var(--muted); font-size: .9rem; margin-top: .15rem !important; }
.panel-figures { margin: 0 0 1rem; }
.panel-figures img { object-fit: contain; background: #fff; }
.panel-figures.has-video { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; padding: 0; overflow: visible; }
.panel-figures.has-video img { display: block; aspect-ratio: auto; }
.panel-figures video { display: block; width: 100%; border-radius: var(--radius-sm); background: #121815; }

/* "Off the clock" now sits under the Journey title */
#journey .sport-card { margin: 0 0 1.2rem; }
.tile-vids[hidden] { display: none !important; }
/* video titles: solid translucent plate (thumbnails are often busy slides) */
.video-title { background: rgba(20, 30, 24, .82); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); line-height: 1.35; padding: .45rem .7rem; }
.video-play { top: 42%; width: 54px; height: 54px; }

/* ==========================================================================
   SSVEP playground (BCI in the sky)
   ========================================================================== */
.interactive-block { margin: .4rem 0 1.2rem; }
.ssvep {
  border: 1px solid var(--line); border-radius: 14px; background: var(--paper-2);
  padding: .75rem; display: grid; gap: .6rem;
}
.ssvep-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; }
.ssvep-modes { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 2px; background: var(--surface); }
.ssvep-seg {
  border: 0; background: none; cursor: pointer; padding: .3rem .85rem; border-radius: 999px;
  font-size: .85rem; font-weight: 600; color: var(--muted);
}
.ssvep-seg[aria-pressed="true"] { background: var(--heading); color: var(--paper); }
.ssvep-play {
  border: 0; cursor: pointer; border-radius: 999px; padding: .4rem 1rem; font-weight: 700; font-size: .88rem;
  background: var(--ochre); color: #1d1406;
}
.ssvep-play[aria-pressed="true"] { background: var(--surface); color: var(--heading); box-shadow: inset 0 0 0 1px var(--line); }
.ssvep-play:disabled { opacity: .6; cursor: default; }
.ssvep-warn { margin: 0; font-size: .78rem; color: var(--muted); line-height: 1.4; }
.ssvep-warn strong { color: var(--heading); }
.ssvep-stage { border-radius: 10px; overflow: hidden; }
.ssvep-scene { display: block; width: 100%; aspect-ratio: 16 / 9; cursor: default; }
.ssvep-plots { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.ssvep-plots figure { margin: 0; }
.ssvep-plots figcaption { font-size: .74rem; color: var(--muted); margin-bottom: .15rem; }
.ssvep-eeg, .ssvep-spec { display: block; width: 100%; height: 110px; }
.ssvep-meters { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .5rem .9rem; }
.ssvep-meter { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: .15rem .5rem; font-size: .8rem; }
.ssvep-mlabel { color: var(--muted); }
.ssvep-meter strong { color: var(--heading); font-variant-numeric: tabular-nums; }
.ssvep-mbar { grid-column: 1 / -1; height: 6px; border-radius: 3px; background: color-mix(in srgb, var(--heading) 12%, transparent); overflow: hidden; }
.ssvep-mbar i { display: block; height: 100%; border-radius: 3px; background: var(--sp-swim); transition: width .25s; }
.ssvep-meter.is-acc .ssvep-mbar i { background: var(--sp-bike); }
.ssvep-meter.is-comfort .ssvep-mbar i { background: var(--fern); }
.ssvep-meter small { grid-column: 1 / -1; color: var(--muted); font-size: .72rem; }
.ssvep-controls { display: grid; gap: .3rem; }
.ssvep-slider { display: grid; grid-template-columns: auto 6.5rem 1fr 3.6rem; align-items: center; gap: .55rem; font-size: .84rem; }
.ssvep-slider:not(:has(input[type=radio])) { grid-template-columns: 0 7.05rem 1fr 3.6rem; }
.ssvep-slider input[type=range] { width: 100%; accent-color: var(--ochre); }
.ssvep-slider input[type=radio] { accent-color: var(--ochre); margin: 0; }
.ssvep-slabel { font-weight: 600; color: var(--heading); }
.ssvep-slider output { text-align: right; font-variant-numeric: tabular-nums; color: var(--ink); }
.ssvep-hint { margin: 0; font-size: .78rem; color: var(--muted); }
.ssvep-presets { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; font-size: .78rem; color: var(--muted); }
.ssvep-chip {
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 999px;
  padding: .2rem .6rem; font-size: .76rem; cursor: pointer;
}
.ssvep-chip:hover { border-color: var(--ochre); }
.ssvep-note { margin: 0; font-size: .76rem; color: var(--muted); }
.ssvep-cite { font-size: .82rem; margin: .55rem 0 .2rem; line-height: 1.45; }
.ssvep-cite-label { color: var(--muted); }
.ssvep-model-note { font-size: .76rem; color: var(--muted); margin: 0; line-height: 1.45; }
@media (max-width: 640px) {
  .ssvep-plots { grid-template-columns: 1fr; }
  .ssvep-slider { grid-template-columns: auto 5rem 1fr 3.2rem; }
}
/* slider rows: label · range · value (target rows add a radio first) */
.ssvep-slider, .ssvep-slider:not(:has(input[type=radio])) { grid-template-columns: 8.2rem 1fr 3.6rem; }
.ssvep-slider:has(input[type=radio]) { grid-template-columns: auto 6.6rem 1fr 3.6rem; }
.ssvep-cite .pub-authors { display: inline; }
@media (max-width: 640px) {
  .ssvep-slider, .ssvep-slider:not(:has(input[type=radio])) { grid-template-columns: 6.6rem 1fr 3.2rem; }
  .ssvep-slider:has(input[type=radio]) { grid-template-columns: auto 4.8rem 1fr 3.2rem; }
}

/* publication type icon (replaces the running number) */
.pubs li::before { content: none; }
.pub-kind {
  position: absolute; left: 0; top: .72rem; width: 1.7rem; height: 1.7rem; border-radius: 7px;
  display: grid; place-items: center; background: var(--sage); color: var(--accent-text);
}
.pub-kind .icon { width: 15px; height: 15px; }
.pub-kind.is-book { background: color-mix(in srgb, var(--ochre) 22%, var(--paper-2)); color: var(--heading); }

/* all publications, grouped by year */
.all-pubs-bar { display: flex; justify-content: center; margin-top: 1.1rem; }
.all-pubs-toggle { cursor: pointer; font: inherit; }
.all-pubs-toggle[aria-expanded="true"] { background: var(--heading); color: var(--paper); border-color: var(--heading); }
.all-pubs { margin-top: 1rem; background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--radius); padding: .4rem 1.4rem; box-shadow: var(--shadow-sm); }
.all-pubs[hidden] { display: none; }
.pub-years { display: grid; }
.pub-year { display: grid; grid-template-columns: 6.5rem 1fr; gap: 1rem; border-top: 2px solid var(--line); padding: .3rem 0; }
.pub-year:first-child { border-top: 0; }
.pub-year-label {
  margin: 0; padding-top: .78rem; font-family: var(--font-display); font-size: 1.35rem; color: var(--heading);
  align-self: start; position: sticky; top: calc(var(--header-h) + 8px);
}
@media (max-width: 640px) {
  .pub-year { grid-template-columns: 1fr; gap: 0; }
  .pub-year-label { position: static; padding-top: .6rem; }
}

/* ---------- SSVEP playground, compact layout (v2) ---------- */
.panel-inner .panel-wide { grid-column: 1 / -1; }
.panel-inner.has-wide { row-gap: .9rem; }
.panel-head h3 { margin-bottom: 0; }
.interactive-block { margin: 0; }
.ssvep { padding: .6rem; gap: .5rem; }
.ssvep-bar { flex-wrap: nowrap; }
.ssvep-bar .ssvep-warn { flex: 1; min-width: 0; font-size: .74rem; line-height: 1.3; }
.ssvep-main { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr); gap: .7rem; align-items: start; }
.ssvep-stage { border-radius: 10px; overflow: hidden; }
.ssvep-scene { aspect-ratio: 16 / 10; max-height: 400px; }
.ssvep-side { display: grid; gap: .45rem; }
.ssvep-plots { gap: .5rem; }
.ssvep-plots figcaption { font-size: .7rem; margin-bottom: .1rem; }
.ssvep-eeg, .ssvep-spec { height: 74px; }
.ssvep-meters { grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: .35rem .8rem; }
.ssvep-meter { grid-template-columns: 1fr auto; font-size: .76rem; gap: .1rem .4rem; }
.ssvep-meter .ssvep-mbar { grid-column: 1 / -1; grid-row: 2; height: 5px; }
.ssvep-meter small { font-size: .68rem; }
.ssvep-controls { gap: .15rem; }
.ssvep-slider, .ssvep-slider:not(:has(input[type=radio])) { grid-template-columns: 7.4rem 1fr 3.3rem; font-size: .8rem; gap: .45rem; }
.ssvep-slider:has(input[type=radio]) { grid-template-columns: auto 5.9rem 1fr 3.3rem; }
.ssvep-hint { font-size: .72rem; }
.ssvep-presets { gap: .3rem; }
.ssvep-chip { font-size: .72rem; padding: .15rem .55rem; }
.ssvep-cite { margin: .45rem 0 .1rem; font-size: .8rem; }
@media (max-width: 860px) {
  .ssvep-main { grid-template-columns: 1fr; }
  .ssvep-bar { flex-wrap: wrap; }
  .ssvep-bar .ssvep-warn { order: 3; flex-basis: 100%; }
}

/* tile counts: number only; a controller marks an interactive demo */
.tile-meta { gap: .7rem; align-items: center; }
.tile-meta > span { font-variant-numeric: tabular-nums; font-weight: 700; }
.tile-play {
  margin-left: auto; padding: .1rem .45rem; border-radius: 999px;
  background: var(--ochre); color: #1d1406;
}
.tile-play .icon { width: 1.25em; height: 1.25em; }

/* ---------- playground v3: stimulus / texture / EEG options ---------- */
.ssvep-bar { justify-content: space-between; }
.ssvep-opts { display: grid; grid-template-columns: auto 1fr; gap: .25rem .5rem; align-items: center; }
.ssvep-opt { display: contents; }
.ssvep-olabel { font-size: .74rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.ssvep-opt .ssvep-modes { justify-self: start; }
.ssvep-opt .ssvep-seg { padding: .2rem .65rem; font-size: .78rem; }
.ssvep-opt.is-off .ssvep-modes { opacity: .45; }
.ssvep-seg:disabled { cursor: not-allowed; }
.ssvep-code-desc { font-size: .76rem; color: var(--muted); }
.ssvep-cites { margin-top: .5rem; }
.ssvep-cites .ssvep-cite-label { margin: 0 0 .15rem; font-size: .78rem; }
.ssvep-cites ul { margin: 0 0 .3rem; padding-left: 1.1rem; display: grid; gap: .15rem; }
.ssvep-cites .ssvep-cite { margin: 0; font-size: .78rem; line-height: 1.4; }

/* ---------- theater: enlarged video / photo over a dimmed page ---------- */
.theater {
  position: fixed; inset: 0; width: 100vw; height: 100vh; max-width: none; max-height: none;
  margin: 0; padding: 0; border: 0; background: transparent; color: #f3efe2; overflow: hidden;
}
.theater[open] { display: grid; place-items: center; }
.theater::backdrop { background: rgba(6, 9, 7, .8); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.theater-stage { display: grid; place-items: center; width: 100%; height: 100%; padding: 3.5rem 1rem 1.5rem; }
.theater-video { margin: 0; width: min(1200px, 94vw, calc((100vh - 8rem) * 16 / 9)); }
.theater-video iframe { display: block; width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: 12px; background: #000; box-shadow: 0 30px 90px -20px rgba(0, 0, 0, .8); }
.theater-photo { margin: 0; display: grid; justify-items: center; gap: .6rem; }
.theater-photo img { max-width: 94vw; max-height: calc(100vh - 8rem); width: auto; height: auto; border-radius: 10px; box-shadow: 0 30px 90px -20px rgba(0, 0, 0, .8); }
.theater figcaption { margin-top: .6rem; font-size: .92rem; color: #e6e2d4; text-align: center; }
.theater-close {
  position: fixed; top: 1rem; right: 1rem; width: 44px; height: 44px; border-radius: 50%; border: 0; cursor: pointer;
  display: grid; place-items: center; background: rgba(246, 243, 234, .92); color: #1f3b2d; box-shadow: 0 6px 20px rgba(0, 0, 0, .4);
}
.theater-close:hover { background: #fff; }
.theater-close .icon { width: 20px; height: 20px; }
@media (prefers-reduced-motion: no-preference) {
  .theater[open] .theater-stage > * { animation: theater-in .35s var(--ease); }
  @keyframes theater-in { from { opacity: 0; transform: scale(.94); } to { opacity: 1; transform: none; } }
}

/* ---------- journey photos: small vignettes in wrapping rows ---------- */
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: .6rem; margin: 0 0 1rem; }
.photo-grid figure { margin: 0; min-width: 0; }
.photo-thumb { display: block; width: 100%; padding: 0; border: 0; border-radius: var(--radius-sm); overflow: hidden; cursor: zoom-in; background: var(--sage); }
.photo-thumb img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; transition: transform .5s var(--ease); }
.photo-thumb:hover img { transform: scale(1.06); }
.photo-grid figcaption {
  font-size: .74rem; line-height: 1.3; color: var(--muted); margin-top: .25rem;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden;
}

/* ==========================================================================
   Gaze in the city: the LocoGaze course through central Leuven (real data)
   ========================================================================== */
.lw { border: 1px solid var(--line); border-radius: 14px; background: var(--paper-2); padding: .6rem; display: grid; gap: .55rem; }
.lw-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem .8rem; }
.lw-btn { width: 38px; height: 38px; border-radius: 50%; border: 0; cursor: pointer; display: grid; place-items: center; background: var(--forest); color: var(--cream); }
.lw-btn .icon { width: 18px; height: 18px; }
.lw-speeds { display: inline-flex; gap: .25rem; }
.lw-chip {
  display: inline-flex; align-items: center; gap: .35rem; border: 1px solid var(--line); background: var(--surface); color: var(--heading);
  border-radius: 999px; padding: .28rem .7rem; font: 700 .78rem/1.1 var(--font-body); cursor: pointer;
}
.lw-chip[aria-pressed="true"] { background: var(--ochre); border-color: var(--ochre); color: #1d1406; }
.lw-chip .icon { width: 15px; height: 15px; }
.lw-where { margin: 0 0 0 auto; font-size: .82rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.lw-readout { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .4rem; }
.lw-measure {
  display: grid; text-align: left; gap: .05rem; padding: .45rem .7rem; border-radius: 12px; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit;
  transition: border-color .2s, box-shadow .2s;
}
.lw-measure:hover { border-color: var(--ochre); }
.lw-measure[aria-checked="true"] { border-color: var(--ochre); box-shadow: 0 0 0 2px color-mix(in srgb, var(--ochre) 45%, transparent); }
.lw-m-label { font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--accent-text); }
.lw-m-value { font-family: var(--font-display); font-size: 1.35rem; color: var(--heading); font-variant-numeric: tabular-nums; line-height: 1.2; }
.lw-measure small { font-size: .72rem; color: var(--muted); }
.lw-stage { position: relative; border-radius: 12px; overflow: hidden; background: #f1ead9; }
.lw-map { display: block; width: 100%; cursor: pointer; }
.lw-legend {
  position: absolute; left: .6rem; bottom: .6rem; padding: .45rem .65rem; border-radius: 10px; font-size: .72rem; color: #2c3a33;
  background: rgba(250, 246, 236, .82); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); box-shadow: 0 2px 10px rgba(0, 0, 0, .12);
}
.lw-legend p { margin: 0; }
.lw-legend-title { font-weight: 700; }
.lw-scale { display: grid; grid-template-columns: auto 9rem auto; align-items: center; gap: .4rem; margin: .25rem 0 .35rem; font-variant-numeric: tabular-nums; }
.lw-scale i { height: 8px; border-radius: 999px; }
.lw-terrains { display: flex; flex-wrap: wrap; gap: .2rem .7rem; }
.lw-terrains span { display: inline-flex; align-items: center; gap: .3rem; }
.lw-t { width: 12px; height: 9px; border-radius: 3px; border: 1px solid #6c715b; }
.lw-t-flat { background: #ead7b5; } .lw-t-cobble { background: #c09a68; } .lw-t-dirt { background: #a4b77a; }
.lw-profile { display: block; width: 100%; height: 96px; cursor: ew-resize; touch-action: none; border-radius: 10px; background: var(--surface); }
.lw-note { margin: 0; font-size: .74rem; color: var(--muted); line-height: 1.45; }
.lw-loading { min-height: 12rem; place-content: center; text-align: center; }
@media (max-width: 760px) {
  .lw-readout { grid-template-columns: 1fr 1fr; }
  .lw-where { flex-basis: 100%; margin: 0; }
  .lw-legend { position: static; border-radius: 0; }
}

/* ---------- journey: chapter arrows + publications over the map ---------- */
.timeline-col { display: grid; grid-template-columns: 2.2rem minmax(0, 1fr); gap: .5rem; align-items: start; }
.journey-nav {
  position: sticky; top: calc(var(--header-h) + 14px); display: grid; justify-items: center; gap: .3rem;
  padding: .35rem 0; border-radius: 999px; background: var(--paper-2); border: 1px solid var(--line); box-shadow: var(--shadow-sm);
}
.journey-step {
  width: 1.8rem; height: 1.8rem; border-radius: 50%; border: 0; cursor: pointer; display: grid; place-items: center;
  background: none; color: var(--heading);
}
.journey-step .icon { transform: rotate(-90deg); width: 16px; height: 16px; }
.journey-step.is-next .icon { transform: rotate(90deg); }
.journey-step:hover:not(:disabled) { background: color-mix(in srgb, var(--heading) 10%, transparent); }
.journey-step:disabled { opacity: .3; cursor: default; }
.journey-pos { font-size: .68rem; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.pubs-toggle {
  display: inline-flex; align-items: center; gap: .45rem; margin: .2rem 0 .8rem; padding: .35rem .7rem .35rem .45rem;
  border: 1px solid var(--line); border-radius: 999px; background: var(--paper-2); cursor: pointer;
  font: inherit; font-size: .86rem; font-weight: 700; color: var(--heading);
}
.pubs-toggle:hover { border-color: var(--period, var(--ochre)); }
.pubs-chevron { display: inline-block; width: 1em; text-align: center; font-size: 1.2rem; line-height: 1; transition: transform .25s var(--ease); }
.pubs-toggle[aria-expanded="true"] { background: color-mix(in srgb, var(--period, var(--ochre)) 25%, var(--paper-2)); }
.pubs-toggle[aria-expanded="true"] .pubs-chevron { transform: rotate(90deg); }
.map-pubs {
  position: absolute; z-index: 4; top: 12px; right: 12px; bottom: 12px; width: min(470px, calc(100% - 24px));
  display: flex; flex-direction: column; border-radius: 14px; overflow: hidden;
  background: color-mix(in srgb, var(--paper-2) 96%, transparent); backdrop-filter: blur(8px);
  box-shadow: var(--shadow); border-top: 4px solid var(--period, var(--ochre));
}
.map-pubs[hidden] { display: none; }
.map-pubs-head { display: flex; align-items: flex-start; justify-content: space-between; gap: .6rem; padding: .7rem .9rem .5rem; border-bottom: 1px solid var(--line); }
.map-pubs-head p { margin: 0; display: grid; }
.map-pubs-kicker { font-size: .7rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-text); }
.map-pubs-head strong { font-family: var(--font-display); font-size: 1.05rem; color: var(--heading); }
.map-pubs-close { width: 32px; height: 32px; flex: none; border-radius: 50%; border: 0; cursor: pointer; display: grid; place-items: center; background: var(--surface); color: var(--heading); }
.map-pubs-body { overflow-y: auto; padding: 0 .9rem .6rem; overscroll-behavior: contain; }
.map-pubs-body .pubs li { font-size: .86rem; }
@media (max-width: 640px) {
  .timeline-col { grid-template-columns: 1fr; }
  .journey-nav { position: fixed; z-index: 40; left: .6rem; bottom: .8rem; top: auto; grid-auto-flow: column; padding: .2rem .35rem; }
}

.map-restoring { z-index: 5; background: rgba(12, 18, 14, .55); color: var(--cream); font-weight: 700; }

/* ---------- journey as a one-screen panel (wide screens) ----------
   The chapter list scrolls inside its own column and the map fills the rest,
   so selecting a chapter never moves the page or the map. */
@media (min-width: 961px) {
  .journey-layout {
    height: calc(100vh - var(--header-h) - 28px); min-height: 520px; max-height: 980px;
    align-items: stretch; gap: 1.4rem;
  }
  .timeline-col {
    height: 100%; overflow-y: auto; overscroll-behavior: contain; overflow-anchor: none;
    padding: 0 .5rem .6rem 0; scrollbar-width: thin; position: relative;
  }
  .timeline-col .journey-nav { top: .2rem; }
  .journey-layout .map-wrap { position: relative; top: auto; height: 100%; min-height: 0; }
  .stop:last-child { margin-bottom: 40vh; }           /* the last chapter can still scroll to the top */
}

/* section headings without kicker / lede */
#projects .section-head, #other .section-head { margin-bottom: 1.1rem; }

/* Open science vignette: blue theme, like the motorsport / sport science cards */
.vignette[data-vignette="open-science"] { background: #16304f; }
.vignette[data-vignette="open-science"]::after {
  background: linear-gradient(180deg, transparent 35%, #10284ab0 70%, #0b1e38 100%);
}
.vignette[data-vignette="open-science"] .vignette-kicker { color: #a9cdef; }
.vignette-dialog[data-vignette="open-science"] {
  --paper-2: #eff5fb;
  --ink: #1f2c3a;
  --heading: #1c3d63;
  --muted: #52657a;
  --line: #c9d9ea;
  --accent-text: #2a6aa8;
  --link: #24609c;
}
[data-theme="dark"] .vignette-dialog[data-vignette="open-science"] {
  --paper-2: #16212e;
  --ink: #dde8f3;
  --heading: #e3eefa;
  --muted: #9fb3c8;
  --line: #2f4256;
  --accent-text: #8fc0ee;
  --link: #9cc8f2;
}
.vignette-dialog[data-vignette="open-science"] .dialog-hero::after {
  background: linear-gradient(180deg, transparent 35%, #0f2645d4 100%);
}
.vignette-dialog[data-vignette="open-science"] .init-role { background: color-mix(in srgb, #7db0e0 32%, transparent); }

/* ---------- study explorers: Mobile EEG & walking and Clinical research ---------- */
.panel-inner .research-explorer { max-width: 31rem; margin: .4rem 0 1.1rem; }
.research-explorer.research-explorer-eeg {
  --research-mind: #6a4fa3;
  --research-body: #2d6e8e;
  --research-place: #3f7d5c;
  --research-event: #c2410c;
  --research-play: #f2c46d;
}
[data-theme="dark"] .research-explorer.research-explorer-eeg {
  --research-mind: #c7b2f2;
  --research-body: #9bd0ea;
  --research-place: #a6dcbb;
  --research-event: #ffb27d;
}
.research-explorer.research-explorer-clinical {
  --research-mind: #a8471a;
  --research-body: #9a5512;
  --research-place: #8a4a2c;
  --research-event: #e2701c;
  --research-play: #f6b26b;
}
[data-theme="dark"] .research-explorer.research-explorer-clinical {
  --research-mind: #f7b48a;
  --research-body: #f2c07a;
  --research-place: #e9b49a;
  --research-event: #ffa45c;
}
/* Clinical research vignette: orange theme, like the other illustrated cards */
.vignette[data-vignette="clinical-research"] { background: #6b2e0e; }
.vignette[data-vignette="clinical-research"]::after {
  background: linear-gradient(180deg, transparent 35%, #5a250ab0 70%, #3f1906 100%);
}
.vignette-dialog[data-vignette="clinical-research"] {
  --paper-2: #fdf4ec;
  --ink: #3a2416;
  --heading: #7a3410;
  --muted: #7b5a45;
  --line: #ecd3bd;
  --accent-text: #b8541a;
  --link: #a8471a;
}
[data-theme="dark"] .vignette-dialog[data-vignette="clinical-research"] {
  --paper-2: #2a1a10;
  --ink: #f4e2d4;
  --heading: #ffe2cc;
  --muted: #caa58a;
  --line: #5a3a26;
  --accent-text: #f7ad78;
  --link: #f7b48a;
}
.vignette-dialog[data-vignette="clinical-research"] .dialog-hero::after {
  background: linear-gradient(180deg, transparent 35%, #4a1e07d4 100%);
}

/* ---------- labels inside the study explorers ---------- */
.research-ink .research-label {
  fill: currentColor; stroke: none;
  font: 600 8.6px/1 var(--font-body);
  letter-spacing: .01em;
}
.research-ink .research-label.strong { font-weight: 800; font-size: 9.4px; }
.research-ink .ref { opacity: .55; }

/* Spaghetti, smartphone & attention: tomato red + basil green */
.research-explorer.research-explorer-spaghetti {
  --research-mind: #8a3b2c;
  --research-body: #4d6b2e;
  --research-place: #7a5a1e;
  --research-event: #d1432b;
  --research-play: #f2c46d;
}
[data-theme="dark"] .research-explorer.research-explorer-spaghetti {
  --research-mind: #f2b3a4;
  --research-body: #c3dd9c;
  --research-place: #ead29a;
  --research-event: #ff8a6e;
}

/* Parkinson's disease & locomotion: theta and beta get their own colours */
.research-explorer.research-explorer-clinical { --clin-theta: #2b6a8a; --clin-beta: #d0601a; }
[data-theme="dark"] .research-explorer.research-explorer-clinical { --clin-theta: #8fcdec; --clin-beta: #ffa45c; }
.research-explorer-clinical .theta { color: var(--clin-theta); stroke: currentColor; }
.research-explorer-clinical .beta { color: var(--clin-beta); stroke: currentColor; }
.research-explorer-clinical .post { color: var(--research-event); fill-opacity: .13; }

/* Extreme environments: night-sky violet */
.vignette[data-vignette="extreme-environments"] { background: #241a45; }
.vignette[data-vignette="extreme-environments"]::after {
  background: linear-gradient(180deg, transparent 35%, #1d1538b0 70%, #120c26 100%);
}
.vignette-dialog[data-vignette="extreme-environments"] {
  --paper-2: #f4f1fb; --ink: #27213d; --heading: #3a2a6e; --muted: #625a7e;
  --line: #ddd5ee; --accent-text: #6a4fb8; --link: #5a3fa8;
}
[data-theme="dark"] .vignette-dialog[data-vignette="extreme-environments"] {
  --paper-2: #1b1630; --ink: #e8e3f6; --heading: #ece4ff; --muted: #aaa0c8;
  --line: #3b3360; --accent-text: #c3b0ff; --link: #c3b0ff;
}
.vignette-dialog[data-vignette="extreme-environments"] .dialog-hero::after {
  background: linear-gradient(180deg, transparent 35%, #140e2cd4 100%);
}

/* Safe cycling: teal */
.vignette[data-vignette="safe-cycling"] { background: #0f4446; }
.vignette[data-vignette="safe-cycling"]::after {
  background: linear-gradient(180deg, transparent 35%, #0c3a3cb0 70%, #072627 100%);
}
.vignette-dialog[data-vignette="safe-cycling"] {
  --paper-2: #eef7f6; --ink: #1d3534; --heading: #10504f; --muted: #4f6b69;
  --line: #cfe4e2; --accent-text: #137a74; --link: #0f6b66;
}
[data-theme="dark"] .vignette-dialog[data-vignette="safe-cycling"] {
  --paper-2: #10282a; --ink: #dff0ee; --heading: #d8fbf6; --muted: #93b9b5;
  --line: #2a4a4a; --accent-text: #7fdcd2; --link: #7fdcd2;
}
.vignette-dialog[data-vignette="safe-cycling"] .dialog-hero::after {
  background: linear-gradient(180deg, transparent 35%, #072a2bd4 100%);
}

/* ---------- Methods simulation: compact controls ---------- */
.sim { gap: .7rem; }
.sim-modalities { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem; }
.sim-modality {
  display: inline-flex; align-items: center; gap: .5rem; padding: .28rem .45rem .28rem .3rem;
  border-radius: 999px; grid-template-columns: none;
}
.sim-modality-icon { width: 26px; height: 26px; }
.sim-modality-icon .icon { width: 15px; height: 15px; }
.sim-modality-name { color: var(--cream); font-weight: 700; font-size: .86rem; white-space: nowrap; }
.sim-switch { position: relative; top: auto; right: auto; width: 30px; height: 17px; margin: 0; flex: none; }
.sim-switch::after { top: 2.5px; left: 2.5px; width: 12px; height: 12px; }
.sim-modality[aria-pressed="true"] .sim-switch::after { transform: translateX(13px); }
.sim-modalities .sim-note { margin-left: auto; }

.sim-toolbar { gap: .5rem 1.2rem; padding: .4rem .6rem; }
.sim-ranges { display: flex; flex-wrap: wrap; gap: .3rem 1rem; }
.sim-range { flex-direction: column; align-items: stretch; gap: .05rem; font-size: .72rem; letter-spacing: .02em; }
.sim-range span { display: flex; justify-content: space-between; gap: .5rem; }
.sim-range input { width: 112px; margin: 0; }
.sim-range output { min-width: 0; font-weight: 700; }
.sim-tools { gap: .2rem; }
.sim-tool {
  display: grid; justify-items: center; gap: .14rem; min-width: 3.5rem; padding: .3rem .3rem .25rem;
  border: 0; border-radius: 10px; cursor: pointer; background: transparent; color: var(--cream);
  font: 700 .68rem/1.1 var(--font-body); transition: background .2s, color .2s;
}
.sim-tool .icon { width: 20px; height: 20px; }
.sim-tool:hover { background: color-mix(in srgb, var(--cream) 14%, transparent); }
.sim-tool[aria-pressed="true"] { background: var(--ochre); color: var(--forest); }
.sim-sep { height: 34px; }
.sim-arena { background: #ead7b5; }

.sim-card { padding: .6rem .8rem .7rem; }
.sim-card-title { margin: 0 0 .4rem; }
.sim-measure-groups { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .4rem 1.2rem; }
.sim-measure-group { display: grid; gap: .25rem; }
.sim-group-title { margin: 0; font-size: .64rem; }
.sim-measures { display: flex; flex-wrap: wrap; gap: .3rem; }
.sim-measure-plain { min-width: 0; }
.sim-measure { padding: .26rem .65rem .26rem .4rem; border-radius: 999px; gap: .4rem; }
.sim-measure b { font-size: .8rem; white-space: nowrap; }
.sim-radio { width: 13px; height: 13px; }
.sim-measure[aria-checked="true"] .sim-radio { background: radial-gradient(circle, var(--ochre) 0 2.5px, transparent 3.5px); }
.sim-measure-foot { align-items: center; flex-wrap: nowrap; margin-top: .5rem; gap: .3rem 1rem; }
.sim-measure-foot .sim-colorbar { margin: 0; flex: 0 0 12rem; }
.sim-measure-foot .sim-measure-desc { margin: 0; min-height: 0; font-size: .8rem; line-height: 1.4; flex: 1 1 auto; }
.sim-measure-foot .sim-rec { margin: 0; white-space: nowrap; }
@media (max-width: 760px) {
  .sim-measure-foot { flex-wrap: wrap; }
  .sim-measure-foot .sim-colorbar { flex-basis: 100%; }
  .sim-tool { min-width: 3rem; }
}

/* project panel with a fitted publication list (BCI in the sky) */
.panel-pubs-fit { position: relative; min-height: 14rem; }
.panel-pubs-scroll { position: absolute; inset: 0; overflow-y: auto; padding-right: .6rem; scrollbar-width: thin; }
@media (max-width: 960px) {
  .panel-pubs-fit { min-height: 0; }
  .panel-pubs-scroll { position: static; max-height: 24rem; }
}

/* the surfer above Research themes: Simon, with eye-tracking glasses and a mobile EEG cap */
.surfer-outfit .hair { fill: #2a201b; }
.surfer-outfit .beard { fill: #3a2c24; opacity: .28; }
.surfer-outfit .eeg-cap { fill: none; stroke: #5e7477; stroke-width: .9; stroke-linecap: round; }
.surfer-outfit .eeg-electrodes circle { fill: #f3ead6; stroke: #333c47; stroke-width: .45; }
.surfer-outfit .eeg-cable { fill: none; stroke: #333c47; stroke-width: .6; stroke-linecap: round; }
.surfer-outfit .et-frame { stroke: #1f2a2a; stroke-width: .8; stroke-linecap: round; }
.surfer-outfit .et-lens { fill: #86b5b3; stroke: #1f2a2a; stroke-width: .55; }
.surfer-outfit .et-camera { fill: #c9462f; }
.panel-pubs-scroll { -webkit-mask-image: linear-gradient(180deg, #000 calc(100% - 2.5rem), transparent); mask-image: linear-gradient(180deg, #000 calc(100% - 2.5rem), transparent); padding-bottom: 2rem; }


/* Methods: isometric neighbourhood on grid paper; two sensor wearers fit the panel */
.sim-arena { background: #f1ead9; }
.sim-stage { grid-template-columns: minmax(0, 1fr) 320px; }
.sim-pov canvas { aspect-ratio: 16 / 9; }
@media (max-width: 1080px) { .sim-stage { grid-template-columns: 1fr; } }
.sim-agent-physio .sim-speed { margin-left: auto; }
.sim-panel { overflow-x: hidden; }

/* ---------- journey: compact chapters, smaller collaboration markers ---------- */
.journey-totals { margin: -.3rem 0 1rem; }
#journey .sport-card { margin: 0 0 .9rem; }
.stop { margin-bottom: .45rem; padding-left: 52px; }
.stop-node { width: 40px; height: 40px; top: 4px; border-width: 2.5px; }
.stop-node .icon { width: 20px; height: 20px; }
.timeline::before { left: 19px; top: 20px; bottom: 20px; }
.stop-head { grid-template-columns: 1fr auto; align-items: center; gap: .05rem .8rem; padding: .5rem .85rem; }
.stop-dates { grid-column: 1; font-size: .72rem; }
.stop-role { grid-column: 1; font-size: 1rem; line-height: 1.2; }
.stop-place { grid-column: 2; grid-row: 1 / span 2; flex-direction: row; align-items: center; gap: .5rem; }
.flag { width: 26px; height: 18px; }
.stop-content { padding: 0 .95rem 1rem; }
.stop-inst { margin: .1rem 0 .6rem; color: var(--muted); font-size: .9rem; line-height: 1.45; }
.stop-inst strong { color: var(--heading); }
.stop-city { display: flex; align-items: center; gap: .3rem; margin-top: .15rem; font-size: .84rem; }
.stop-city .icon { width: 14px; height: 14px; }
.stop-summary { margin-top: 0; }
/* video vignettes among the photos */
.photo-thumb.is-video { position: relative; }
.photo-thumb.is-video .video-play {
  position: absolute; inset: 0; margin: auto; width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center; background: rgba(246, 243, 234, .92); color: var(--forest);
  box-shadow: 0 2px 10px rgba(0, 0, 0, .3); transition: transform .25s var(--ease);
}
.photo-thumb.is-video .video-play .icon { width: 18px; height: 18px; margin-left: 2px; }
.photo-thumb.is-video:hover .video-play { transform: scale(1.1); }
/* collaborations and lab visits: small markers, no lines */
.map-link { width: 18px; height: 18px; border-width: 1.5px; box-shadow: 0 0 0 2px color-mix(in srgb, var(--period, var(--ochre)) 25%, transparent), 0 2px 6px rgba(0, 0, 0, .3); }
.map-link.is-visit { border-radius: 5px; }
.map-link .icon { width: 10px; height: 10px; }
@media (min-width: 961px) {
  /* the panel no longer fills the screen: it fits under the section intro */
  .journey-layout { height: clamp(370px, calc(100vh - var(--header-h) - 252px), 640px); min-height: 0; }
  .stop:last-child { margin-bottom: 0; }
}
/* journey intro kept short so the chapters and the map fit on one screen */
#journey { padding-top: 1.6rem; }
#journey .section-head { max-width: none; margin-bottom: .8rem; }
#journey .section-head h2 { margin-bottom: .25rem; }
#journey .section-lede { display: inline; margin: 0 1.2rem 0 0; }
#journey .journey-totals { display: inline-flex; margin: 0; vertical-align: middle; }
#journey .sport-card { padding: .45rem 1.1rem; }
#journey .sport-card p { max-width: 92ch; font-size: .82rem; line-height: 1.35; }

/* ---------- desktop Other projects pop-ups ---------- */
@media (min-width: 1200px) {
  .vignette-dialog { width: min(1280px, 100% - 3rem); }
  .vignette-dialog .dialog-hero { aspect-ratio: auto; height: clamp(90px, 10vh, 112px); }
  .vignette-dialog .dialog-hero-text { bottom: .75rem; right: 9rem; }
  .vignette-dialog .dialog-hero-text h2 { font-size: 2.25rem; }
  .vignette-dialog .dialog-body { padding: 1.1rem 1.7rem 1.35rem; gap: .9rem; }
  .vignette-dialog .dialog-body > div > p { margin-bottom: .65rem; }
  .vignette-dialog .sport-science-layout { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); align-items: start; }
  .vignette-dialog .sport-science-layout .research-explorer { max-width: 24rem; }
  .vignette-dialog .sport-science-copy > p { margin-bottom: .65rem; font-size: .95rem; line-height: 1.5; }
  .vignette-dialog .sport-science-copy .gallery img { max-height: 19rem; object-fit: contain; }
  /* publications in a row under the explorer */
  .dialog-pubs h3 { margin: 0 0 .5rem; font-size: 1.2rem; }
  .dialog-pubs .pubs { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 0 1.6rem; }
  .dialog-pubs .pubs li { border-top: 0; font-size: .86rem; }
  /* open science: the initiatives in two columns */
  .vignette-dialog .init-list { grid-template-columns: 1fr 1fr; column-gap: 2.2rem; }
  .vignette-dialog .init { grid-template-columns: 6rem 1fr; padding: .5rem 0; }
  .vignette-dialog .init:nth-child(2) { border-top: 0; }
  .vignette-dialog .init-name { font-size: 1rem; }
  .vignette-dialog .init-full, .vignette-dialog .init-desc { font-size: .84rem; }
}
@media (min-width: 1200px) and (max-height: 980px) {
  .vignette-dialog .sport-science-layout .research-explorer { max-width: 22rem; }
}

/* ---------- km per year: a small, see-through panel on the bottom edge of the map ---------- */
.map-stats {
  left: 0; bottom: 0; width: min(330px, calc(100% - 64px));
  padding: .4rem .7rem .35rem; font-size: .72rem;
  border-radius: 0 12px 0 var(--radius); border-top: 2px solid var(--period, var(--ochre));
  background: color-mix(in srgb, var(--paper) 58%, transparent);
  -webkit-backdrop-filter: blur(8px) saturate(1.1); backdrop-filter: blur(8px) saturate(1.1);
  box-shadow: none;
}
.map-stats .stats-title { margin: 0 0 .25rem; font-size: .76rem; }
.map-stats .stats-close .icon { width: 13px; height: 13px; }
.map-stats .stats-rows { gap: .12rem; }
.map-stats .stats-row { grid-template-columns: 3.7rem 1fr 3.9rem; gap: .4rem; }
.map-stats .stats-label .icon { width: 12px; height: 12px; }
.map-stats .stats-bars { height: 18px; }
.map-stats .stats-axis { margin: 0 4.3rem 0 4.1rem; font-size: .64rem; }
.map-stats .stats-tip { margin-top: .15rem; font-size: .7rem; }
.lw-north {
  position: absolute; top: .6rem; right: .6rem; width: 2.2rem; height: 2.2rem; border-radius: 50%; display: grid; place-items: center;
  background: rgba(250, 246, 236, .82); box-shadow: 0 2px 8px rgba(0, 0, 0, .12); color: #32434a;
}
.lw-north b { position: absolute; font-size: .62rem; top: .1rem; left: 0; right: 0; text-align: center; opacity: 0; }
.lw-north-arrow { width: 0; height: 0; border-left: 5px solid transparent; border-right: 5px solid transparent; border-bottom: 16px solid #c9462f; position: relative; }
.lw-north-arrow::after { content: "N"; position: absolute; left: -4px; top: 15px; font: 700 .6rem/1 var(--font-body); color: #32434a; font-style: normal; }
.lw-legend { top: .6rem; bottom: auto; }
@media (max-width: 760px) { .lw-legend { position: static; } }

/* ---------- interactive games: a card next to the videos, played in the theater ---------- */
.video.is-game .video-play .icon { width: 22px; height: 22px; }
.video.is-game::after {
  content: "Interactive"; position: absolute; top: .5rem; left: .5rem; z-index: 2; padding: .1rem .5rem; border-radius: 999px;
  font: 700 .66rem/1.5 var(--font-body); letter-spacing: .06em; text-transform: uppercase; background: var(--ochre); color: #1d1406;
}
.theater-game {
  margin: 0; width: min(1240px, 94vw); max-height: calc(100vh - 5rem); overflow-y: auto; overscroll-behavior: contain;
  background: var(--paper-2); color: var(--ink); border-radius: 14px; padding: .9rem 1rem 1rem;
  box-shadow: 0 30px 90px -20px rgba(0, 0, 0, .8); scrollbar-width: thin;
}
.theater .theater-game figcaption { margin: 0 0 .6rem; text-align: left; color: var(--ink); }
.theater-game-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: .2rem .8rem; padding-right: 2.5rem; }
.theater-game-head strong { font-family: var(--font-display); font-size: 1.25rem; color: var(--heading); }
.theater-game-head span { font-size: .86rem; color: var(--muted); }
.theater-game .ssvep-cites, .theater-game .ssvep-model-note { margin-top: .8rem; }

/* Leuven walk: top view, measures on the left of the map */
.lw-main { display: grid; grid-template-columns: 13.5rem minmax(0, 1fr); gap: .55rem; align-items: start; }
.lw-side { display: grid; gap: .45rem; }
.lw-side .lw-readout { grid-template-columns: 1fr; gap: .35rem; }
.lw-side .lw-measure { padding: .35rem .6rem; }
.lw-side .lw-m-value { font-size: 1.15rem; }
.lw-side .lw-legend { position: static; box-shadow: none; border: 1px solid var(--line); background: var(--surface); color: var(--ink); }
.lw-side .lw-scale { grid-template-columns: auto 1fr auto; }
.lw-side .lw-terrains { display: grid; gap: .15rem; }
.lw-profile { height: 84px; }
.theater-game .ssvep-cites { margin-top: .5rem; font-size: .8rem; }
.theater-game .ssvep-cites li { margin-bottom: .1rem; }
.theater-game .ssvep-model-note { margin-top: .4rem; font-size: .78rem; }
@media (max-width: 760px) { .lw-main { grid-template-columns: 1fr; } .lw-side .lw-readout { grid-template-columns: 1fr 1fr; } }

.stop-role-more { margin: 0 0 .2rem; font-family: var(--font-display); font-weight: 600; font-size: .98rem; color: var(--heading); }

/* ---------- Methods: the whole section fits on a 1920 × 1080 screen ---------- */
#methods { padding-top: 1.4rem; }
#methods .section-head { max-width: none; margin-bottom: .6rem; }
#methods .section-head .kicker { margin-bottom: .1rem; }
#methods .section-head h2 { margin-bottom: .15rem; }
#methods .section-lede { font-size: .95rem; margin: 0; }
#methods .sim { gap: .5rem; }
#sim-canvas { margin-inline: auto; }
#methods .sim-card { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .9rem; padding: .45rem .7rem; }
#methods .sim-card-title { margin: 0; }
#methods .sim-measure-groups { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .9rem; }
#methods .sim-measure-group { display: flex; align-items: center; gap: .35rem; }
#methods .sim-group-title { white-space: nowrap; }
#methods .sim-measures { flex-wrap: nowrap; gap: .25rem; }
#methods .sim-measure { padding: .2rem .55rem .2rem .35rem; }
#methods .sim-measure b { font-size: .76rem; }
#methods .sim-measure-foot { flex-basis: 100%; margin-top: 0; }
#methods .sim-measure-foot .sim-measure-desc { font-size: .78rem; }
@media (max-width: 1100px) { #methods .sim-measures { flex-wrap: wrap; } }

/* ---------- Methods: analysis on the left, map in the middle, sensors on the right ---------- */
@media (min-width: 1081px) {
  #methods .container { max-width: min(1680px, calc(100vw - 3rem)); width: 100%; }
  #methods .section-head { max-width: 1180px; }
  #methods .sim-stage { grid-template-columns: 13.5rem minmax(0, 1fr) 320px; gap: .75rem; align-items: start; }
  #methods .sim-arena { background: transparent; box-shadow: none; display: grid; justify-items: center; }
  #methods #sim-canvas { border-radius: var(--radius); box-shadow: var(--shadow); background: #f1ead9; }
  /* spatial analysis: a vertical list */
  #methods .sim-analysis { display: block; }
  #methods .sim-card { display: grid; gap: .45rem; padding: .6rem .65rem .7rem; }
  #methods .sim-measure-groups { display: grid; gap: .5rem; }
  #methods .sim-measure-group { display: grid; gap: .25rem; }
  #methods .sim-measures { display: grid; gap: .25rem; }
  #methods .sim-measure { width: 100%; }
  #methods .sim-measure-foot { display: grid; gap: .4rem; }
  #methods .sim-measure-foot .sim-colorbar { flex: none; }
  #methods .sim-measure-foot .sim-rec { white-space: normal; flex-wrap: wrap; }
  /* sensors stacked at the top of the right column, the streams below */
  #methods .sim-side { display: flex; flex-direction: column; gap: .5rem; max-height: var(--arena-h, 640px); min-height: 0; }
  #methods .sim-side .sim-panel { flex: 1 1 auto; min-height: 0; max-height: none; }
  #methods .sim-modalities { display: grid; grid-template-columns: 1fr 1fr; gap: .35rem; }
  #methods .sim-modality { justify-content: space-between; padding: .25rem .4rem .25rem .3rem; }
  #methods .sim-modality-name { font-size: .78rem; white-space: normal; line-height: 1.15; flex: 1; }
  #methods .sim-modalities .sim-note { grid-column: 1 / -1; margin: 0; font-size: .72rem; }
}
@media (max-width: 1080px) {
  .sim-side { display: grid; gap: .6rem; }
}
@media (min-width: 1081px) {
  #methods .sim-measures { grid-template-columns: 1fr; }
  #methods .sim-measure b { white-space: normal; text-align: left; }
  #methods .sim-arena { justify-items: start; }
  #methods .sim-modalities { grid-template-columns: 1fr; gap: .3rem; }
  #methods .sim-modality { padding: .2rem .45rem .2rem .25rem; }
  #methods .sim-modality-icon { width: 24px; height: 24px; }
  #methods .sim-modality-name { font-size: .82rem; white-space: nowrap; }
}
@media (min-width: 1081px) {
  #methods .sim-measure-groups { grid-template-columns: 1fr; }
  #methods #sim-canvas { margin-inline: 0; }
}

/* ---------- Methods: controls float in the empty corners of the map ---------- */
@media (min-width: 1081px) {
  #methods .sim-arena { position: relative; }
  #methods .sim-toolbar {
    position: absolute; z-index: 3; top: .55rem; left: .55rem; right: .55rem; display: flex; justify-content: space-between; align-items: flex-start;
    gap: .6rem; padding: 0; background: none; border-radius: 0; pointer-events: none;
  }
  #methods .sim-toolbar > * { pointer-events: auto; }
  #methods .sim-controls, #methods .sim-tools {
    background: color-mix(in srgb, var(--forest-2) 90%, transparent); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
    border-radius: 12px; box-shadow: 0 6px 18px rgba(0, 0, 0, .22);
  }
  #methods .sim-controls { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: .3rem .6rem; padding: .45rem .6rem .5rem .5rem; }
  #methods .sim-controls .sim-btn-play { width: 38px; height: 38px; }
  #methods .sim-controls .sim-ranges { display: grid; gap: .2rem; }
  #methods .sim-controls .sim-range input { width: 118px; }
  #methods .sim-tools { margin: 0; padding: .25rem .3rem; gap: .05rem; flex-wrap: nowrap; }
  #methods .sim-tool { min-width: 3.05rem; padding: .25rem .2rem .2rem; font-size: .64rem; }
  #methods .sim-tool .icon { width: 18px; height: 18px; }
  #methods .sim-sep { height: 30px; }
  /* Simon's card, then his eye-tracker view */
  #methods .sim-side .sim-pov { position: static; margin: .5rem 0 0; }
}

/* ---------- journey map: arrows to the next / previous chapter ---------- */
.map-step {
  position: absolute; z-index: 3; left: 0; top: 0; transform: translate(-50%, -50%);
  display: flex; align-items: center; gap: .45rem; padding: 0; border: 0; background: none; cursor: pointer;
}
.map-step[hidden] { display: none; }
.map-step .icon {
  width: 54px; height: 54px; padding: 13px; border-radius: 50%; flex: none; stroke-width: 2.6;
  color: #fff; transform: rotate(var(--rot, 0deg)); transition: transform .3s var(--ease), box-shadow .2s;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, .55), 0 6px 18px rgba(0, 0, 0, .35);
}
.map-step.is-next .icon { background: #2f8f57; }
.map-step.is-prev .icon { background: #e0782c; }
.map-step:hover .icon { box-shadow: 0 0 0 6px rgba(255, 255, 255, .7), 0 8px 22px rgba(0, 0, 0, .4); }
.map-step-label {
  padding: .2rem .6rem; border-radius: 999px; font: 700 .8rem/1.3 var(--font-body); white-space: nowrap;
  background: color-mix(in srgb, var(--paper) 88%, transparent); color: var(--heading); box-shadow: var(--shadow-sm);
}
.map-step.label-left { flex-direction: row-reverse; }

/* ---------- press coverage cards in project panels ---------- */
.press-block { margin-top: 1rem; }
.press-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: .8rem; }
.press-card {
  display: grid; gap: .3rem; padding: .8rem .95rem .75rem; border-radius: var(--radius-sm); text-decoration: none;
  background: var(--surface); border: 1px solid var(--line); border-top: 4px solid var(--heading); color: var(--ink);
  transition: transform .25s var(--ease), box-shadow .25s;
}
.press-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.press-outlet { font-family: "Times New Roman", Georgia, serif; font-weight: 700; font-size: 1.25rem; letter-spacing: -.01em; color: var(--heading); }
.press-title { font-family: var(--font-display); font-size: .98rem; line-height: 1.3; color: var(--heading); }
.press-meta { display: flex; align-items: center; gap: .35rem; font-size: .76rem; color: var(--muted); }
.press-meta .icon { width: 13px; height: 13px; }
/* a longer lens label ("Gaze distribution") */
.research-lens-wide span { white-space: nowrap; }

/* chapter arrows: site colours, see-through, with a clock running forward / back */
.map-step .map-step-disc { position: relative; display: grid; place-items: center; flex: none; }
.map-step .icon.map-step-arrow {
  width: 52px; height: 52px; padding: 13px; stroke-width: 2.6; border-radius: 50%;
  color: #fff; transform: rotate(var(--rot, 0deg)); transition: transform .3s var(--ease), box-shadow .2s;
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--paper) 55%, transparent), 0 6px 18px rgba(0, 0, 0, .3);
}
.map-step.is-next .icon.map-step-arrow { background: color-mix(in srgb, var(--moss) 78%, transparent); }
.map-step.is-prev .icon.map-step-arrow { background: color-mix(in srgb, var(--rust) 78%, transparent); }
.map-step:hover .icon.map-step-arrow { box-shadow: 0 0 0 5px color-mix(in srgb, var(--paper) 70%, transparent), 0 8px 22px rgba(0, 0, 0, .35); }
.map-step .icon.map-step-clock {
  position: absolute; left: 50%; bottom: -15px; transform: translateX(-50%);
  width: 26px; height: 26px; padding: 3px; border-radius: 50%; stroke-width: 2;
  background: color-mix(in srgb, var(--paper) 90%, transparent); box-shadow: 0 2px 6px rgba(0, 0, 0, .25);
}
.map-step.is-next .map-step-clock { color: var(--moss); }
.map-step.is-prev .map-step-clock { color: var(--rust); }
[data-theme="dark"] .map-step.is-next .icon.map-step-arrow { background: color-mix(in srgb, #4f8a5c 78%, transparent); }
[data-theme="dark"] .map-step.is-prev .icon.map-step-arrow { background: color-mix(in srgb, #c4673c 78%, transparent); }
[data-theme="dark"] .map-step.is-next .map-step-clock { color: #4f8a5c; }
[data-theme="dark"] .map-step.is-prev .map-step-clock { color: #c4673c; }
.map-step .icon.map-step-clock { width: 30px; height: 30px; bottom: -17px; padding: 2.5px; stroke-width: 1.7; background: rgba(246, 243, 234, .94); }
[data-theme="dark"] .map-step.is-next .map-step-clock { color: var(--moss); }
[data-theme="dark"] .map-step.is-prev .map-step-clock { color: var(--rust); }

/* ---------- research themes: category filters beside the tiles ---------- */
.projects-layout { display: grid; grid-template-columns: 11.5rem minmax(0, 1fr); gap: 1.4rem; align-items: start; }
.project-filters { position: sticky; top: calc(var(--header-h) + 1rem); display: grid; gap: .35rem; }
.filter-title { margin: 0 0 .15rem; font-size: .72rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--accent-text); }
.filter-chip {
  display: flex; align-items: center; gap: .5rem; width: 100%; padding: .45rem .7rem; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line); background: var(--paper-2); color: var(--heading); font: 700 .86rem/1.2 var(--font-body); text-align: left;
  transition: background .2s, border-color .2s, color .2s;
}
.filter-chip .icon { width: 17px; height: 17px; flex: none; }
.filter-chip span { flex: 1; }
.filter-chip small { font-weight: 700; font-size: .72rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.filter-chip:hover { border-color: var(--fern); }
.filter-chip[aria-pressed="true"] { background: var(--forest); border-color: var(--forest); color: var(--cream); }
.filter-chip[aria-pressed="true"] small { color: var(--lichen); }
[data-theme="dark"] .filter-chip[aria-pressed="true"] { background: var(--ochre); border-color: var(--ochre); color: #1d1406; }
[data-theme="dark"] .filter-chip[aria-pressed="true"] small { color: #3b2a0e; }
.project-tile[hidden] { display: none; }
@media (max-width: 860px) {
  .projects-layout { grid-template-columns: 1fr; gap: .8rem; }
  .project-filters { position: static; display: flex; flex-wrap: wrap; gap: .35rem; }
  .filter-title { flex-basis: 100%; }
  .filter-chip { width: auto; }
}

/* ---------- research theme panel: three compact columns, each fits on screen ---------- */
.panel-inner.panel-3col {
  --panel-max: calc(100vh - var(--header-h) - 6rem);
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) 9.5rem; gap: 1.2rem; padding: 1.1rem 1.2rem 1.1rem 1.3rem; align-items: start;
}
.panel-3col .panel-col { max-height: var(--panel-max); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; min-height: 0; }
.panel-3col .panel-main { padding-right: .4rem; }
.panel-3col h3 { font-size: 1.35rem; margin-bottom: .4rem; }
.panel-3col .kicker { margin-bottom: .2rem; }
.panel-3col .panel-main > p { font-size: .92rem; line-height: 1.5; margin: 0 0 .6rem; }
.panel-3col .research-explorer { max-width: 23rem; margin: .3rem auto .6rem; }
.panel-3col .team { margin: .2rem 0 .6rem; font-size: .9rem; }
.panel-3col .block-title { margin: 0 0 .4rem; }
/* side column: media as small cards, then publications that scroll on their own */
.panel-3col .panel-side { display: flex; flex-direction: column; gap: .7rem; overflow: hidden; }
.panel-3col .panel-side > div:not(.panel-pubs-box) { flex: none; }
.panel-3col .videos { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; }
.panel-3col .video { border-radius: 10px; }
.panel-3col .video-title { font-size: .7rem; line-height: 1.25; padding: .3rem .45rem; }
.panel-3col .video-play { width: 34px; height: 34px; }
.panel-3col .video-play .icon { width: 16px; height: 16px; }
.panel-3col .video.is-game::after { font-size: .58rem; top: .3rem; left: .3rem; }
.panel-3col .press-block { margin: 0; }
.panel-3col .press-cards { grid-template-columns: 1fr; gap: .4rem; }
.panel-3col .press-card { padding: .45rem .65rem; border-top-width: 3px; }
.panel-3col .press-outlet { font-size: 1rem; }
.panel-3col .press-title { font-size: .85rem; }
.panel-pubs-box { display: flex; flex-direction: column; min-height: 9rem; flex: 1 1 auto; }
.panel-pubs-list { overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; padding-right: .3rem; min-height: 0; }
.panel-3col .pubs li { font-size: .8rem; line-height: 1.4; padding: .45rem 0 .45rem 2.4rem; }
/* rail: the other themes, one click away */
.panel-rail { display: grid; gap: .45rem; align-content: start; padding-right: .2rem; }
.rail-card {
  position: relative; display: block; width: 100%; aspect-ratio: 16 / 10; padding: 0; border: 0; border-radius: 10px; overflow: hidden; cursor: pointer;
  background: var(--forest); box-shadow: var(--shadow-sm); transition: transform .25s var(--ease), box-shadow .25s;
}
.rail-card img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rail-card span {
  position: absolute; inset: auto 0 0 0; padding: .9rem .45rem .3rem; text-align: left; color: var(--cream);
  font: 700 .72rem/1.2 var(--font-body); background: linear-gradient(transparent, rgba(16, 26, 20, .88));
}
.rail-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
@media (max-width: 1100px) {
  .panel-inner.panel-3col { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .panel-rail { grid-column: 1 / -1; grid-auto-flow: column; grid-auto-columns: 9rem; overflow-x: auto; max-height: none; }
}
@media (max-width: 960px) {
  .panel-inner.panel-3col { grid-template-columns: 1fr; }
  .panel-3col .panel-col { max-height: none; overflow: visible; }
  .panel-3col .panel-side { overflow: visible; }
  .panel-pubs-list { max-height: 22rem; }
}

.panel-3col .panel-side[hidden] { display: none; }
.panel-inner.panel-3col.no-side { grid-template-columns: minmax(0, 1fr) 9.5rem; }
.panel-inner.panel-3col.no-side .panel-main { max-width: 52rem; }
/* the rail never makes the panel taller: it fills the row and scrolls */
@media (min-width: 1101px) {
  .panel-3col .panel-rail { align-self: stretch; height: 0; min-height: 100%; max-height: none; overflow-y: auto; }
}
.rail-card { aspect-ratio: 16 / 9; flex: none; }
@media (min-width: 1101px) { .panel-3col .panel-rail { display: flex; flex-direction: column; gap: .45rem; } }
.panel-rail .block-title { flex: none; }
.panel-3col .panel-side > .research-explorer { flex: none; max-width: 21rem; margin: 0 auto; }
.panel-3col .panel-main .videos { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.panel-3col .panel-main > .press-block, .panel-3col .panel-main > div:has(> .videos) { margin-top: .7rem; }
.panel-3col .panel-side > .panel-figures { flex: none; margin: 0; }
.panel-3col .panel-side .panel-figures figure { margin-bottom: .5rem; }
.panel-3col .panel-side .panel-figures img, .panel-3col .panel-side .panel-figures video { max-height: 38vh; width: 100%; object-fit: contain; }
.panel-3col .panel-side { overflow-y: auto; }
@media (max-width: 1100px) {
  .panel-inner.panel-3col { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .panel-3col .panel-rail { display: flex; gap: .45rem; overflow-x: auto; }
  .panel-3col .panel-rail .block-title { display: none; }
  .panel-3col .panel-rail .rail-card { width: 9rem; }
}
@media (max-width: 960px) {
  .panel-inner.panel-3col, .panel-inner.panel-3col.no-side { grid-template-columns: minmax(0, 1fr); }
  .panel-3col .panel-col, .panel-3col .panel-side { max-height: none; overflow: visible; }
  .panel-3col .panel-rail { overflow-x: auto; }
}

/* ---------- affiliations: below the profile links, transparent logos tinted to the theme ---------- */
:root { --affiliation-row-height: 0px !important; }
.contact-links, .about-affiliations { display: grid; align-items: center; gap: .55rem; width: 100%; }
.contact-links { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.contact-links .pill { display: flex; justify-content: center; padding: .45rem .25rem; font-size: .86rem; white-space: nowrap; }
.about-affiliations { grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 1.1rem 0 0; padding: 0; list-style: none; }
.about-affiliations .affiliation-link { justify-content: center; }
@media (max-width: 560px) {
  .contact-links { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .contact-links li { grid-column: span 2; }
  .contact-links li:nth-child(n + 4) { grid-column: span 3; }
  .about-affiliations { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.about-affiliations .affiliation-link { gap: .4rem; color: var(--muted); font-size: .8rem; font-weight: 600; opacity: .85; transition: opacity .2s; }
.about-affiliations .affiliation-link:hover { opacity: 1; text-decoration: none; color: var(--heading); }
.about-affiliations .affiliation-logo { height: 30px; padding: 0; border-radius: 0; background: none !important; }
.about-affiliations .affiliation-logo--cambridge { width: auto; height: 28px; }
.about-affiliations .affiliation-logo--cca { width: auto; height: 30px; }
.about-affiliations .affiliation-logo--churchill { width: auto; height: 30px; }
.about-affiliations .affiliation-logo--neurocivitas { width: auto; height: 15px; }
/* white logos become dark ink on the light page; the dark Cambridge logo becomes light on the dark page */
.about-affiliations .affiliation-logo--cca,
.about-affiliations .affiliation-logo--churchill,
.about-affiliations .affiliation-logo--neurocivitas { filter: brightness(0) saturate(0); opacity: .8; }
[data-theme="dark"] .about-affiliations .affiliation-logo--cca,
[data-theme="dark"] .about-affiliations .affiliation-logo--churchill,
[data-theme="dark"] .about-affiliations .affiliation-logo--neurocivitas { filter: brightness(0) invert(.92); opacity: .85; }
[data-theme="dark"] .about-affiliations .affiliation-logo--cambridge { filter: brightness(0) invert(.92); opacity: .85; }
.about-affiliations .affiliation-label { display: inline; }
.about-affiliations .affiliation-logo--cca { filter: brightness(0) drop-shadow(0 0 0 #000) drop-shadow(0 0 0 #000); opacity: .85; }
[data-theme="dark"] .about-affiliations .affiliation-logo--cca { filter: brightness(0) invert(.92) drop-shadow(0 0 0 #ebebeb) drop-shadow(0 0 0 #ebebeb); }

/* the Cambridge crest keeps its colours in both themes (dark theme: cream lettering, see data-src-dark) */
[data-theme="dark"] .about-affiliations .affiliation-logo--cambridge { filter: none; opacity: 1; }

/* new CCA logo (light / dark versions, coloured lines kept), larger Churchill crest, no text labels */
.about-affiliations .affiliation-logo--cca,
[data-theme="dark"] .about-affiliations .affiliation-logo--cca { height: 34px; width: auto; filter: none; opacity: 1; }
.about-affiliations .affiliation-logo--churchill { height: 44px; }

/* ---------- research themes: compact tiles ---------- */
#project-grid.vignette-grid { grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: .7rem; }
#project-grid .project-tile { aspect-ratio: 16 / 11; border-radius: 12px; }
#project-grid .vignette-body { padding: .55rem .65rem; }
#project-grid .vignette-title { font-size: .98rem; margin: 0; }
#project-grid .vignette-summary { display: none; }
#project-grid .tile-meta { margin-top: .25rem; font-size: .7rem; gap: .5rem; }
#project-grid .tile-meta .icon { width: 12px; height: 12px; }
#project-grid .tile-play { padding: 0 .35rem; }

/* ---------- research theme panel: two columns, the same in every theme ---------- */
.panel-inner.panel-2col {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.6rem; align-items: start;
  padding: 1.1rem 1.3rem 1.2rem;
}
.panel-inner.panel-2col.no-side { grid-template-columns: minmax(0, 52rem); }
.panel-tools { position: absolute; top: .65rem; right: .65rem; z-index: 2; display: flex; align-items: center; gap: .4rem; }
.panel-tools .panel-close { position: static; }
.panel-2col .kicker { margin-bottom: .2rem; }
.panel-2col h3 { font-size: 1.35rem; margin-bottom: .45rem; }
.panel-2col .panel-main h3 { padding-right: 6.5rem; }
.panel-2col .panel-main > p { font-size: .93rem; line-height: 1.5; margin: 0 0 .6rem; }
.panel-2col .team { margin: .2rem 0 .9rem; font-size: .9rem; }
.panel-2col .block-title { margin: 0 0 .4rem; }
.panel-2col .panel-main > div + div { margin-top: .8rem; }
.panel-2col .videos { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .5rem; }
.panel-2col .video { border-radius: 10px; }
.panel-2col .video-title { font-size: .7rem; line-height: 1.25; padding: .3rem .45rem; }
.panel-2col .video-play { width: 34px; height: 34px; }
.panel-2col .video-play .icon { width: 16px; height: 16px; }
.panel-2col .video.is-game::after { font-size: .58rem; top: .3rem; left: .3rem; }
.panel-2col .press-block { margin: 0; }
.panel-2col .press-cards { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .5rem; }
.panel-2col .press-card { padding: .45rem .65rem; border-top-width: 3px; }
.panel-2col .press-outlet { font-size: 1rem; }
.panel-2col .press-title { font-size: .85rem; }
.panel-2col .panel-side { display: grid; gap: 1rem; padding-top: 2.4rem; }
.panel-2col .panel-side .research-explorer { max-width: 24rem; margin: 0 auto; }
.panel-2col .panel-side .panel-figures { display: grid; gap: .6rem; margin: 0; overflow: visible; padding: 0; }
.panel-2col .panel-side .panel-figures figure { margin: 0; flex: none; width: 100%; }
.panel-2col .panel-side .panel-figures img, .panel-2col .panel-side .panel-figures video { width: 100%; max-height: 40vh; object-fit: contain; border-radius: 10px; }
.panel-2col .pubs li { font-size: .82rem; line-height: 1.4; padding: .45rem 0 .45rem 2.4rem; }
.panel-pubs-box.is-collapsed .pubs li:nth-child(n + 5) { display: none; }
.pubs-more {
  margin-top: .35rem; border: 1px solid var(--line); background: var(--paper-2); color: var(--heading); cursor: pointer;
  border-radius: 999px; padding: .3rem .8rem; font: 700 .8rem/1.2 var(--font-body);
}
.pubs-more:hover { border-color: var(--fern); }
@media (max-width: 960px) {
  .panel-inner.panel-2col, .panel-inner.panel-2col.no-side { grid-template-columns: minmax(0, 1fr); }
  .panel-2col .panel-side { padding-top: 0; }
}

/* ---------- share buttons ---------- */
.share-btn {
  display: inline-flex; align-items: center; gap: .3rem; padding: .25rem .65rem; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line); background: var(--paper-2); color: var(--heading); font: 700 .74rem/1.2 var(--font-body);
}
.share-btn .icon { width: 14px; height: 14px; }
.share-btn:hover { border-color: var(--fern); }
.theater-game-head .share-btn { margin-left: auto; }
.dialog-share { position: absolute; top: .9rem; right: 4rem; z-index: 3; }
.panel-pubs-box.is-collapsed .pubs li:nth-child(n + 4) { display: none; }
.panel-2col .panel-side .research-explorer { max-width: 21rem; }
.panel-2col .panel-side .panel-figures:has(figure + figure) { grid-template-columns: 1fr 1fr; align-items: start; }
.panel-2col .panel-side .panel-figures img, .panel-2col .panel-side .panel-figures video { max-height: 32vh; }
.panel-2col .panel-side .panel-figures figcaption { font-size: .74rem; }
.panel-pubs-box.is-collapsed .pubs li { display: list-item; }
.panel-pubs-box.is-collapsed .pubs li:nth-child(n + 4) { display: none; }
.panel-side:has(.research-explorer) .panel-pubs-box.is-collapsed .pubs li:nth-child(n + 3) { display: none; }
.panel-2col .panel-side .research-explorer { max-width: 19.5rem; }

/* Methods: the map column is exactly as wide as the map (set by sim.js), no gap before the sensors */
@media (min-width: 1081px) {
  #methods .sim-stage { grid-template-columns: 13.5rem var(--sim-w, minmax(0, 1fr)) 320px; justify-content: start; }
}
@media (min-width: 1081px) { #methods .container { max-width: min(2300px, calc(100vw - 3rem)); } }

/* Methods sensors column: never scrolls; everything shown at once, kept compact */
#methods .sim-side, #methods .sim-side .sim-panel { max-height: none !important; overflow: visible !important; }
#methods .sim-side { gap: .4rem; }
#methods .sim-panel { padding: .55rem .6rem .6rem; }
#methods .sim-panel-title { margin: 0 .2rem .3rem; }
#methods .sim-topo-legend { margin: 0 .2rem .4rem; }
#methods .sim-modalities { gap: .25rem; }
#methods .sim-modality { padding-block: .12rem; }
#methods .sim-modalities .sim-note { line-height: 1.25; }
#methods .sim-side .sim-pov { margin-top: .4rem; }
@media (min-width: 1081px) and (max-height: 1000px) and (max-width: 1700px) {
  #methods .sim-modalities { grid-template-columns: 1fr 1fr; }
  #methods .sim-modality-name { font-size: .72rem; white-space: normal; }
  #methods .sim-modality-icon { width: 20px; height: 20px; }
  #methods .sim-modality-icon .icon { width: 12px; height: 12px; }
  #methods .sim-side .sim-pov canvas { aspect-ratio: 16 / 8; }
  #methods .sim-topo-legend { display: none; }
}

/* ---------- Methods: sensor toggles under the edit tools; environmental sensors ---------- */
.sim.hide-env [data-layer="env"] { display: none; }
.sim-toolbar-right { display: grid; justify-items: end; gap: .35rem; }
#methods .sim-toolbar-right { pointer-events: none; }
#methods .sim-toolbar-right > * { pointer-events: auto; }
#methods .sim-toolbar .sim-modalities {
  display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .2rem; padding: .25rem .3rem; grid-template-columns: none;
  border-radius: 12px; background: color-mix(in srgb, var(--forest-2) 90%, transparent);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); box-shadow: 0 6px 18px rgba(0, 0, 0, .22);
}
#methods .sim-toolbar .sim-modality { width: auto; gap: .3rem; padding: .12rem .3rem .12rem .15rem; border-radius: 999px; }
#methods .sim-toolbar .sim-modality-icon { width: 20px; height: 20px; }
#methods .sim-toolbar .sim-modality-icon .icon { width: 12px; height: 12px; }
#methods .sim-toolbar .sim-modality-name { font-size: .68rem; white-space: nowrap; flex: none; }
#methods .sim-toolbar .sim-switch { width: 24px; height: 14px; }
#methods .sim-toolbar .sim-switch::after { top: 2px; left: 2px; width: 10px; height: 10px; }
#methods .sim-toolbar .sim-modality[aria-pressed="true"] .sim-switch::after { transform: translateX(10px); }
.sim-agent-env { display: flex; flex-wrap: wrap; align-items: center; gap: .2rem .8rem; margin-top: .25rem; padding-left: .1rem; }
.sim-agent-env .sim-chip .icon { width: 13px; height: 13px; }
.sim-noise.is-loud { color: #c9462f; font-weight: 700; }
@media (min-width: 1081px) {
  #methods .sim-toolbar { flex-wrap: nowrap; }
  #methods .sim-toolbar-right { min-width: 0; flex: 0 1 auto; }
  #methods .sim-toolbar .sim-tools { justify-self: end; }
}
@media (min-width: 1081px) and (max-width: 1700px) {
  #methods .sim-toolbar .sim-modality-name { font-size: .64rem; }
  #methods .sim-controls .sim-range input { width: 96px; }
}
#methods .sim-toolbar .sim-modalities { justify-self: end; width: max-content; max-width: 100%; }
#methods .sim-range output { white-space: nowrap; }

/* Methods: play and sliders in the bottom-left corner of the map, the hint bottom right */
@media (min-width: 1081px) {
  #methods .sim-arena > .sim-controls { position: absolute; z-index: 3; left: .55rem; bottom: .55rem; }
  #methods .sim-toolbar { justify-content: flex-end; }
  #methods .sim-hint { left: auto; right: 12px; }
}
/* sensor toggles in two short rows: eye-tracking, EEG, heart rate / location, environment */
#methods .sim-toolbar .sim-modalities { display: grid; grid-template-columns: repeat(3, auto); gap: .2rem; justify-content: end; }
#methods .sim-toolbar .sim-modality[data-id="gaze"] { grid-area: 1 / 1; }
#methods .sim-toolbar .sim-modality[data-id="eeg"] { grid-area: 1 / 2; }
#methods .sim-toolbar .sim-modality[data-id="physio"] { grid-area: 1 / 3; }
#methods .sim-toolbar .sim-modality[data-id="location"] { grid-area: 2 / 2; }
#methods .sim-toolbar .sim-modality[data-id="env"] { grid-area: 2 / 3; }
#methods .sim-toolbar .sim-modality { justify-content: space-between; }

/* mini games: flagged on the theme tile and on the card */
.video.is-game::after { content: "Mini game"; }
.tile-play { display: inline-flex; align-items: center; gap: .25rem; }
.tile-play-label { font-size: .62rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.theater-game .meal-gaze { max-width: 1100px; margin-inline: auto; }
/* mini games: the controller icon alone marks them (no text badge) */
.video.is-game::after { content: none; display: none; }

/* ---------- kilometres per year (opened from the swim / ride / run totals) ---------- */
.sport-stat { cursor: pointer; border-radius: 10px; padding: .1rem .35rem; margin: -.1rem -.35rem; transition: background .2s; }
.sport-stat:hover, .sport-stat:focus-visible { background: color-mix(in srgb, var(--cream) 12%, transparent); outline: none; }
.sport-stat dd { text-decoration: underline dotted color-mix(in srgb, currentColor 45%, transparent); text-underline-offset: 4px; }
.map-years {
  position: absolute; z-index: 3; top: 12px; right: 12px; width: min(330px, calc(100% - 24px));
  padding: .45rem .6rem .4rem; border-radius: 12px; font-size: .72rem; color: var(--ink);
  background: color-mix(in srgb, var(--paper) 78%, transparent); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  box-shadow: var(--shadow-sm);
}
.map-years[hidden] { display: none; }
.years-head { display: flex; align-items: center; justify-content: space-between; }
.years-title { margin: 0; font-weight: 700; color: var(--heading); font-size: .78rem; }
.years-chips { display: flex; gap: .25rem; margin: .3rem 0 .25rem; }
.years-chip {
  display: inline-flex; align-items: center; gap: .25rem; padding: .12rem .45rem; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line); background: transparent; color: var(--muted); font: 700 .68rem/1.2 var(--font-body);
}
.years-chip .icon { width: 12px; height: 12px; }
.years-chip[aria-pressed="true"] { color: var(--heading); background: color-mix(in srgb, var(--paper-2) 85%, transparent); border-color: var(--heading); }
.years-chip[aria-pressed="false"] .stats-key { opacity: .35; }
.years-svg { display: block; width: 100%; height: auto; overflow: visible; }
.years-grid { stroke: color-mix(in srgb, var(--heading) 14%, transparent); stroke-width: 1; vector-effect: non-scaling-stroke; }
.years-base { stroke: color-mix(in srgb, var(--heading) 35%, transparent); stroke-width: 1; vector-effect: non-scaling-stroke; }
.years-tick { fill: var(--muted); font: 600 8px var(--font-body); font-variant-numeric: tabular-nums; }
.years-hit { fill: transparent; }
.years-col.is-hover .years-hit { fill: color-mix(in srgb, var(--heading) 9%, transparent); }
.years-rows { display: grid; gap: .1rem; }
.years-row { display: grid; grid-template-columns: 3.4rem 1fr; align-items: center; gap: .2rem; }
.years-row-label { display: flex; align-items: center; gap: .2rem; font-weight: 700; color: var(--heading); font-size: .66rem; }
.years-row-label .icon { width: 11px; height: 11px; }
.years-tip { margin: .2rem 0 0; color: var(--heading); font-weight: 600; font-variant-numeric: tabular-nums; min-height: 1.2em; }
