/* =====================================================================
   DYNAMICA – shared stylesheet (all pages)
   Brand colours live ONLY in the "BRAND" block below: change them there
   if the logo / palette changes.
   ===================================================================== */

/* ---------- BRAND ---------- */
:root {
  --brand-1: #9955ff;            /* violet */
  --brand-2: #80b3ff;            /* sky blue */
  --brand-3: #7e6bff;            /* indigo (in between) */
  --brand-1-rgb: 153, 85, 255;
  --brand-2-rgb: 128, 179, 255;
  --brand-3-rgb: 126, 107, 255;
  --grad: linear-gradient(120deg, var(--brand-2) 0%, var(--brand-3) 45%, var(--brand-1) 100%);
  /* sector accents of the use-cases page, in tone with the brand (dark theme / light theme) */
  --sec-food-rgb: 255, 162, 107;   --sec-food-rgb-light: 194, 90, 18;     /* amber */
  --sec-health-rgb: 255, 111, 174; --sec-health-rgb-light: 192, 38, 110;  /* rose */
  --sec-sense-rgb: 63, 216, 201;   --sec-sense-rgb-light: 11, 143, 132;   /* teal */
}

/* ---------- THEMES ---------- */
:root, :root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b0814;
  --bg-2: #110d1d;
  --surface: rgba(255, 255, 255, 0.035);
  --surface-2: rgba(255, 255, 255, 0.06);
  --line: rgba(196, 180, 255, 0.12);
  --line-strong: rgba(196, 180, 255, 0.24);
  --text: #f3efff;
  --muted: #a49cbf;
  --faint: #6f6890;
  --nav-bg: rgba(11, 8, 20, 0.72);
  --shadow: 0 1px 0 rgba(255,255,255,0.04) inset, 0 20px 50px -24px rgba(0,0,0,0.7);
  --glow: 0 0 0 1px rgba(var(--brand-1-rgb), .35), 0 18px 50px -18px rgba(var(--brand-1-rgb), .45);
  /* canvas colours (r,g,b) */
  --viz-c1: var(--brand-1-rgb); --viz-c2: var(--brand-2-rgb); --viz-c3: var(--brand-3-rgb);
  --viz-bg: 11, 8, 20; --viz-ink: 236, 230, 255; --viz-dark: 1;
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #fbfaff;
  --bg-2: #f3f0fb;
  --surface: #ffffff;
  --surface-2: #f6f3fd;
  --line: rgba(60, 40, 120, 0.10);
  --line-strong: rgba(60, 40, 120, 0.20);
  --text: #160f2e;
  --muted: #5d5878;
  --faint: #8d88a6;
  --nav-bg: rgba(251, 250, 255, 0.78);
  --shadow: 0 1px 2px rgba(30, 20, 70, .04), 0 18px 40px -22px rgba(60, 40, 140, .22);
  --glow: 0 0 0 1px rgba(var(--brand-1-rgb), .30), 0 18px 44px -20px rgba(var(--brand-1-rgb), .35);
  --viz-bg: 251, 250, 255; --viz-ink: 40, 30, 80; --viz-dark: 0;
}
/* ---------- BASE ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; scroll-padding-top: 84px; }
body {
  background: var(--bg); color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px; line-height: 1.6; overflow-x: hidden;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  transition: background-color .4s ease, color .4s ease;
}
img, video, canvas, svg { display: block; max-width: 100%; }
a { color: inherit; }
::selection { background: rgba(var(--brand-1-rgb), .35); }
:focus-visible { outline: 2px solid var(--brand-2); outline-offset: 3px; border-radius: 6px; }
.mono { font-family: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace; }

.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding-inline: clamp(16px, 4vw, 40px); }
.section { padding-block: clamp(72px, 10vw, 128px); position: relative; }
.section + .section { border-top: 1px solid var(--line); }

/* subtle page-wide grid texture */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(60% 50% at 15% 0%, rgba(var(--brand-1-rgb), .10), transparent 70%),
    radial-gradient(50% 40% at 100% 30%, rgba(var(--brand-2-rgb), .08), transparent 70%);
}

/* ---------- TYPE ---------- */
h1, h2, h3, h4 { line-height: 1.12; letter-spacing: -0.022em; font-weight: 750; }
h1 { font-size: clamp(2.3rem, 6.4vw, 5.2rem); font-weight: 800; letter-spacing: -0.035em; }
h2 { font-size: clamp(1.8rem, 4vw, 3rem); margin-bottom: 1rem; }
h3 { font-size: 1.2rem; }
h4 { font-size: 1rem; }
p { color: var(--muted); }
.lead { font-size: clamp(1rem, 1.4vw, 1.12rem); color: var(--muted); max-width: 640px; line-height: 1.75; }
.grad, .g { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent; }
.eyebrow {
  display: inline-flex; align-items: center; gap: .55rem;
  font-size: .72rem; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; color: var(--brand-2);
  margin-bottom: 1rem;
}
.eyebrow::before { content: ""; width: 18px; height: 2px; border-radius: 2px; background: var(--grad); }
:root[data-theme="light"] .eyebrow { color: var(--brand-1); }
.section-head { margin-bottom: clamp(2rem, 4vw, 3.2rem); }
.section-head.center { text-align: center; }
.section-head.center .lead { margin-inline: auto; }

