@font-face { font-family: "Ivy Presto Headline"; src: url("fonts/fonnts.com-Ivy-Presto-Headline-Thin.otf") format("opentype"); font-weight: 100; font-style: normal; font-display: swap; }
@font-face { font-family: "Ivy Presto Headline"; src: url("fonts/fonnts.com-Ivy-Presto-Headline-Light.otf") format("opentype"); font-weight: 300; font-style: normal; font-display: swap; }
@font-face { font-family: "Ivy Presto Headline"; src: url("fonts/fonnts.com-Ivy-Presto-Headline-.otf") format("opentype"); font-weight: 700; font-style: italic; font-display: swap; }
@font-face { font-family: "Ivy Presto Headline"; src: url("fonts/fonnts.com-Ivy-Presto-Headline-Semi-Bold.otf") format("opentype"); font-weight: 600; font-style: normal; font-display: swap; }

/* SAADI project page, built on the LiGHT lab project-page template */

:root {
  color-scheme: light;
  --paper: #fefff7;
  --paper-2: #e9f1fa;
  --surface: #fff;
  --ink: #102d5c;
  --ink-2: #315079;
  --muted: #557092;
  --hair: #c9d9eb;
  --accent: #0c43a0;
  --accent-soft: #dcecf9;
  --teal: #68afe7;
  --teal-soft: #e4f3fd;
  --l1: #a9cdf0;
  --agent: #a9bcd6;
  --shadow: 0 10px 30px -22px rgba(12, 67, 160, .2);
  --r: 10px;
  --display: "Ivy Presto Headline", Georgia, serif;
  --sans: "Manrope", -apple-system, "Segoe UI", sans-serif;
  --mono: "Manrope", -apple-system, "Segoe UI", sans-serif;
  --wrap: 1120px;
  --gutter: clamp(16px, 4vw, 40px);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  margin: 0;
  background-color: var(--paper);
  color: var(--ink);
  font: 400 17px/1.62 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg, video { display: block; }
img { max-width: 100%; height: auto; }
[hidden] { display: none !important; }
a { color: inherit; }
p { margin: 0 0 1em; }
h1, h2, h3, h4 { font-family: var(--display); margin: 0; letter-spacing: -0.018em; }
b, strong { font-weight: 600; }
/* Manrope has no italic, so variables and titles use the serif italic */
i { font-family: var(--display); font-weight: 600; font-size: 1.1em; line-height: 1; }
button { font: inherit; }
figure { margin: 0; }
mark { background: var(--accent-soft); color: var(--accent); padding: 0 .12em; border-radius: 3px; }
.muted { color: var(--muted); }
.noscript { max-width: var(--wrap); margin: 16px auto 0; padding: 0 var(--gutter); color: var(--ink-2); font-size: 15px; }

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

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px var(--gutter);
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  backdrop-filter: blur(10px) saturate(1.2);
  -webkit-backdrop-filter: blur(10px) saturate(1.2);
  border-bottom: 1px solid color-mix(in srgb, var(--hair) 70%, transparent);
}
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font: 800 20px/1 var(--sans); letter-spacing: -.04em; }
.brand-mark { width: 32px; height: 32px; }
.nav nav { display: flex; gap: clamp(12px, 3vw, 28px); }
.nav nav a { text-decoration: none; font-size: 15px; color: var(--ink-2); position: relative; padding: 4px 0; }
.nav nav a::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform .25s ease; }
.nav nav a:hover::after, .nav nav a.is-active::after { transform: scaleX(1); }
.nav nav a.is-active { color: var(--ink); }