/* ---------- BUTTONS (the only button styles of the site) ---------- */
.btn {
  --h: 48px;
  display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
  height: var(--h); padding: 0 1.4rem; border-radius: 999px;
  font: inherit; font-size: .92rem; font-weight: 650; letter-spacing: .01em; line-height: 1;
  text-decoration: none; white-space: nowrap; cursor: pointer;
  border: 1px solid transparent; background: none; color: var(--text);
  transition: transform .2s ease, box-shadow .25s ease, background-color .2s ease, border-color .2s ease, color .2s ease;
}
.btn svg { width: 16px; height: 16px; flex-shrink: 0; transition: transform .2s ease; }
.btn:hover svg.arrow-r { transform: translateX(3px); }
.btn:hover svg.arrow-l { transform: translateX(-3px); }
.btn-primary { background: var(--grad); color: #fff; box-shadow: 0 10px 30px -12px rgba(var(--brand-1-rgb), .7); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 16px 36px -12px rgba(var(--brand-1-rgb), .85); }
.btn-ghost { border-color: var(--line-strong); background: var(--surface); }
.btn-ghost:hover { border-color: rgba(var(--brand-1-rgb), .6); background: var(--surface-2); transform: translateY(-2px); }
.btn-text { padding: 0 .2rem; height: auto; color: var(--muted); }
.btn-text:hover { color: var(--text); }
.btn-sm { --h: 38px; padding: 0 1rem; font-size: .84rem; }
.btn-xs { --h: 32px; padding: 0 .85rem; font-size: .78rem; }

/* icon-only round button */
.icon-btn {
  width: 38px; height: 38px; border-radius: 999px; display: inline-grid; place-items: center;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); cursor: pointer;
  transition: border-color .2s, background-color .2s, transform .2s;
}
.icon-btn:hover { border-color: rgba(var(--brand-1-rgb), .6); transform: translateY(-1px); }
.icon-btn svg { width: 17px; height: 17px; }
.icon-btn .i-sun { display: none; }
:root[data-theme="light"] .icon-btn .i-sun { display: block; }
:root[data-theme="light"] .icon-btn .i-moon { display: none; }

/* segmented language switch */
.seg { display: inline-flex; height: 38px; padding: 3px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface); }
.seg button {
  border: 0; background: none; color: var(--muted); font: inherit; font-size: .74rem; font-weight: 700; letter-spacing: .08em;
  padding: 0 .75rem; border-radius: 999px; cursor: pointer; transition: color .2s, background-color .2s;
}
.seg button[aria-pressed="true"] { background: var(--grad); color: #fff; }

/* ---------- NAV ---------- */
.site-nav {
  position: fixed; inset: 0 0 auto 0; z-index: 100;
  transition: background-color .3s, border-color .3s, backdrop-filter .3s;
  border-bottom: 1px solid transparent;
}
.site-nav.scrolled, .site-nav.solid {
  background: var(--nav-bg); border-bottom-color: var(--line);
  backdrop-filter: saturate(1.4) blur(18px); -webkit-backdrop-filter: saturate(1.4) blur(18px);
}
.nav-inner { height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; }
.brand { display: inline-flex; align-items: center; gap: .65rem; text-decoration: none; color: var(--text); flex-shrink: 0; }
.brand img { width: 36px; height: 36px; object-fit: contain; }
.brand-word { font-weight: 800; font-size: 1.14rem; letter-spacing: .16em; }
.nav-links { display: flex; align-items: center; gap: .3rem; list-style: none; }
.nav-links a {
  display: inline-block; padding: .45rem .8rem; border-radius: 999px; text-decoration: none;
  font-size: .88rem; font-weight: 550; color: var(--muted); transition: color .2s, background-color .2s;
}
.nav-links a:hover { color: var(--text); background: var(--surface-2); }
.nav-links a.active { color: var(--text); }
.nav-actions { display: flex; align-items: center; gap: .5rem; }
.menu-btn { display: none; }
.menu-btn .i-close { display: none; }
.nav-open .menu-btn .i-close { display: block; }
.nav-open .menu-btn .i-menu { display: none; }

.nav-drawer {
  position: fixed; inset: 72px 0 0 0; z-index: 99; display: none; flex-direction: column; gap: .4rem;
  padding: 1.5rem clamp(16px, 4vw, 40px) 2rem; background: var(--bg); overflow-y: auto;
}
.nav-open .nav-drawer { display: flex; animation: drawerIn .25s ease; }
.nav-drawer a.dl {
  font-size: 1.5rem; font-weight: 700; letter-spacing: -.01em; text-decoration: none; color: var(--text);
  padding: .55rem 0; border-bottom: 1px solid var(--line);
}
.nav-drawer .drawer-controls { display: flex; gap: .6rem; align-items: center; margin-top: 1.4rem; }
@keyframes drawerIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

/* ---------- HERO (home) ---------- */
.hero { position: relative; min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; overflow: hidden; isolation: isolate; }
.hero canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; }
.hero::after { content: ""; position: absolute; inset: auto 0 0 0; height: 28%; z-index: -1; pointer-events: none; background: linear-gradient(to bottom, transparent, var(--bg)); }
.hero-inner { flex: 1; display: flex; align-items: center; justify-content: center; }
.hero-copy { max-width: 1120px; margin: 0 auto; padding: 130px 0 40px; text-align: center; }
.hero-copy .kicker { margin-bottom: 1.6rem; }
.hero-copy h1 { margin-bottom: 1.6rem; font-size: clamp(2.4rem, 5.8vw, 5.6rem); line-height: 1.04; }
@media (min-width: 760px) { .hero-copy h1 span { white-space: nowrap; } }
.hero-copy h1 span { display: block; }
.hero-copy .lead { margin: 0 auto 2.4rem; max-width: 660px; }
.hero-cta { display: flex; gap: .8rem; flex-wrap: wrap; justify-content: center; }
.hero-foot { position: relative; display: flex; align-items: flex-end; justify-content: center; gap: 2rem; padding-bottom: 36px; }
.stats { display: flex; justify-content: center; text-align: center; gap: clamp(1.5rem, 5vw, 4.5rem); flex-wrap: wrap; padding-top: 1.4rem; border-top: 1px solid var(--line); }
.stats div { min-width: 110px; }
.stats dt { font-size: clamp(1.6rem, 3vw, 2.2rem); font-weight: 800; letter-spacing: -.03em; line-height: 1; }
.stats dd { margin-top: .45rem; font-size: .78rem; color: var(--muted); }