/* ---------- hero ---------- */
.hero { position: relative; isolation: isolate; padding: clamp(40px, 8vw, 88px) 0 0; }
.hero::before { content: ""; position: absolute; z-index: -1; inset: 0 0 auto auto; width: min(54vw, 760px); height: min(44vw, 620px); background: linear-gradient(145deg, #68afe728, #68afe700 70%); clip-path: polygon(41% 0, 100% 0, 100% 100%, 0 0); pointer-events: none; }
.hero-head { max-width: 960px; margin: 0 auto; padding: 0 var(--gutter); text-align: center; }
.hero h1 { font: 600 clamp(76px, 12vw, 144px)/1 var(--sans); color: var(--accent); letter-spacing: -0.02em; }
.subtitle { font: 400 clamp(21px, 2.4vw, 28px)/1.3 var(--display); color: var(--ink-2); max-width: 31em; margin: 18px auto 26px; text-wrap: balance; }
/* one phrase per line: title, expanded acronym, rest of the title */
.subtitle > span { display: block; }
/* about 20em wide: shrink the name on narrow phones so it keeps one line */
.subtitle-name { font-size: min(1em, calc((100vw - 2 * var(--gutter)) / 20)); }
.subtitle b { color: var(--accent); font-weight: 800; text-decoration: underline; text-decoration-color: var(--teal); text-decoration-thickness: .1em; text-underline-offset: .12em; }
.authors { list-style: none; padding: 0; margin: 0 auto 8px; display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 16px; font-size: 16px; max-width: 760px; }
.authors li { white-space: nowrap; }
.authors sup, .affil sup { font-size: 0.66em; color: var(--accent); margin-left: 1px; }
.affil { font-size: 14px; color: var(--muted); margin: 6px 0 26px; }

.lab-logos { display: flex; align-items: center; gap: 28px; }
.hero-labs { justify-content: center; margin: 0 0 28px; }
.light-logo { width: 104px; }
.epfl-logo { width: 78px; }
.hslu-logo { width: 104px; }

.links { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px; border-radius: 7px;
  border: 1.4px solid var(--ink); background: transparent; color: var(--ink);
  font: 500 15px/1 var(--sans); text-decoration: none; cursor: pointer;
  transition: background .2s, color .2s, transform .2s, border-color .2s;
}
.btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.btn:hover { background: var(--ink); color: var(--paper); transform: translateY(-1px); }
.btn-solid { background: var(--ink); color: var(--paper); }
.btn-solid:hover { background: var(--accent); border-color: var(--accent); }
.btn-ghost { border-color: var(--hair); }

/* overview: animation and video */
.panorama { position: relative; margin: clamp(36px, 6vw, 64px) auto 0; max-width: 1280px; padding: 0 var(--gutter); }
.hero-animation, .hero-video { position: relative; scroll-margin-top: 8px; }
#hero-scene { width: 100%; height: auto; aspect-ratio: 1200 / 470; border-radius: var(--r); box-shadow: var(--shadow); background: var(--paper-2); }
.overview-watch, .overview-back { position: absolute; display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 44px; padding: 12px 18px; border: 1px solid var(--hair); border-radius: 999px; background: var(--surface); color: var(--ink); font: 500 15px/1 var(--sans); cursor: pointer; }
.overview-watch { left: 50%; bottom: 18px; transform: translateX(-50%); white-space: nowrap; box-shadow: 0 4px 18px #0c43a024; }
.overview-watch svg { width: 18px; height: 18px; }
.overview-watch circle { fill: none; stroke: currentColor; stroke-width: 1.5; }
.overview-watch path { fill: currentColor; }
.overview-watch span { color: var(--ink-2); }
.overview-watch:hover, .overview-back:hover { background: var(--paper-2); }
.hero-video video { width: 100%; max-height: calc(100svh - 100px); aspect-ratio: 16 / 9; object-fit: contain; border-radius: 22px; background: var(--ink); box-shadow: var(--shadow); }
.overview-back { top: 14px; right: 14px; font-size: 13px; }
.scene-toggle {
  position: absolute; right: 14px; bottom: 14px;
  width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,.6); background: rgba(16,45,92,.75); color: #fff;
  display: grid; place-items: center; cursor: pointer;
}
.scene-toggle svg { width: 16px; height: 16px; }
.scene-toggle .i-pause path { fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
.scene-toggle .i-play path { fill: currentColor; }
.scene-toggle .i-play { display: none; }
.scene-toggle[aria-pressed="true"] .i-play { display: block; }
.scene-toggle[aria-pressed="true"] .i-pause { display: none; }
.scene-cap { display: none; }

/* hero illustration */
.hs-bg { fill: var(--paper-2); }
.hs-light { fill: #fff; opacity: .45; }
#hs-dots circle { fill: #7aaad5; opacity: .3; }
.svg-caption { font: 600 25px var(--display); fill: var(--ink); }
.svg-caption.is-swap, .hs-answer.is-swap { animation: hs-fade .5s ease both; }
.svg-sub { font: 600 11.5px var(--mono); fill: var(--muted); letter-spacing: .1em; }
.hs-edge { fill: none; stroke: #9fc3e6; stroke-width: 1.6; opacity: 0; transition: opacity .5s; }
.hs-node { opacity: 0; transform: translateY(8px) scale(.92); transform-box: fill-box; transform-origin: 50% 100%; transition: opacity .45s, transform .5s cubic-bezier(.2,.7,.2,1); }
.hs-edge.is-on, .hs-node.is-on { opacity: 1; transform: none; }
.hs-node.is-swap { animation: hs-pop .5s cubic-bezier(.2,.7,.2,1) both; }
.hs-l1 rect { fill: var(--l1); transition: fill .3s; }
.hs-l1 text { font: 600 13px var(--sans); fill: var(--ink); transition: fill .3s; }
.hs-l1.is-hit rect { fill: var(--accent); }
.hs-l1.is-hit text { fill: #fff; }
.hs-l2 rect { fill: var(--accent); }
.hs-l2 text { font: 600 14px var(--sans); fill: #fff; }
.hs-chip rect { fill: var(--surface); stroke: var(--hair); stroke-width: 1.2; transition: fill .3s, stroke .3s; }
.hs-chip text { font: 600 14px var(--sans); fill: var(--ink); transition: fill .3s; }
.hs-alias rect { fill: var(--accent-soft); stroke: var(--teal); }
.hs-alias text { fill: var(--accent); }
.hs-chip.is-hit rect { fill: var(--accent); stroke: var(--accent); }
.hs-chip.is-hit text { fill: #fff; }
.hs-chip.is-recalled rect { animation: hs-recall 1.1s ease; }
.hs-chunk { transform-box: fill-box; transition: transform .45s cubic-bezier(.2,.7,.2,1); }
.hs-chunk rect { fill: var(--surface); stroke: var(--hair); stroke-width: 1.2; transition: fill .3s, stroke .3s; }
.hs-chunk path { fill: none; stroke: var(--hair); stroke-width: 2; stroke-linecap: round; transition: stroke .3s; }
.hs-chunk.is-read rect { fill: var(--accent-soft); stroke: var(--teal); }
.hs-chunk.is-read path { stroke: #8fbde6; }
.hs-chunk.is-hit { transform: translateY(-12px); }
.hs-chunk.is-hit rect { fill: var(--accent); stroke: var(--accent); }
.hs-chunk.is-hit path { stroke: #fff; }
.hs-head { opacity: 0; transition: transform .28s cubic-bezier(.4,0,.2,1), opacity .3s; }
.hs-head.is-on { opacity: 1; }
.hs-head rect { fill: none; stroke: var(--accent); stroke-width: 2.4; }
.hs-head path { fill: var(--accent); }
.hs-query rect { fill: var(--ink); }
.hs-query text { font: 600 15px var(--sans); fill: var(--paper); }
.hs-tray rect { fill: var(--surface); stroke: var(--hair); }
.hs-answer { font: 600 17px var(--display); fill: var(--ink); }
.hs-zero rect { fill: var(--accent-soft); stroke: none; }
.hs-zero text { font: 700 12px var(--sans); fill: var(--accent); }
/* without JavaScript: the finished index, and the video below it */
html:not(.js) .hs-node, html:not(.js) .hs-edge { opacity: 1; transform: none; }
html:not(.js) .scene-toggle, html:not(.js) .overview-watch, html:not(.js) .overview-back { display: none; }
html:not(.js) #hero-video[hidden] { display: block !important; margin-top: 20px; }
@keyframes hs-fade { from { opacity: 0; } }
@keyframes hs-pop { from { opacity: 0; transform: translateY(8px) scale(.94); } }
@keyframes hs-recall { 35% { stroke: var(--accent); stroke-width: 3; } }

/* tl;dr */
.tldr { max-width: var(--wrap); margin: 0 auto; padding: clamp(40px, 6vw, 64px) var(--gutter) 0; }
.lede { font: 600 clamp(22px, 2.5vw, 30px)/1.3 var(--display); max-width: 34em; margin: 0 auto 40px; text-align: center; text-wrap: balance; }
.lede em { font-style: italic; color: var(--accent); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; border-top: 1px solid var(--hair); border-bottom: 1px solid var(--hair); }
.stat { padding: 26px 24px 22px; }
.stat + .stat { border-left: 1px solid var(--hair); }
.stat-value { font: 600 clamp(36px, 4.6vw, 52px)/1 var(--sans); letter-spacing: -0.03em; margin: 0 0 10px; white-space: nowrap; }
.stat:first-child .stat-value { color: var(--accent); }
.stat-label { font-size: 15px; color: var(--ink-2); margin: 0; max-width: 24em; }

.abstract { max-width: 760px; margin: 28px auto 0; }
.abstract summary { cursor: pointer; font: 500 14px var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); text-align: center; list-style: none; }
.abstract summary::-webkit-details-marker { display: none; }
.abstract summary::after { content: " ▾"; color: var(--accent); }
.abstract[open] summary::after { content: " ▴"; }
.abstract p { margin-top: 18px; font-size: 16px; color: var(--ink-2); text-align: justify; hyphens: none; }

/* ---------- sections ---------- */
.section { max-width: var(--wrap); margin: 0 auto; padding: clamp(72px, 11vw, 128px) var(--gutter) 0; }
.section-head { max-width: 760px; margin: 0 0 clamp(32px, 5vw, 52px); }
.section h2 { font-size: clamp(40px, 5vw, 58px); line-height: 1.04; font-weight: 600; text-wrap: balance; }
.section-lede { font-size: 18.5px; color: var(--ink-2); margin: 16px 0 0; }
.card { background: var(--surface); border: 1px solid var(--hair); border-radius: var(--r); box-shadow: var(--shadow); }
.fineprint { font-size: 13.5px; color: var(--muted); margin: 18px 0 0; }
.fineprint.center { text-align: center; }
.eyebrow { font: 600 12.5px/1.2 var(--mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); margin: 0 0 12px; }
.text-link { color: var(--accent); font-weight: 600; text-decoration: none; border-bottom: 1px solid var(--teal); }
.text-link:hover { border-bottom-color: var(--accent); }

/* ---------- story ---------- */
.quote-pair { display: grid; grid-template-columns: minmax(0, 1fr) 64px minmax(0, 1fr); align-items: center; }
.quote { margin: 0; padding: 24px 26px 20px; height: 100%; display: flex; flex-direction: column; justify-content: space-between; }
.quote p { font: 600 clamp(22px, 2.3vw, 27px)/1.35 var(--display); margin: 0; }
.quote cite { display: block; margin-top: 16px; font: 600 12px var(--mono); font-style: normal; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.connector { text-align: center; font-size: 30px; color: var(--teal); }

.chapter { margin-top: clamp(64px, 9vw, 104px); }
.chapter-head { max-width: 640px; margin: 0 0 clamp(24px, 4vw, 36px); }
.chapter-head h3 { font-size: clamp(30px, 3.4vw, 40px); line-height: 1.12; font-weight: 600; }
.chapter-head p:not(.eyebrow) { color: var(--ink-2); margin: 12px 0 0; }

.scrolly { display: grid; grid-template-columns: minmax(0, 1.32fr) minmax(0, .68fr); gap: clamp(28px, 4vw, 56px); align-items: start; }
.scrolly-figure { min-width: 0; }
.scrolly-figure .fineprint { margin-top: 12px; }
.scrolly-steps { min-width: 0; }
.step p { font-size: 18px; line-height: 1.6; max-width: 26em; margin: 0; }
.step p b { color: var(--ink); }
.step-k { font: 600 12px var(--mono) !important; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); margin-bottom: 10px !important; }
.step + .step { margin-top: 28px; }
.step-controls { display: none; }

/* desktop: sticky scene, steps scroll past it */
.js-scrolly .scrolly-figure { position: sticky; top: max(80px, calc(50vh - 310px)); }
.js-scrolly .scrolly-steps { padding: 6vh 0 12vh; }
.js-scrolly .step { min-height: 62vh; margin: 0; display: flex; flex-direction: column; justify-content: center; opacity: .32; transition: opacity .45s ease; }
.js-scrolly .step.is-active { opacity: 1; }

/* phones, short windows, reduced motion: numbered controls */
.js-ready:not(.js-scrolly) .step-controls { display: flex; gap: 8px; margin: 0 0 18px; }
.js-ready:not(.js-scrolly) .step { margin: 0; }
.js-ready:not(.js-scrolly) .step:not(.is-active) { display: none; }
.step-controls button { flex: 1; min-width: 0; min-height: 44px; padding: 8px; border: 1px solid var(--hair); border-radius: 6px; background: none; color: var(--ink-2); font: 600 14px var(--sans); cursor: pointer; }
.step-controls button:hover { border-color: var(--ink); }
.step-controls button[aria-pressed="true"] { border-color: var(--ink); background: var(--ink); color: var(--surface); }

/* story scenes */
.scene { position: relative; overflow: hidden; background: var(--surface); border: 1px solid var(--hair); border-radius: var(--r); box-shadow: var(--shadow); }
.scene-topline { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--hair); font-size: 13px; font-weight: 600; color: var(--ink); }
.scene-topline > span:last-child { font-size: 12px; background: var(--paper-2); color: var(--accent); padding: 2px 8px; border-radius: 4px; white-space: nowrap; }
.scene-footer { display: flex; justify-content: space-between; gap: 10px; border-top: 1px solid var(--hair); padding: 10px 20px; font-size: 12px; color: var(--muted); }
.diagram-label { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; font-weight: 600; color: var(--ink); }
.diagram-label > span { font-size: 11.5px; font-weight: 500; color: var(--muted); }

.index-upper { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; padding: 18px 20px 10px; min-height: 270px; }
.document { background: var(--paper-2); border: 1px solid var(--hair); border-radius: 8px; overflow: hidden; }
.document-label { display: flex; justify-content: space-between; padding: 9px 12px; border-bottom: 1px solid var(--hair); font-size: 12px; color: var(--muted); }
.document-window { height: 170px; padding: 12px 14px; overflow: hidden; -webkit-mask-image: linear-gradient(#000 82%, transparent); mask-image: linear-gradient(#000 82%, transparent); font: 500 17px/1.45 var(--display); color: var(--ink); }
#document-text { will-change: transform; transition: transform .4s, opacity .3s; }
.document-bottom { padding: 6px 12px; font-size: 10.5px; color: var(--muted); }
.memory { position: relative; }
.memory-nodes { position: relative; height: 104px; margin-top: 8px; }
.entity-node { position: absolute; display: flex; align-items: center; justify-content: center; width: 56px; height: 56px; padding: 3px; border-radius: 50%; border: 1px solid #a9cdf0; background: var(--teal-soft); color: var(--ink); font-size: 9.5px; font-weight: 600; line-height: 1.15; text-align: center; transition: opacity .4s, transform .5s, background .4s, color .4s; }
.entity-node.n0 { left: 2%; top: 4px; }
.entity-node.n1 { left: 28%; top: 28px; width: 68px; height: 68px; }
.entity-node.n2 { left: 60%; top: 0; }
.entity-node.n3 { left: 78%; top: 56px; width: 42px; height: 42px; font-size: 8.5px; }
.entity-node.n4 { left: 8%; top: 76px; width: 14px; height: 14px; }
.entity-node.n5 { left: 63%; top: 80px; width: 12px; height: 12px; }
.entity-node.n6 { left: 88%; top: 14px; width: 14px; height: 14px; }
.entity-node.recalled { background: var(--accent); border-color: var(--accent); color: #fff; }
.memory-record { min-height: 72px; margin-top: 10px; padding-left: 10px; border-left: 2px solid var(--teal); font-size: 12px; transition: opacity .3s; }
.memory-record span { font: 600 10.5px var(--mono); letter-spacing: .04em; color: var(--accent); }
.memory-record p { margin: 3px 0; }
.alias-line { color: var(--accent); font-weight: 600; }
.recall-arrow { position: absolute; bottom: -4px; font-size: 11.5px; font-weight: 600; color: var(--accent); transition: opacity .3s; }
.hierarchy { margin: 12px 20px 0; padding-top: 12px; border-top: 1px solid var(--hair); }
.hierarchy svg { width: 100%; height: 170px; }
.hierarchy > p { margin: 0 0 12px; font-size: 12px; color: var(--muted); text-align: center; }
.tree-edge { fill: none; stroke: #9fc3e6; stroke-width: 1.3; }
.tree-node { fill: var(--teal-soft); stroke: #a9cdf0; stroke-width: 1; }
.tree-node.level1 { fill: var(--l1); stroke: none; }
.tree-node.level2 { fill: var(--accent); stroke: none; }
.tree-node.level3 { fill: var(--ink); stroke: none; }
.tree-label { font: 700 14px var(--sans); fill: #fff; }
.tree-node.level1 + .tree-label { fill: var(--ink); }
.tree-chunk-label { font: 600 11px var(--sans); fill: var(--muted); }

.question { padding: 16px 20px; background: var(--paper-2); border-bottom: 1px solid var(--hair); }
.question > span { font: 600 11px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.question p { font: 600 26px/1.2 var(--display); margin: 4px 0 0; }
.fusion-inputs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; padding: 18px 20px 0; }
.signal { min-height: 112px; padding: 10px 12px; border: 1px solid var(--hair); border-radius: 8px; background: var(--paper); opacity: .4; transition: background .35s, opacity .35s, border-color .35s; }
.text-signal { opacity: 1; border-color: var(--teal); background: var(--teal-soft); }
.signal-label { font-size: 11px; font-weight: 600; color: var(--muted); }
.signal p { margin: 8px 0 0; font-size: 13px; line-height: 1.45; }
.fusion-lines { display: block; width: calc(100% - 40px); height: 44px; margin: 0 20px; }
.wire { fill: none; stroke: var(--hair); stroke-width: 2; vector-effect: non-scaling-stroke; transition: stroke .4s; }
.wire-text { stroke: var(--accent); }
.fusion-label { width: max-content; margin: 0 auto; padding: 6px 20px; border-radius: 6px; background: var(--ink); color: var(--paper); font-size: 12px; font-weight: 600; }
.ranking { padding: 14px 20px 0; }
.ranking-top { display: flex; justify-content: space-between; margin-bottom: 8px; font-size: 12px; font-weight: 600; }
.rank-status { color: var(--muted); font-weight: 500; }
.rank-list { position: relative; height: 230px; }
.topk-zone { position: absolute; left: 0; right: 0; top: 0; height: 116px; background: var(--paper-2); border-top: 1px dashed var(--teal); border-bottom: 1px dashed var(--teal); }
.topk-zone > span { position: absolute; top: 48px; left: 10px; font-size: 11px; font-weight: 600; color: var(--accent); }
.rank-item { position: absolute; left: 56px; right: 6px; top: 0; height: 48px; transform: translateY(var(--y)); transition: transform .6s cubic-bezier(.2,.7,.2,1), opacity .4s, border-color .3s, background .3s; }
.rank-placeholder { padding: 14px 12px; border: 1px solid var(--hair); border-radius: 6px; background: var(--surface); }
.rank-placeholder i { display: block; width: 65%; height: 4px; margin-bottom: 7px; border-radius: 2px; background: var(--paper-2); }
.rank-placeholder i + i { width: 42%; }
.p1 { --y: 8px; }
.p2 { --y: 64px; }
.p3 { --y: 120px; }
.target-passage { --y: 176px; padding: 5px 12px; border: 1px solid var(--teal); border-radius: 6px; background: var(--surface); box-shadow: 0 5px 12px #0c43a010; }
.target-passage > span { display: block; font-size: 10.5px; font-weight: 600; line-height: 1.3; color: var(--accent); }
.target-passage p { margin: 1px 0 0; overflow: hidden; font: 600 15px/1.3 var(--display); white-space: nowrap; text-overflow: ellipsis; }
.query-scene .scene-footer { margin-top: 2px; }
.query-scene[data-stage="1"] .memory-signal,
.query-scene[data-stage="2"] .memory-signal,
.query-scene[data-stage="2"] .summary-signal { opacity: 1; background: var(--teal-soft); border-color: var(--teal); }
.query-scene[data-stage="1"] .wire-memory,
.query-scene[data-stage="2"] .wire-memory,
.query-scene[data-stage="2"] .wire-summary { stroke: var(--accent); }
.query-scene[data-stage="1"] .target-passage { --y: 120px; }
.query-scene[data-stage="1"] .p3 { --y: 176px; }
.query-scene[data-stage="2"] .target-passage { --y: 8px; border-color: var(--accent); background: var(--accent-soft); }
.query-scene[data-stage="2"] .p1 { --y: 64px; }
.query-scene[data-stage="2"] .p2 { --y: 120px; }
.query-scene[data-stage="2"] .p3 { --y: 176px; opacity: 0; }

/* ---------- method ---------- */
.overview { overflow: hidden; }
.overview img { width: 100%; border-radius: var(--r); }
.stage-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; margin: clamp(44px, 6vw, 60px) 0 0; font: 600 clamp(24px, 2.6vw, 30px)/1.2 var(--display); }
.stage-title span { font: 600 12.5px var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--accent); }
.pipeline { list-style: none; padding: 0; margin: 20px 0 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 32px; }
.pipeline-3 { grid-template-columns: repeat(3, 1fr); }
.pipe { position: relative; padding: 22px 20px 20px; }
.pipe-n { position: absolute; top: 16px; right: 18px; font: 600 13px var(--mono); color: var(--muted); }
.pipe-ic { width: 44px; height: 44px; margin-bottom: 14px; fill: none; stroke: var(--ink); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.pipe h4 { font-size: 22px; font-weight: 600; line-height: 1.15; margin-bottom: 8px; }
.pipe p { font-size: 15px; color: var(--ink-2); margin: 0; }
.pipe:not(:last-child)::after {
  content: ""; position: absolute; right: -18px; top: 42px; width: 10px; height: 10px;
  border-top: 1.6px solid var(--muted); border-right: 1.6px solid var(--muted); transform: rotate(45deg);
}
.equation { margin-top: 32px; padding: 22px 24px 18px; }
.equation .fineprint { margin-top: 10px; }
.eq { overflow-x: auto; overflow-y: hidden; padding: 4px 0; max-width: 100%; font-size: 15px; }
.eq .katex-display { margin: 0; }

.more { margin-top: 32px; border-top: 1px solid var(--hair); border-bottom: 1px solid var(--hair); }
.more > summary { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 20px 0; cursor: pointer; list-style: none; font-weight: 500; }
.more > summary::-webkit-details-marker { display: none; }
.more > summary svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.6; transition: transform .25s; }
.more[open] > summary svg { transform: rotate(180deg); }
.more-body { padding: 0 0 28px; }
.more-intro { max-width: 820px; color: var(--ink-2); }
.cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 36px; margin-top: 8px; }
.cols h4 { font: 600 15px var(--sans); letter-spacing: 0; margin: 0 0 14px; }
.steps { list-style: none; counter-reset: s; margin: 0; padding: 0; }
.steps li { position: relative; counter-increment: s; padding-left: 38px; margin-bottom: 14px; font-size: 15.5px; color: var(--ink-2); }
.steps li::before { content: counter(s); position: absolute; left: 0; top: 2px; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; background: var(--ink); color: var(--paper); font-size: 12px; font-weight: 700; }
.steps b { color: var(--ink); }

/* ---------- results ---------- */
.datasets { display: grid; grid-template-columns: repeat(4, 1fr); margin: 0 0 clamp(48px, 7vw, 72px); border-top: 1px solid var(--hair); border-bottom: 1px solid var(--hair); }
.datasets > div { padding: 22px 20px 18px; }
.datasets > div + div { border-left: 1px solid var(--hair); }
.datasets h3 { font: 700 20px/1.2 var(--sans); letter-spacing: -.02em; margin: 0 0 6px; }
.datasets p { font-size: 14px; color: var(--ink-2); margin: 0; }

.takeaways { display: grid; gap: 72px; }
.finding-block { min-width: 0; }
.finding-block + .finding-block { border-top: 1px solid var(--hair); padding-top: 64px; }
.finding-block h3 { font-size: clamp(27px, 3vw, 36px); line-height: 1.2; font-weight: 600; margin: 0 0 18px; }
.finding-intro { max-width: 820px; margin-bottom: 28px; }
.finding-intro > p, .tk-copy > p { color: var(--ink-2); font-size: 17px; margin: 0 0 16px; }
.finding-block .finding-ref { color: var(--muted); font: 600 12px var(--mono); letter-spacing: .04em; margin: 0 0 14px; }
.finding-block .finding-answer { color: var(--ink); font-size: 19px; font-weight: 500; }
.tk { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); gap: 40px; align-items: center; }
.tk-viz { margin: 0; padding: 20px 22px 16px; }

.table-card { overflow-x: auto; }
.table-card table { width: 100%; border-collapse: collapse; font-size: 15px; font-variant-numeric: tabular-nums; }
.table-card th, .table-card td { padding: 13px 12px; text-align: right; border-bottom: 1px solid var(--hair); white-space: nowrap; }
.table-card thead th { font-weight: 600; color: var(--ink); }
.table-card thead tr.sub th { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.table-card th.ds { text-align: center; border-left: 1px solid var(--hair); }
.table-card tbody tr:last-child > * { border-bottom: 0; }
.table-card th[scope="row"], .table-card thead th:first-child { text-align: left; color: var(--ink); font-weight: 600; position: sticky; left: 0; background: var(--surface); }
.results-table td.base { color: var(--muted); }
.results-table td.saadi { color: var(--accent); font-weight: 700; }
.results-table tr > :nth-child(3n+2) { border-left: 1px solid var(--hair); }
.results-table thead tr:first-child th.ds { border-left: 1px solid var(--hair); }
.delta { display: inline-block; min-width: 54px; padding: 2px 6px; border-radius: 6px; background: var(--accent-soft); color: var(--accent); font-size: 13px; font-weight: 700; text-align: center; }
.delta.hi { background: var(--accent); color: #fff; }

.chart-title { font: 600 15px/1.4 var(--sans); letter-spacing: 0; margin: 0 0 12px; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-bottom: 14px; font-size: 13px; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.legend i { display: inline-block; width: 14px; height: 10px; border-radius: 3px; background: var(--c); }
.pairs { display: grid; gap: 14px; }
.pair { display: grid; grid-template-columns: 92px minmax(0, 1fr); align-items: center; gap: 12px; }
.bar-name { font-size: 14px; font-weight: 600; color: var(--ink); }
.pair-bars { display: grid; gap: 4px; }
.bar-row { display: grid; grid-template-columns: minmax(0, 1fr) 46px; align-items: center; gap: 10px; }
.bar-track { position: relative; height: 18px; background: var(--paper-2); border-radius: 0 6px 6px 0; }
.bar-fill { position: absolute; inset: 0 auto 0 0; width: var(--w); border-radius: 0 6px 6px 0; transition: width .9s cubic-bezier(.2,.7,.3,1); }
.bar-fill.agent { background: var(--agent); }
.bar-fill.saadi { background: var(--accent); }
.js-ready .agent-chart:not(.revealed) .bar-fill { width: 0; }
.bar-val { font: 600 15px/1 var(--sans); font-variant-numeric: tabular-nums; color: var(--ink); }
.viz-note { font-size: 12.5px; color: var(--muted); margin: 14px 0 0; line-height: 1.45; }

.stats-inline .stat-value { font-size: clamp(30px, 3.6vw, 42px); }

/* results explorer */
.tabs { display: flex; gap: 24px; margin-bottom: 20px; border-bottom: 1px solid var(--hair); }
.tabs button { min-height: 44px; padding: 0 0 10px; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; background: transparent; color: var(--ink-2); font: 500 16px var(--sans); cursor: pointer; }
.tabs button[aria-selected="true"] { border-bottom-color: var(--accent); color: var(--ink); }
.chart-card { padding: 24px 26px 20px; }
.explorer-subhead { display: flex; justify-content: space-between; align-items: start; gap: 24px; margin-bottom: 18px; }
.explorer-subhead .chart-title { margin: 0; font-size: 17px; }
.explorer-subhead p { font-size: 14.5px; color: var(--ink-2); margin: 4px 0 0; }
.chart-replay { flex-shrink: 0; padding: 8px 14px; font-size: 13.5px; }
.chart-datasets { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 22px; }
.chart-datasets button { min-height: 38px; padding: 8px 14px; border: 1px solid var(--hair); border-radius: 6px; background: none; color: var(--ink-2); font: 500 14px var(--sans); cursor: pointer; }
.chart-datasets button:hover { border-color: var(--ink); }
.chart-datasets button[aria-pressed="true"] { border-color: var(--ink); background: var(--ink); color: var(--surface); }
.live-chart { position: relative; min-width: 0; }
.chart-axis-caption { margin: 0 0 6px 10px; font-size: 12.5px; color: var(--ink-2); }
#chart-mount { width: 100%; min-width: 0; }
#chart-mount > svg { max-width: 100%; overflow: visible; }
#chart-mount text { font-family: var(--sans); font-weight: 400; }
.chart-grid-line { stroke: var(--accent-soft); stroke-width: 1; }
.chart-tick-line { stroke: #afcce3; stroke-width: 1; }
.chart-tick { font-size: 12px; fill: var(--muted); font-variant-numeric: tabular-nums; }
.chart-x-title { font-size: 12.5px; fill: var(--ink-2); }
.result-curve { stroke-linejoin: round; stroke-linecap: round; }
.chart-point { cursor: crosshair; outline: none; }
.point-mark { pointer-events: none; }
.chart-point:focus .point-mark, .chart-point.point-selected .point-mark { stroke: var(--ink); stroke-width: 2.5; filter: drop-shadow(0 0 3px #b9dfff); }
.chart-point:focus .point-hit { stroke: var(--accent); stroke-width: 1.5; stroke-dasharray: 2 2; }
.chart-tooltip { position: absolute; z-index: 5; min-width: 180px; max-width: 250px; padding: 9px 12px; border-radius: 10px; background: var(--ink); color: var(--paper); font-size: 13px; line-height: 1.35; pointer-events: none; box-shadow: 0 8px 24px -10px rgba(0,0,0,.4); }
.chart-tooltip strong, .chart-tooltip span, .chart-tooltip b { display: block; }
.chart-tooltip span { margin-top: 3px; font-size: 12px; color: var(--accent-soft); }
.chart-tooltip b { margin-top: 5px; font-size: 22px; font-weight: 600; }
.chart-tooltip small { margin-left: 6px; font-size: 12px; font-weight: 400; }
.chart-interaction-hint { margin: 16px 0 12px; font-size: 12.5px; color: var(--muted); text-align: center; }
.series-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 20px; padding: 14px 0; border-top: 1px solid var(--hair); border-bottom: 1px solid var(--hair); }
.series-legend button { display: flex; align-items: center; gap: 7px; padding: 6px 0; border: 0; background: none; color: var(--ink-2); font: 500 13px var(--sans); cursor: pointer; }
.series-legend svg { width: 34px; height: 16px; flex-shrink: 0; }
.series-legend button[aria-pressed="false"] { opacity: .4; }
.series-legend button[aria-pressed="false"] span { text-decoration: line-through; }
.series-legend .all-series { margin-left: auto; color: var(--accent); font-weight: 600; }
.chart-method-note { max-width: 70ch; margin: 16px 0; font-size: 14px; color: var(--ink-2); }
.chart-bottom { display: flex; justify-content: space-between; gap: 20px; font-size: 13px; color: var(--muted); }
.chart-bottom a { color: var(--accent); white-space: nowrap; }
.chart-values { margin-top: 16px; border-top: 1px solid var(--hair); }
.chart-values summary { padding: 14px 0 0; color: var(--accent); font: 600 14px var(--sans); cursor: pointer; }
.chart-values .tablewrap { max-height: 340px; overflow: auto; margin-top: 14px; border: 1px solid var(--hair); border-radius: 8px; }
.chart-values table { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.chart-values caption { padding: 10px 12px; background: var(--paper-2); color: var(--ink); font-weight: 600; text-align: left; }
.chart-values th, .chart-values td { padding: 8px 12px; border-bottom: 1px solid var(--hair); text-align: right; }
.chart-values th[scope="row"], .chart-values thead th:first-child { text-align: left; font-weight: 500; }

/* ---------- cost ---------- */
.trackers { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.tracker { margin: 0; padding: 26px; }
.tracker svg { width: 100%; height: auto; margin-bottom: 18px; }
.tracker h3 { font-size: 26px; font-weight: 600; margin-bottom: 8px; }
.tracker p { color: var(--ink-2); margin: 0; font-size: 16px; }
.tr-axis { fill: none; stroke: #afcce3; stroke-width: 1.4; }
.tr-saadi { fill: none; stroke: var(--accent); stroke-width: 3; stroke-linejoin: round; }
.tr-ref { fill: none; stroke: var(--accent); stroke-width: 1.6; stroke-dasharray: 5 5; opacity: .55; }
.tr-agent { fill: none; stroke: var(--teal); stroke-width: 3; stroke-linecap: round; }
.tr-cross { fill: none; stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 4; }
.tr-dot { fill: var(--surface); stroke: var(--accent); stroke-width: 2.5; }
.tr-label { font: 600 13px var(--sans); fill: var(--ink); }
.tr-note { font: 500 11px var(--sans); fill: var(--muted); }
.cost-detail { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 40px; margin-top: clamp(40px, 6vw, 56px); }
.cost-math p { font-size: 16px; color: var(--ink-2); }
.cost-math .eq { margin: 4px 0 18px; }
.cost-table-wrap h3 { font-size: 26px; font-weight: 600; }
.cost-table-wrap > .fineprint:first-of-type { margin: 8px 0 18px; }
.cost-table td:not(:first-child), .cost-table th:not(:first-child) { text-align: right; }

/* ---------- cite / footer ---------- */
.bib { position: relative; padding: 0; overflow: hidden; }
.bib pre { margin: 0; padding: 24px 26px; overflow-x: auto; font: 400 13.5px/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: var(--ink); }
.bib pre a { color: var(--accent); }
.copy { position: absolute; top: 12px; right: 12px; padding: 7px 14px; font-size: 13.5px; background: var(--surface); }
.footer { margin-top: clamp(80px, 10vw, 120px); background: var(--paper-2); color: var(--ink); border-top: 1px solid var(--hair); }
.footer-in { max-width: var(--wrap); margin: 0 auto; padding: 40px var(--gutter); display: flex; flex-wrap: wrap; gap: 24px 32px; align-items: center; justify-content: space-between; }
.footer-identity { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px 32px; width: 100%; }
.footer .light-logo { width: 96px; }
.footer .epfl-logo { width: 72px; }
.footer .hslu-logo { width: 96px; }
.footer-contact { display: grid; gap: 4px; }
.footer p { margin: 0; font-size: 14.5px; }
.footer p a { color: var(--accent); }
.footer .muted { color: var(--ink-2); }

/* entrance */
.reveal { opacity: 0; transform: translateY(14px); animation: rise .8s cubic-bezier(.2,.7,.2,1) forwards; }
.hero-head .reveal:nth-child(1) { animation-delay: .05s; }
.hero-head .reveal:nth-child(2) { animation-delay: .12s; }
.hero-head .reveal:nth-child(3) { animation-delay: .22s; }
.hero-head .reveal:nth-child(4) { animation-delay: .3s; }
.hero-head .reveal:nth-child(5) { animation-delay: .36s; }
.hero-head .reveal:nth-child(6) { animation-delay: .42s; }
.panorama.reveal { animation-delay: .5s; }
.tldr .reveal { animation-delay: .6s; }
@keyframes rise { to { opacity: 1; transform: none; } }

/* ---------- responsive ---------- */
@media (max-width: 960px) {
  .pipeline { grid-template-columns: 1fr 1fr; }
  .pipe:nth-child(2)::after { display: none; }
  .pipeline-3 { grid-template-columns: 1fr; }
  .pipeline-3 .pipe::after { display: none; }
  .tk { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .trackers, .cost-detail, .cols { grid-template-columns: minmax(0, 1fr); }
  .datasets { grid-template-columns: 1fr 1fr; }
  .datasets > div:nth-child(3) { border-left: 0; }
  .datasets > div:nth-child(-n+2) { border-bottom: 1px solid var(--hair); }
}
@media (max-width: 900px) {
  .scrolly { grid-template-columns: minmax(0, 1fr); gap: 20px; }
}
@media (max-width: 760px) {
  body { font-size: 16px; }
  .nav nav a:not(:last-child):not([href="#results"]) { display: none; }
  .stats { grid-template-columns: 1fr; }
  .stat + .stat { border-left: 0; border-top: 1px solid var(--hair); }
  .stat { padding: 20px 4px 18px; }
  .pipeline { grid-template-columns: 1fr; gap: 14px; }
  .pipe::after { display: none; }
  .quote-pair { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .connector { transform: rotate(90deg); font-size: 24px; }
  .lab-logos { gap: 20px; }
  .light-logo { width: 88px; }
  .epfl-logo { width: 66px; }
  .hslu-logo { width: 88px; }
  #hero-scene { border-radius: 16px; }
  #hero-scene text { display: none; }
  .scene-cap { display: block; min-height: 3em; margin: 10px 4px 0; font-size: 14px; color: var(--ink-2); }
  .scene-toggle { bottom: auto; top: 10px; right: 10px; width: 30px; height: 30px; }
  .overview-watch { bottom: 10px; min-height: 40px; padding: 9px 14px; font-size: 13px; gap: 8px; }
  .hero-video video { border-radius: 16px; }
  .overview-back { position: static; display: flex; width: fit-content; margin: 10px 0 0 auto; padding: 10px 12px; }
  .chart-card { padding: 18px 14px 16px; }
  .explorer-subhead { display: block; }
  .chart-replay { margin-top: 12px; }
  .tabs { gap: 14px; overflow-x: auto; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs button { flex-shrink: 0; font-size: 14px; }
  .series-legend { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; }
  .series-legend button { font-size: 12px; }
  .series-legend .all-series { margin: 0; }
  .chart-bottom { display: block; }
  .chart-bottom a { display: inline-block; margin-top: 8px; }
  .tracker { padding: 20px; }
  .bib pre { font-size: 11.5px; padding: 54px 16px 18px; }
  .pair { grid-template-columns: 76px minmax(0, 1fr); gap: 8px; }
}
@media (max-width: 600px) {
  .index-upper { grid-template-columns: 1.05fr 1fr; gap: 12px; padding: 14px 12px 6px; min-height: 262px; }
  .scene-topline { padding: 11px 12px; font-size: 11px; }
  .scene-footer { padding: 9px 12px; font-size: 10.5px; }
  .document-label { padding: 7px 8px; font-size: 10px; }
  .document-window { height: 186px; padding: 10px; font-size: 14.5px; }
  .document-bottom { padding: 6px 8px; font-size: 9px; }
  .diagram-label { flex-wrap: wrap; gap: 2px 6px; font-size: 11.5px; }
  .diagram-label > span { font-size: 10px; }
  .memory-nodes { height: 108px; }
  .entity-node { width: 44px; height: 44px; font-size: 7.5px; }
  .entity-node.n1 { left: 26%; top: 42px; width: 54px; height: 54px; }
  .entity-node.n2 { left: 54%; top: 0; }
  .entity-node.n3 { left: 74%; top: 78px; width: 32px; height: 32px; font-size: 6.5px; }
  .memory-record { min-height: 92px; font-size: 10.5px; }
  .memory-record span { font-size: 9px; }
  .recall-arrow { bottom: -2px; font-size: 9.5px; white-space: nowrap; }
  .hierarchy { margin: 10px 12px 0; }
  .hierarchy svg { height: 130px; }
  .hierarchy > p { font-size: 11px; }
  .question { padding: 12px 14px; }
  .question p { font-size: 23px; }
  .fusion-inputs { gap: 6px; padding: 12px 10px 0; }
  .signal { min-height: 128px; padding: 8px; border-radius: 6px; }
  .signal-label { display: block; min-height: 26px; font-size: 9.5px; line-height: 1.3; }
  .signal p { font-size: 11px; }
  .fusion-lines { width: calc(100% - 20px); height: 34px; margin: 0 10px; }
  .ranking { padding: 12px 10px 0; }
  .rank-item { left: 46px; right: 0; }
  .topk-zone > span { left: 8px; font-size: 10px; }
  .target-passage p { font-size: 13.5px; }
}
@media (max-width: 360px) {
  .links { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .links .btn { justify-content: center; gap: 5px; padding: 11px 4px; font-size: 13px; white-space: nowrap; }
  .links .btn svg { width: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { animation: none; opacity: 1; transform: none; }
  *, *::before, *::after { animation-duration: 0s !important; transition-duration: 0s !important; }
}