/* ---------- PAGE HEADER (inner pages) ---------- */
.page-head { padding: 140px 0 clamp(2.5rem, 5vw, 4rem); }
.page-head h1 { font-size: clamp(2.2rem, 5vw, 3.8rem); margin-bottom: 1rem; }

/* ---------- SHARED small pieces ---------- */
.kicker { font-family: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace; font-size: .72rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--brand-2); }
:root[data-theme="light"] .kicker { color: var(--brand-1); }
.num { font-size: .95rem; font-weight: 800; letter-spacing: .04em; font-variant-numeric: tabular-nums; }
.rule { border-top: 1px solid var(--line); }
.link-more {
  display: inline-flex; align-items: center; gap: .4rem; margin-top: .9rem; align-self: flex-start;
  font-size: .86rem; font-weight: 650; color: var(--text); text-decoration: none;
  background-image: var(--grad); background-size: 0 1.5px; background-position: 0 100%; background-repeat: no-repeat;
  transition: background-size .3s ease; padding-bottom: 2px;
}
.link-more svg { width: 15px; height: 15px; transition: transform .2s ease; }
.link-more:hover { background-size: 100% 1.5px; }
.link-more:hover svg { transform: translateX(3px); }

/* ---------- CHAPTERS (single column, full width) ---------- */
.chapter { padding-block: clamp(80px, 10vw, 140px); border-top: 1px solid var(--line); overflow: hidden; }
.chapter .kicker { display: block; margin-bottom: 1.2rem; }
.chapter h2 { max-width: 900px; margin-bottom: 1.3rem; }
.chapter .lead { margin-bottom: 2.2rem; }
.statement { font-size: clamp(2.1rem, 5vw, 4rem); line-height: 1.06; letter-spacing: -.03em; max-width: 1050px; margin-bottom: clamp(2.2rem, 5vw, 4rem) !important; }
.statement .w { opacity: .18; transition: opacity .25s linear; }
.statement .w.on { opacity: 1; }

/* ---------- SPLIT ---------- */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 5vw, 4.5rem); align-items: center; }
.split.media-right { grid-template-columns: .85fr 1.15fr; }
.split.top { align-items: start; }
/* mission: two text columns, then the intro video at full width */
.mission-copy { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(1.5rem, 4vw, 4rem); align-items: start; }
.mission-copy .lead, .vision .lead { max-width: none; margin-bottom: 0; }
.vision .lead + .lead { margin-top: 0; }
.vision strong { font-weight: 700; }
.feature { margin-top: clamp(2rem, 5vw, 4rem); width: calc(100% + 2 * clamp(0px, 3vw, 40px)); margin-inline: calc(-1 * clamp(0px, 3vw, 40px)); }

/* ---------- VIZ (canvas / transparent video on the page) ---------- */
.viz { position: relative; aspect-ratio: 1 / 1; width: 100%; will-change: transform; }
.viz.r43 { aspect-ratio: 4 / 3; }
.viz.wide { aspect-ratio: 16 / 9; }
.viz canvas, .viz video, .viz img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.viz::before { content: ""; position: absolute; inset: 10%; border-radius: 50%; pointer-events: none; background: radial-gradient(closest-side, rgba(var(--brand-1-rgb), .16), transparent); filter: blur(12px); }
.sticky-viz { position: sticky; top: 90px; }
/* Approach box: the free-energy animation and the pocket video slide into each other */
.viz[data-swap] { overflow: hidden; touch-action: pan-y; cursor: grab; user-select: none; }
.swap-ctrl { display: flex; justify-content: center; gap: .5rem; margin-top: 1rem; }
.swap-ctrl .icon-btn { width: 42px; height: 42px; }
.swap-ctrl .icon-btn[disabled] { opacity: .3; cursor: default; transform: none; }
.viz-track { position: absolute; inset: 0; display: flex; transition: transform 1.1s cubic-bezier(.65, 0, .25, 1); }
.viz-pane { position: relative; flex: 0 0 100%; height: 100%; }
[data-zoom] { transform: scale(var(--z, 1)); opacity: var(--zo, 1); transition: transform .1s linear; }

/* mission: at the end of the video the box narrows to the left (the complex keeps its size: object-fit cover
   only crops the empty sides) and the two contact profiles (canvas, drawn by site.js) come in on the right */
.mission-stage { position: relative; aspect-ratio: 16 / 9; }
.mission-stage > .viz { position: absolute; top: 0; left: 0; width: 100%; height: 100%; transition: width 1.2s cubic-bezier(.65, 0, .25, 1); }
.mission-stage > .viz video { object-fit: cover; object-position: 36% 50%; }   /* 36 %: the complex (x 275-1148 of 1600) stays whole in the 60 % box */
.mission-stage.maps-on > .viz { width: 60%; }
.contact-maps { position: absolute; top: 0; right: 0; width: 40%; height: 100%; display: flex; align-items: center; opacity: 0; pointer-events: none; transition: opacity .8s ease; }
.mission-stage.maps-on .contact-maps { opacity: 1; transition-delay: .4s; }
.contact-maps canvas { display: block; width: 100%; height: 64%; }
/* controls under the mission video: play/pause (same round button as the other controls) + scrub bar */
.video-ctrl { display: flex; align-items: center; gap: .9rem; margin-top: .9rem; }
.video-ctrl .icon-btn { width: 38px; height: 38px; flex: none; }
.video-ctrl .icon-btn svg { width: 14px; height: 14px; }
.video-ctrl .i-play { display: none; }
.video-ctrl.is-paused .i-play { display: block; }
.video-ctrl.is-paused .i-pause { display: none; }
/* scrub bar: a thin line (progress in the brand gradient), thicker with a knob on hover/drag */
.scrub { --p: 0; position: relative; flex: 1; height: 24px; cursor: pointer; touch-action: none; user-select: none; -webkit-user-select: none; outline: none; }
.scrub::before, .scrub-fill { content: ''; position: absolute; left: 0; top: 50%; height: 3px; border-radius: 3px; transform: translateY(-50%); transition: height .2s ease; }
.scrub::before { right: 0; background: var(--line-strong); }
.scrub-fill { width: calc(var(--p) * 100%); background: var(--grad); }
.scrub-thumb { position: absolute; top: 50%; left: calc(var(--p) * 100%); width: 13px; height: 13px; border-radius: 50%; background: var(--text); transform: translate(-50%, -50%) scale(0); transition: transform .2s ease; }
.scrub:hover::before, .scrub:hover .scrub-fill, .scrub.dragging::before, .scrub.dragging .scrub-fill, .scrub:focus-visible::before, .scrub:focus-visible .scrub-fill { height: 5px; }
.scrub:hover .scrub-thumb, .scrub.dragging .scrub-thumb, .scrub:focus-visible .scrub-thumb { transform: translate(-50%, -50%) scale(1); }
.scrub:focus-visible .scrub-thumb { box-shadow: 0 0 0 3px rgba(var(--brand-1-rgb), .45); }
@media (hover: none) { .scrub .scrub-thumb { transform: translate(-50%, -50%) scale(1); } }

/* ---------- ROWS (services) ---------- */
.rows { list-style: none; margin-top: clamp(2.5rem, 5vw, 4rem); border-bottom: 1px solid var(--line); }
.row { position: relative; display: grid; grid-template-columns: minmax(220px, 1fr) 1.5fr; gap: 1.5rem 3rem; padding: 2rem 0; border-top: 1px solid var(--line); transition: padding .4s cubic-bezier(.2,.7,.2,1); }
.row::before { content: ""; position: absolute; left: 0; top: -1px; height: 1px; width: 0; background: var(--grad); transition: width .6s cubic-bezier(.2,.7,.2,1); }
.row:hover::before { width: 100%; }
.row:hover { padding-left: .6rem; }
.row-head .kicker { margin-bottom: .4rem !important; }
.row h3 { font-size: clamp(1.3rem, 2.2vw, 1.7rem); }
.row p { font-size: .98rem; line-height: 1.72; }

/* ---------- HORIZONTAL SCROLLERS ---------- */
.h-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 2rem; margin-bottom: clamp(1.8rem, 4vw, 3rem); }
.h-head h2 { margin-bottom: 0 !important; }
.h-ctrl { display: flex; gap: .5rem; flex-shrink: 0; }
.h-ctrl .icon-btn { width: 46px; height: 46px; }
.h-ctrl .icon-btn[disabled] { opacity: .3; cursor: default; transform: none; }
.hscroll {
  --gutter: max(clamp(16px, 4vw, 40px), calc((100vw - 1180px) / 2 + clamp(16px, 4vw, 40px)));
  display: flex; gap: clamp(1.2rem, 3vw, 2.5rem); overflow-x: auto; overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory; scroll-padding-inline: var(--gutter); padding-inline: var(--gutter);
  scrollbar-width: none; list-style: none; cursor: grab; -webkit-overflow-scrolling: touch;
}
.hscroll::-webkit-scrollbar { display: none; }
.hscroll.dragging { cursor: grabbing; scroll-snap-type: none; }
.hscroll.dragging * { pointer-events: none; user-select: none; }
.hscroll > * { scroll-snap-align: start; flex-shrink: 0; }
.h-progress { margin-top: 2rem; height: 2px; background: var(--line); border-radius: 2px; overflow: hidden; }
.h-progress i { display: block; height: 100%; width: 25%; background: var(--grad); transform-origin: left; transition: transform .2s ease-out; }

/* facts: text panels separated by a vertical rule */
.facts > li { width: min(400px, 78vw); padding: .4rem 2.2rem .4rem 0; border-right: 1px solid var(--line); }
.facts > li:last-child { border-right: 0; }
.facts h4 { font-size: 1.25rem; margin-bottom: .7rem; }
.facts p { font-size: .96rem; line-height: 1.72; }
/* wide screens: the four facts fit in the page width, title on one line, no scrolling */
@media (min-width: 1101px) {
  #why h2 { max-width: none; white-space: nowrap; font-size: min(2.6rem, 3.2vw); }
  #why .br-narrow { display: none; }
  #why .h-ctrl { display: none; }
  .facts { display: grid; grid-template-columns: repeat(4, 1fr); overflow: visible; cursor: auto; }
  .facts > li { width: auto; }
}

/* sector slides: very large transparent video + text */
.slide { width: min(1180px, 88vw); display: grid; grid-template-columns: 1fr 1.9fr; gap: clamp(1.2rem, 3vw, 2.5rem); align-items: center; }
.slide-text h3 { font-size: clamp(1.4rem, 2.6vw, 2.1rem); margin-bottom: .9rem; }
.slide-text p { font-size: .98rem; line-height: 1.75; }

/* ---------- APPROACH steps ---------- */
.steps { list-style: none; display: grid; border-bottom: 1px solid var(--line); }
.step { padding: 1.8rem 0; border-top: 1px solid var(--line); }
.step .kicker { margin-bottom: .5rem !important; }
.step h4 { font-size: 1.2rem; margin-bottom: .5rem; }
.step p { font-size: .95rem; line-height: 1.68; }

/* ---------- PEOPLE (team) ---------- */
.people { display: grid; grid-template-columns: repeat(4, 1fr); gap: clamp(1rem, 2.5vw, 2rem); margin-top: clamp(2rem, 4vw, 3rem); }
.person { display: flex; flex-direction: column; text-decoration: none; color: inherit; }
.person-photo { aspect-ratio: 3 / 4; overflow: hidden; border-radius: 4px; background: var(--bg-2); }
.person-photo img { width: 100%; height: 100%; object-fit: cover; transition: transform .9s cubic-bezier(.2,.7,.2,1); }
.person:hover .person-photo img { transform: scale(1.04); }
.person-text { padding-top: 1.1rem; display: flex; flex-direction: column; gap: .35rem; flex: 1; }
.person-text h4 { font-size: 1.3rem; }
.person-role { font-size: .9rem; font-weight: 700; letter-spacing: .05em; }
.person-text p { font-size: .87rem; line-height: 1.55; flex: 1; text-align: justify; hyphens: auto; -webkit-hyphens: auto; }
.person-text h4 { text-align: center; }
.person-meta { display: flex; flex-direction: column; align-items: center; gap: .45rem; text-align: center; }   /* name, role and LinkedIn centred under the photo */
.person-in { display: inline-flex; color: var(--faint); }   /* LinkedIn mark under the role, centred */
.person-in svg { width: 22px; height: 22px; }
a.person-in { color: var(--muted); transition: color .2s, transform .2s; }
a.person-in:hover { color: var(--brand-2); transform: translateY(-1px); }

/* ---------- CONTACT ---------- */
.contact-chapter { text-align: center; }
.contact { max-width: 900px; margin: 0 auto; }
.contact h2 { font-size: clamp(2.2rem, 5.4vw, 4.2rem); line-height: 1.05; margin: 0 auto 1.4rem; }
.contact .lead { margin: 0 auto 2.4rem; }
.email { display: inline-block; font-size: clamp(1.15rem, 3vw, 2rem); font-weight: 750; letter-spacing: -.02em; user-select: all; word-break: break-all; }
.contacts { display: flex; justify-content: center; flex-wrap: wrap; gap: 1.6rem clamp(2rem, 6vw, 4.5rem); }
.contact-person { display: flex; flex-direction: column; align-items: center; gap: .35rem; }
.contact-name { font-size: .78rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--faint); }

/* ---------- SCROLL PROGRESS (under the nav) ---------- */
.scroll-progress { position: fixed; left: 0; right: 0; top: 0; height: 2px; z-index: 101; pointer-events: none; }
.scroll-progress i { display: block; height: 100%; background: var(--grad); transform-origin: left; transform: scaleX(0); }

/* ---------- FOOTER ---------- */
.site-footer { border-top: 1px solid var(--line); margin-top: clamp(4rem, 8vw, 6rem); }
.foot-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 2rem; padding-block: 3.5rem 2.5rem; }
.foot-grid p { font-size: .86rem; max-width: 280px; margin-top: .9rem; }
.foot-grid h5 { font-size: .72rem; letter-spacing: .18em; text-transform: uppercase; color: var(--faint); margin-bottom: 1rem; font-weight: 700; }
.foot-grid ul { list-style: none; display: grid; gap: .55rem; }
.foot-grid li, .foot-grid li a { font-size: .88rem; color: var(--muted); text-decoration: none; }
.foot-grid li a:hover { color: var(--text); }
.foot-bottom { border-top: 1px solid var(--line); padding-block: 1.4rem; display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.foot-bottom p { font-size: .78rem; color: var(--faint); }
.foot-bottom a { color: var(--muted); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line-strong); }
.foot-bottom a:hover { color: var(--text); }
.foot-grid .foot-name { color: var(--text); }

/* ---------- LEAVING THE SITE (notice before external links) ---------- */
.ext-dialog {
  margin: auto; width: min(460px, calc(100vw - 32px)); padding: 1.8rem 1.8rem 1.5rem;
  border: 1px solid var(--line-strong); border-radius: 14px; background: var(--bg); color: var(--text);
}
.ext-dialog::backdrop { background: rgba(5, 3, 12, .62); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.ext-dialog h3 { font-size: 1.2rem; margin-bottom: .7rem; }
.ext-dialog p { font-size: .9rem; line-height: 1.65; }
.ext-url { margin-top: .8rem; font-size: .78rem !important; color: var(--faint); word-break: break-all; }
.ext-actions { display: flex; justify-content: flex-end; gap: .6rem; flex-wrap: wrap; margin-top: 1.5rem; }

/* ---------- LEGAL (privacy page) ---------- */
.legal { max-width: 760px; padding-bottom: 2rem; }
.legal section { padding-block: 1.8rem; border-top: 1px solid var(--line); }
.legal h2 { font-size: 1.25rem; margin-bottom: .7rem; }
.legal p { font-size: .96rem; line-height: 1.8; }
.legal p + p { margin-top: .8rem; }
.legal strong { color: var(--text); font-weight: 650; }

/* ---------- PROFILE pages (single column, like the home chapters) ---------- */
.profile-head { padding: 140px 0 clamp(2rem, 4vw, 3rem); }
.profile-photo { float: left; width: clamp(180px, 22vw, 250px); aspect-ratio: 4 / 5; padding: 5px; border: 1px solid var(--line-strong); border-radius: 20px; background: var(--surface); margin: .3rem clamp(1.6rem, 3.5vw, 2.6rem) 1rem 0; }
.profile-photo img { width: 100%; height: 100%; object-fit: cover; border-radius: 15px; background: var(--bg-2); filter: grayscale(1) contrast(1.05); transition: filter .6s ease; }
.profile-photo:hover img { filter: none; }
.profile-head h1 { font-size: clamp(2.2rem, 5vw, 3.8rem); }
.profile-sec { display: flow-root; padding-top: clamp(2.5rem, 5vw, 4rem); border-top: 1px solid var(--line); }
.bio-text { font-size: 1.02rem; line-height: 1.85; text-align: justify; hyphens: auto; -webkit-hyphens: auto; }
.profile-nav { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-top: clamp(3rem, 6vw, 4.5rem); padding-top: 2rem; border-top: 1px solid var(--line); }
.profile-nav .link-more { margin-top: 0; }
.link-more:hover svg.arrow-l { transform: translateX(-3px); }

/* ---------- PUBLICATIONS (rows) ---------- */
.pub-tools { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; margin-bottom: 1.4rem; }
.search { position: relative; flex: 1; min-width: 240px; }
.search svg { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: var(--faint); pointer-events: none; }
.search input {
  width: 100%; height: 48px; padding: 0 1rem 0 2.8rem; border-radius: 999px; font: inherit; font-size: .92rem;
  color: var(--text); background: transparent; border: 1px solid var(--line-strong); outline: none; transition: border-color .2s, box-shadow .2s;
}
.search input::placeholder { color: var(--faint); }
.search input:focus { border-color: rgba(var(--brand-1-rgb), .7); box-shadow: 0 0 0 4px rgba(var(--brand-1-rgb), .14); }
.pub-list { display: grid; }
.pub { padding: 1.8rem 0; border-top: 1px solid var(--line); }
.pub:last-child { border-bottom: 1px solid var(--line); }
.pub .kicker { display: block; margin-bottom: .6rem; }
.pub h3 { max-width: 920px; font-size: 1.1rem; line-height: 1.4; margin-bottom: .5rem; letter-spacing: -.01em; }
.pub-authors { font-size: .86rem; line-height: 1.55; margin-bottom: .3rem; }
.pub-journal { font-size: .86rem; font-weight: 650; color: var(--brand-2); margin-bottom: .8rem; }
:root[data-theme="light"] .pub-journal { color: var(--brand-1); }
.pub-abstract { max-width: 920px; text-align: justify; hyphens: auto; -webkit-hyphens: auto; font-size: .9rem; line-height: 1.7; margin-bottom: 1rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.pub-abstract.open { -webkit-line-clamp: unset; display: block; }
.pub-foot { display: flex; gap: 1.2rem; flex-wrap: wrap; align-items: center; }
.pub-foot .link-more { margin-top: 0; }
.pub-empty { text-align: center; padding: 4rem 1rem; color: var(--muted); }

/* ---------- REVEAL ---------- */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .8s cubic-bezier(.2,.7,.2,1), transform .8s cubic-bezier(.2,.7,.2,1); transition-delay: var(--d, 0s); }
.reveal.in { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 1100px) {
  .nav-links { display: none; }
  .nav-actions .seg, .nav-actions .theme-btn, .nav-actions .nav-cta { display: none; }
  .menu-btn { display: inline-grid; }
  .people { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  .split, .split.media-right, .slide { grid-template-columns: 1fr; }
  .split .viz { max-width: 640px; margin-inline: auto; }
  .mission-copy { grid-template-columns: 1fr; }
  .feature { width: 100%; margin-inline: 0; }
  /* small screens: the video keeps the full width, the profiles open below it */
  .mission-stage { aspect-ratio: auto; display: grid; grid-template-rows: auto 0fr; transition: grid-template-rows 1s cubic-bezier(.65, 0, .25, 1); }
  .mission-stage.maps-on { grid-template-rows: auto 1fr; }
  .mission-stage > .viz, .mission-stage.maps-on > .viz { position: relative; width: 100%; height: auto; }
  .contact-maps { position: relative; width: 100%; height: auto; min-height: 0; overflow: hidden; }
  .contact-maps canvas { height: auto; aspect-ratio: 2 / 1; max-height: 340px; }
  .sticky-viz { position: relative; top: 0; }
  .row { grid-template-columns: 1fr; gap: .8rem; }
  .foot-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .people { grid-template-columns: 1fr 1fr; gap: 1.2rem; }
  .people { grid-template-columns: 1fr; gap: 2rem; }
  .person { display: grid; grid-template-columns: minmax(110px, 34%) 1fr; gap: 1rem; align-items: start; }
  .person-text { padding-top: 0; }
  .hero-copy { padding: 110px 0 30px; }
  .hero-cta { flex-direction: column; align-items: stretch; max-width: 320px; margin: 0 auto; }
  .stats { gap: 1.2rem 2rem; }
  .stats div { min-width: 40%; }
  .h-ctrl { display: none; }
  .foot-grid { grid-template-columns: 1fr; }
  .profile-photo { float: none; width: 100%; max-width: 260px; margin: 0 0 1.6rem; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  [data-zoom] { transform: none !important; opacity: 1 !important; }
  .viz-track { transition: none; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* ---------- multiscale zoom (scroll-driven, assets/js/multiscale.js) ---------- */
.scales { position: relative; height: 100vh; height: 100svh; min-height: 560px; border-top: 1px solid var(--line); }
.scales canvas { cursor: zoom-out; touch-action: manipulation; }
.scales-hint { margin-top: 1.4rem; font-size: .82rem; color: var(--faint); max-width: 340px; }
.scales-sticky { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; }
.scales-sticky canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.scales-sticky::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(90deg, rgba(var(--viz-bg), .92) 0%, rgba(var(--viz-bg), .55) 30%, rgba(var(--viz-bg), 0) 48%, rgba(var(--viz-bg), 0) 82%, rgba(var(--viz-bg), .8) 100%); }
.scales-copy { position: relative; z-index: 1; height: 100%; display: flex; flex-direction: column; justify-content: center; pointer-events: none; }
.scales-copy h2 { max-width: 420px; margin-bottom: 1.6rem; }
.scales-steps { list-style: none; position: relative; max-width: 360px; min-height: 10rem; }
.scales-steps li { position: absolute; top: 0; left: 0; right: 0; opacity: 0; transform: translateY(14px); transition: opacity .5s ease, transform .5s ease; }
.scales-steps li.on { opacity: 1; transform: none; }
.scales-steps .kicker { display: block; margin-bottom: .5rem; }
.scales-steps h3 { font-size: 1.35rem; margin-bottom: .5rem; }
.scales-steps p { color: var(--muted); line-height: 1.65; }
.scales-bar { position: absolute; right: clamp(16px, 4vw, 40px); bottom: 28px; z-index: 2; display: flex; flex-direction: column; align-items: flex-end; gap: 6px;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: .72rem; font-weight: 600; letter-spacing: .08em; color: var(--muted); }
.scales-bar i { display: block; height: 2px; width: 110px; background: var(--grad); border-radius: 2px; }
@media (max-width: 899px) {
  .scales-sticky::after { background: linear-gradient(0deg, rgba(var(--viz-bg), .95) 0%, rgba(var(--viz-bg), .75) 34%, rgba(var(--viz-bg), 0) 55%); }
  .scales-copy { justify-content: flex-end; padding-bottom: 64px; }
  .scales-copy h2 { font-size: 1.6rem; margin-bottom: 1rem; }
  .scales-steps { min-height: 8.5rem; }
  .scales-bar { bottom: auto; top: 84px; }
}

/* play bar under every video of the sector slides */
.slide-media { min-width: 0; }
.slide-media .video-ctrl { margin-top: .7rem; }
.sticky-viz > .video-ctrl { margin-top: .7rem; }

/* bars to switch between the videos of one slide */
.vid-dots { display: flex; justify-content: center; gap: .7rem; margin-top: .8rem; }
.vid-dots button { padding: .6rem .2rem; border: 0; background: none; cursor: pointer; }
.vid-dots button i { display: block; width: 46px; height: 6px; border-radius: 6px; background: rgba(var(--brand-2-rgb), .3); transition: width .25s ease, background-color .25s ease, box-shadow .25s ease; }
.vid-dots button:hover i { background: rgba(var(--brand-2-rgb), .75); }
.vid-dots button.on i { width: 72px; background: var(--grad); box-shadow: 0 0 12px rgba(var(--brand-1-rgb), .55); }
.vid-dots button:focus-visible { outline: 2px solid rgba(var(--brand-1-rgb), .6); outline-offset: 2px; border-radius: 6px; }

/* side lens of the multiscale zoom: a ruler from 10 nm to 1 m, drag the lens to zoom */
.scales-lens { position: absolute; z-index: 3; right: clamp(20px, 4vw, 48px); top: 50%; transform: translateY(-50%); height: min(62vh, 520px); width: 120px;
  display: flex; justify-content: flex-end; cursor: ns-resize; touch-action: none; user-select: none; -webkit-user-select: none; outline: none; }
.lens-track { position: relative; width: 4px; height: 100%; border-radius: 4px; background: var(--line-strong); }
.lens-fill { position: absolute; left: 0; top: 0; width: 100%; height: 0; border-radius: 4px; background: var(--grad); }
.lens-ticks { list-style: none; position: absolute; inset: 0; pointer-events: none; }
.lens-ticks li { position: absolute; right: 12px; transform: translateY(-50%); white-space: nowrap;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: .64rem; letter-spacing: .04em; color: var(--faint); }
.lens-ticks li::after { content: ""; position: absolute; right: -12px; top: 50%; width: 6px; height: 1px; background: var(--line-strong); }
.lens-ticks li.major { color: var(--muted); font-weight: 600; }
.lens-ticks li.major::after { width: 10px; right: -14px; }
.lens-knob { position: absolute; left: 50%; top: 0; transform: translate(-50%, -50%); width: 42px; height: 42px; border-radius: 50%;
  display: grid; place-items: center; color: #fff; background: var(--grad); box-shadow: 0 0 0 4px rgba(var(--viz-bg), .9), 0 8px 26px rgba(var(--brand-1-rgb), .55);
  transition: transform .15s ease; cursor: grab; }
.lens-knob svg { width: 20px; height: 20px; }
.lens-val { position: absolute; right: 54px; top: 50%; transform: translateY(-50%); white-space: nowrap; padding: .2rem .5rem; border-radius: 999px;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: .74rem; font-weight: 700; color: var(--text); background: rgba(var(--viz-bg), .85); border: 1px solid var(--line-strong); }
.scales-lens:hover .lens-knob, .scales-lens.dragging .lens-knob { transform: translate(-50%, -50%) scale(1.12); }
.scales-lens.dragging .lens-knob { cursor: grabbing; }
.scales-lens:focus-visible .lens-knob { box-shadow: 0 0 0 4px rgba(var(--viz-bg), .9), 0 0 0 7px rgba(var(--brand-1-rgb), .6); }
.scales-lens .lens-ticks li { display: block; }
.scales-lens:hover .lens-ticks li, .scales-lens.dragging .lens-ticks li { color: var(--muted); }
.scales-bar { display: none; }
@media (max-width: 899px) {
  .scales-lens { top: 96px; transform: none; height: 42vh; width: 60px; right: 14px; }
  .lens-ticks li:not(.major) { display: none; }
  .lens-val { right: 48px; }
}

/* play bar of the "How we work" box: hidden while the animation is shown */
.sticky-viz > .video-ctrl { transition: opacity .3s ease; }
.sticky-viz > .video-ctrl.is-off { opacity: 0; visibility: hidden; pointer-events: none; }

/* slides with an animation and a video */
.slide-media .pane[hidden] { display: none; }
.slide-media > .video-ctrl.is-off { visibility: hidden; }

/* scientific advisors under the team: plain text, no cards */
.advisors { margin-top: clamp(2.2rem, 5vw, 3.4rem); padding-top: 1.6rem; border-top: 1px solid var(--line); }
.advisors .kicker { display: block; margin-bottom: 1rem; }
.advisors ul { list-style: none; display: flex; flex-wrap: wrap; gap: 1.2rem clamp(2rem, 6vw, 5rem); }
.advisors li { display: flex; flex-direction: column; gap: .2rem; }
.advisors strong { font-size: 1.05rem; color: var(--text); }
.advisors span { font-size: .92rem; color: var(--muted); }

/* ---------- use cases: one row per project, three scales on a common track ---------- */
.uc-head h1 span { display: block; }
.uc-legend, .uc-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.9fr); gap: clamp(1.5rem, 4vw, 4rem); }
.uc-legend { position: sticky; top: 72px; z-index: 2; padding: 1rem 0 .9rem; background: var(--bg); border-bottom: 1px solid var(--line); }
.uc-scales { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.5rem; }
.uc-scale .kicker { display: block; }
.uc-scale span:last-child { display: block; margin-top: .2rem; font-size: .86rem; color: var(--muted); }
.uc-scale .kicker { color: var(--text); }

/* ---------- sectors: each one has its own accent, in tone with the brand ---------- */
.uc-sector[data-sec="food"]   { --acc: var(--sec-food-rgb); }
.uc-sector[data-sec="health"] { --acc: var(--sec-health-rgb); }
.uc-sector[data-sec="sense"]  { --acc: var(--sec-sense-rgb); }
:root[data-theme="light"] .uc-sector[data-sec="food"]   { --acc: var(--sec-food-rgb-light); }
:root[data-theme="light"] .uc-sector[data-sec="health"] { --acc: var(--sec-health-rgb-light); }
:root[data-theme="light"] .uc-sector[data-sec="sense"]  { --acc: var(--sec-sense-rgb-light); }
.uc-sec-head { position: relative; padding: clamp(4rem, 8vw, 6.5rem) 0 1.2rem; }
.uc-sec-head::before { content: ""; position: absolute; left: -10%; top: 20%; width: 60%; height: 80%; pointer-events: none;
  background: radial-gradient(closest-side, rgba(var(--acc), .13), transparent); }
.uc-sec-head h2 { position: relative; font-size: clamp(2rem, 4.4vw, 3.4rem); margin-bottom: .6rem;
  background: linear-gradient(120deg, rgb(var(--acc)) 0%, var(--brand-3) 140%); -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent; }
.uc-sec-head p { position: relative; max-width: 560px; }
.uc-sector .uc-meta .kicker { color: rgb(var(--acc)); }

.uc-row { padding: clamp(2.5rem, 5vw, 4rem) 0; border-bottom: 1px solid var(--line); }
.uc-meta .kicker { display: block; margin-bottom: .8rem; }
.uc-meta h3 { font-size: clamp(1.35rem, 2.2vw, 1.75rem); margin-bottom: .9rem; }
.uc-partner { font-size: .95rem; line-height: 1.65; margin-bottom: .9rem; }
.uc-status { display: inline-flex; align-items: center; gap: .55rem; font-size: .8rem; font-weight: 650; color: var(--text); }
.uc-ico { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; border: 1px solid rgba(var(--acc), .45); color: rgb(var(--acc)); }
.uc-ico svg { width: 15px; height: 15px; }

/* the track: a gradient line through three nodes that grow with the scale */
.uc-track { position: relative; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.5rem; padding-top: 2.6rem; }
.uc-track::before { content: ""; position: absolute; left: 0; right: 0; top: 1.05rem; height: 2px; border-radius: 2px; background: linear-gradient(90deg, rgba(var(--acc), .2), rgba(var(--acc), .85)); }
.uc-step { position: relative; }
.uc-step::before { content: ""; position: absolute; left: 0; top: calc(-2.6rem + 1.05rem + 1px); transform: translateY(-50%); border-radius: 50%; background: var(--bg); }
.uc-step::before { border: 2px solid rgb(var(--acc)); }
.uc-step:nth-child(1)::before { width: 10px; height: 10px; opacity: .6; }
.uc-step:nth-child(2)::before { width: 16px; height: 16px; opacity: .8; }
.uc-step:nth-child(3)::before { width: 24px; height: 24px; box-shadow: 0 0 22px -4px rgba(var(--acc), .8); }
.uc-step .kicker { display: none; }
.uc-step p { font-size: .98rem; line-height: 1.7; color: var(--text); }

.uc-cta { padding: clamp(80px, 10vw, 130px) 0 clamp(60px, 8vw, 100px); text-align: center; }
.uc-cta h2 { font-size: clamp(1.8rem, 4vw, 3rem); margin-bottom: 1rem; }
.uc-cta .lead { margin: 0 auto 2rem; }

@media (max-width: 860px) {
  .uc-legend { display: none; }
  .uc-row { grid-template-columns: 1fr; gap: 1.6rem; }
  .uc-track { grid-template-columns: 1fr; gap: 1.4rem; padding: 0 0 0 2.2rem; }
  .uc-track::before { left: 11px; right: auto; top: .3rem; bottom: .3rem; width: 2px; height: auto; background: linear-gradient(180deg, rgba(var(--acc), .2), rgba(var(--acc), .85)); }
  .uc-step::before { left: calc(-2.2rem + 12px); top: .55rem; transform: translate(-50%, -50%); }
  .uc-step .kicker { display: block; margin-bottom: .25rem; }
  .uc-step .kicker { color: rgb(var(--acc)); }
}
