:root {
	--paper: #ede5d0;
	--paper-d: #e4d7ba;
	--paper-l: #f5eedc;
	--ink: #1c2e4a;
	--ink-2: #34465f;
	--rust: #b85a25;
	--ochre: #d09b3a;
	--sage: #6f8158;
	--burg: #8a2e2e;
	--gold: #cda94f;
	--rule: rgba(28, 46, 74, 0.16);
	--eo-expo: cubic-bezier(0.16, 1, 0.3, 1);
	--eo-quint: cubic-bezier(0.22, 1, 0.36, 1);
}
* {
	box-sizing: border-box;
}
html,
body {
	height: 100%;
	margin: 0;
}
body {
	background: var(--paper);
	color: var(--ink);
	font-family: "Cormorant Garamond", Georgia, serif;
	overflow: hidden;
	-webkit-font-smoothing: antialiased;
}
/* layered paper field */
.field {
	position: fixed;
	inset: 0;
	z-index: 0;
	pointer-events: none;
	background: radial-gradient(
		120% 95% at 50% 38%,
		var(--paper-l) 0%,
		var(--paper) 55%,
		var(--paper-d) 100%
	);
}
.field::before {
	content: "";
	position: absolute;
	inset: 0;
	opacity: 0.5;
	mix-blend-mode: multiply;
	background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='300' height='300'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' seed='7'/><feColorMatrix values='0 0 0 0 0.55  0 0 0 0 0.42  0 0 0 0 0.22  0 0 0 0.15 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
.field::after {
	content: "";
	position: absolute;
	inset: 0;
	background: radial-gradient(
		ellipse at 50% 44%,
		transparent 50%,
		rgba(120, 78, 26, 0.13) 100%
	);
}
canvas {
	position: fixed;
	inset: 0;
	z-index: 1;
	display: block;
	cursor: grab;
	touch-action: none;
	animation: cfade 1.1s cubic-bezier(0.16, 1, 0.3, 1) both;
}
@keyframes cfade {
	from {
		opacity: 0;
		transform: scale(0.985);
	}
	to {
		opacity: 1;
		transform: none;
	}
}
canvas.grab {
	cursor: grabbing;
}

.ui {
	position: fixed;
	z-index: 3;
	pointer-events: none;
}
.masthead {
	top: clamp(1.4rem, 3.4vh, 2.6rem);
	left: clamp(1.2rem, 3vw, 2.6rem);
}
.masthead .eyebrow {
	font-family: "Hanken Grotesk", sans-serif;
	font-size: 0.72rem;
	font-weight: 600;
	letter-spacing: 0.34em;
	text-transform: uppercase;
	color: var(--rust);
	margin: 0 0 0.5rem;
	opacity: 0;
	animation: rise 0.9s var(--eo-expo) 0.15s forwards;
}
.masthead h1 {
	font-family: "Cormorant Garamond", serif;
	font-style: italic;
	font-weight: 600;
	font-size: clamp(2rem, 4vw, 3.4rem);
	margin: 0;
	line-height: 0.98;
	letter-spacing: -0.015em;
	opacity: 0;
	animation: rise 1s var(--eo-expo) 0.26s forwards;
}
.masthead .sub {
	font-family: "Cormorant Garamond", serif;
	font-style: italic;
	font-size: clamp(0.95rem, 1.5vw, 1.2rem);
	color: var(--ink-2);
	margin: 0.35rem 0 0;
	opacity: 0;
	animation: rise 1s var(--eo-expo) 0.38s forwards;
}
@keyframes rise {
	from {
		opacity: 0;
		transform: translateY(14px);
	}
	to {
		opacity: 1;
		transform: none;
	}
}

.search {
	top: clamp(1.4rem, 3.4vh, 2.6rem);
	right: clamp(1.2rem, 3vw, 2.6rem);
	pointer-events: auto;
	display: flex;
	align-items: center;
	gap: 0.6rem;
	background: rgba(245, 238, 220, 0.82);
	backdrop-filter: blur(3px);
	border: 1px solid var(--rule);
	border-radius: 999px;
	padding: 0.55rem 1rem;
	box-shadow: 0 2px 14px rgba(28, 46, 74, 0.06);
	opacity: 0;
	animation: rise 0.9s var(--eo-expo) 0.5s forwards;
}
.search svg {
	width: 16px;
	height: 16px;
	color: var(--ink-2);
	flex: 0 0 auto;
}
.search input {
	border: none;
	background: none;
	outline: none;
	font-family: "Hanken Grotesk", sans-serif;
	font-size: 0.92rem;
	color: var(--ink);
	width: min(30vw, 200px);
}
.search input::placeholder {
	color: rgba(28, 46, 74, 0.45);
}
.search:focus-within {
	border-color: var(--rust);
}
.askkey {
	font-family: "Hanken Grotesk", sans-serif;
	font-size: 0.66rem;
	font-weight: 600;
	color: var(--rust);
	border: 1px solid rgba(184, 90, 37, 0.35);
	border-radius: 6px;
	padding: 0.08em 0.4em;
	opacity: 0;
	transform: translateX(-4px);
	transition:
		opacity 0.25s,
		transform 0.25s var(--eo-quint);
	pointer-events: none;
	flex: 0 0 auto;
}
.search.typing .askkey {
	opacity: 0.95;
	transform: none;
}
.masthead {
	display: flex;
	align-items: center;
	gap: 0.9rem;
}
.masthead .mh-text {
	display: flex;
	flex-direction: column;
}
.avatar {
	width: 62px;
	height: 62px;
	border-radius: 50%;
	object-fit: cover;
	object-position: 62% 26%;
	flex: 0 0 auto;
	box-shadow: 0 5px 20px rgba(28, 46, 74, 0.22);
	border: 2px solid var(--paper-l);
	background: var(--paper-d);
	opacity: 0;
	animation: rise 1s var(--eo-expo) 0.08s forwards;
}
.ins-cap {
	position: fixed;
	z-index: 3;
	right: clamp(1.2rem, 3vw, 2.6rem);
	bottom: 6.6rem;
	font-family: "Hanken Grotesk", sans-serif;
	font-size: 0.74rem;
	color: var(--ink-2);
	background: rgba(245, 238, 220, 0.9);
	border: 1px solid var(--rule);
	border-radius: 999px;
	padding: 0.34rem 0.8rem;
	pointer-events: none;
	opacity: 0;
	transform: translateY(4px);
	transition:
		opacity 0.3s,
		transform 0.3s var(--eo-quint);
}
.ins-cap.show {
	opacity: 1;
	transform: none;
}
.coach {
	position: fixed;
	z-index: 7;
	left: 50%;
	bottom: 7rem;
	transform: translateX(-50%);
	background: rgba(28, 46, 74, 0.93);
	color: #f3ead6;
	font-family: "Cormorant Garamond", serif;
	font-style: italic;
	font-size: 1rem;
	line-height: 1.5;
	text-align: center;
	padding: 1rem 1.5rem;
	border-radius: 14px;
	box-shadow: 0 12px 44px rgba(28, 46, 74, 0.32);
	max-width: min(86vw, 440px);
	opacity: 0;
	animation: rise 0.7s var(--eo-expo) 0.1s forwards;
}
.coach span {
	color: var(--ochre);
	font-style: normal;
	font-weight: 600;
}
.coach b {
	color: #fff;
	font-style: normal;
}
.coach.gone {
	opacity: 0;
	transform: translateX(-50%) translateY(8px);
	transition:
		opacity 0.5s,
		transform 0.5s;
}
button:focus-visible,
[data-n]:focus-visible {
	outline: 2px solid var(--rust);
	outline-offset: 2px;
	border-radius: 999px;
}

.legend {
	left: clamp(1.2rem, 3vw, 2.6rem);
	bottom: clamp(1.4rem, 3.2vh, 2.4rem);
	display: flex;
	flex-wrap: wrap;
	gap: 0.45rem 0.55rem;
	max-width: min(56vw, 560px);
	pointer-events: auto;
	opacity: 0;
	animation: rise 1s var(--eo-expo) 0.7s forwards;
}
.legend button {
	pointer-events: auto;
	cursor: pointer;
	font-family: "Hanken Grotesk", sans-serif;
	font-size: 0.74rem;
	color: var(--ink);
	display: flex;
	align-items: center;
	gap: 0.45rem;
	background: rgba(245, 238, 220, 0.7);
	border: 1px solid var(--rule);
	border-radius: 999px;
	padding: 0.32rem 0.7rem;
	transition:
		opacity 0.25s,
		background 0.25s,
		transform 0.2s var(--eo-quint);
}
.legend button:hover {
	transform: translateY(-1px);
	background: var(--paper-l);
}
.legend button.off {
	opacity: 0.32;
}
.legend i {
	width: 10px;
	height: 10px;
	border-radius: 50%;
	display: inline-block;
	box-shadow: 0 0 0 1px rgba(28, 46, 74, 0.12);
}

.controls {
	right: clamp(1.2rem, 3vw, 2.6rem);
	bottom: clamp(1.4rem, 3.2vh, 2.4rem);
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 0.7rem;
	pointer-events: none;
}
.controls .hint {
	font-family: "Hanken Grotesk", sans-serif;
	font-size: 0.72rem;
	color: rgba(28, 46, 74, 0.5);
	letter-spacing: 0.03em;
	text-align: right;
}
.controls button {
	pointer-events: auto;
	cursor: pointer;
	font-family: "Hanken Grotesk", sans-serif;
	font-size: 0.76rem;
	color: var(--ink);
	background: rgba(245, 238, 220, 0.8);
	border: 1px solid var(--rule);
	border-radius: 999px;
	padding: 0.45rem 0.9rem;
	transition:
		background 0.25s,
		transform 0.2s var(--eo-quint);
	opacity: 0;
	animation: rise 0.9s var(--eo-expo) 0.8s forwards;
}
.controls button:hover {
	background: var(--paper-l);
	transform: translateY(-1px);
}
.insights {
	display: flex;
	gap: 0.35rem;
	pointer-events: auto;
}
.insights button {
	cursor: pointer;
	font-family: "Hanken Grotesk", sans-serif;
	font-size: 0.72rem;
	color: var(--ink);
	background: rgba(245, 238, 220, 0.8);
	border: 1px solid var(--rule);
	border-radius: 999px;
	padding: 0.34rem 0.7rem;
	transition:
		background 0.2s,
		transform 0.2s var(--eo-quint);
	opacity: 0;
	animation: rise 0.9s var(--eo-expo) 0.82s forwards;
}
.insights button:hover {
	transform: translateY(-1px);
	background: var(--paper-l);
}
.insights button.on {
	background: var(--rust);
	color: #f5eedc;
	border-color: var(--rust);
}
.timeline {
	position: fixed;
	z-index: 3;
	left: 50%;
	transform: translateX(-50%);
	bottom: clamp(1.2rem, 3vh, 2rem);
	display: flex;
	align-items: center;
	gap: 0.8rem;
	pointer-events: auto;
	background: rgba(245, 238, 220, 0.86);
	backdrop-filter: blur(3px);
	border: 1px solid var(--rule);
	border-radius: 999px;
	padding: 0.5rem 1.1rem;
	box-shadow: 0 2px 14px rgba(28, 46, 74, 0.07);
	opacity: 0;
	animation: rise 0.9s var(--eo-expo) 0.9s forwards;
}
.timeline .ty-label {
	font-family: "Cormorant Garamond", serif;
	font-style: italic;
	font-weight: 600;
	font-size: 1.1rem;
	color: var(--ink);
	min-width: 2.7em;
	text-align: center;
}
.timeline input[type="range"] {
	-webkit-appearance: none;
	appearance: none;
	width: min(34vw, 300px);
	height: 3px;
	background: var(--rule);
	border-radius: 2px;
	outline: none;
}
.timeline input[type="range"]::-webkit-slider-thumb {
	-webkit-appearance: none;
	width: 16px;
	height: 16px;
	border-radius: 50%;
	background: var(--rust);
	cursor: pointer;
	box-shadow: 0 1px 5px rgba(28, 46, 74, 0.25);
}
.timeline #ty-play {
	cursor: pointer;
	border: none;
	background: none;
	color: var(--rust);
	font-size: 0.9rem;
	line-height: 1;
}
.timeline.playing {
	box-shadow: 0 4px 22px rgba(184, 90, 37, 0.2);
	border-color: rgba(184, 90, 37, 0.4);
}
.timeline.playing .ty-label {
	color: var(--rust);
	transform: scale(1.18);
	transition:
		transform 0.35s var(--eo-expo),
		color 0.35s;
}
/* carte récap de la frise · narration des grands tournants */
.recap {
	position: fixed;
	z-index: 7;
	left: 50%;
	bottom: 7.4rem;
	transform: translateX(-50%) translateY(10px);
	background: linear-gradient(
		180deg,
		rgba(28, 46, 74, 0.96),
		rgba(20, 35, 58, 0.96)
	);
	color: #f3ead6;
	text-align: center;
	border-radius: 16px;
	padding: 1.1rem 1.7rem;
	max-width: min(86vw, 470px);
	pointer-events: none;
	box-shadow: 0 16px 50px rgba(28, 46, 74, 0.36);
	opacity: 0;
	transition:
		opacity 0.55s var(--eo-expo),
		transform 0.65s var(--eo-expo);
}
.recap.show {
	opacity: 1;
	transform: translateX(-50%) translateY(0);
}
.recap .ry {
	font-family: "Hanken Grotesk", sans-serif;
	font-size: 0.7rem;
	font-weight: 600;
	letter-spacing: 0.34em;
	text-transform: uppercase;
	color: var(--ochre);
}
.recap .rt {
	font-family: "Cormorant Garamond", serif;
	font-style: italic;
	font-weight: 600;
	font-size: 1.55rem;
	line-height: 1.05;
	margin: 0.25rem 0 0.4rem;
	color: #fff;
}
.recap .rb {
	font-family: "Cormorant Garamond", serif;
	font-size: 1.04rem;
	line-height: 1.46;
	color: #e8dcc2;
}
.recap .rctx {
	margin-top: 0.6rem;
	padding-top: 0.55rem;
	border-top: 1px solid rgba(243, 234, 214, 0.16);
	font-family: "Hanken Grotesk", sans-serif;
	font-size: 0.76rem;
	letter-spacing: 0.01em;
	color: #b9cdd6;
}
.recap .rctx span {
	color: #8fb0bd;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.14em;
	font-size: 0.62rem;
	margin-right: 0.45em;
}
@media (max-width: 760px) {
	.timeline {
		bottom: auto;
		top: 6.4rem;
	}
	.insights {
		display: none;
	}
	.ins-cap {
		display: none;
	}
	.recap {
		bottom: auto;
		top: 9.4rem;
		max-width: 90vw;
		padding: 0.9rem 1.2rem;
	}
	.recap .rt {
		font-size: 1.3rem;
	}
}

/* panel */
.panel {
	position: fixed;
	top: 0;
	right: 0;
	height: 100%;
	width: min(94vw, 440px);
	z-index: 6;
	background: linear-gradient(
		180deg,
		rgba(245, 238, 220, 0.98),
		rgba(237, 229, 208, 0.98)
	);
	border-left: 1px solid var(--rule);
	box-shadow: -26px 0 60px rgba(28, 46, 74, 0.14);
	transform: translateX(102%);
	transition: transform 0.62s var(--eo-expo);
	padding: clamp(2rem, 4vw, 3rem) clamp(1.6rem, 3.2vw, 2.6rem);
	overflow-y: auto;
}
.panel.open {
	transform: none;
}
.panel::-webkit-scrollbar {
	width: 8px;
}
.panel::-webkit-scrollbar-thumb {
	background: rgba(28, 46, 74, 0.16);
	border-radius: 8px;
}
#close {
	position: absolute;
	top: 1.2rem;
	right: 1.3rem;
	width: 34px;
	height: 34px;
	border: none;
	background: none;
	cursor: pointer;
	color: var(--ink);
	opacity: 0.5;
	transition:
		opacity 0.2s,
		transform 0.3s var(--eo-quint);
	font-size: 1.3rem;
	line-height: 1;
}
#close:hover {
	opacity: 1;
	transform: rotate(90deg);
}
.pc {
	opacity: 0;
}
.panel.open .pc {
	animation: rise 0.6s var(--eo-expo) both;
}
.panel.open .pc.s0 {
	animation-delay: 0.1s;
}
.panel.open .pc.s1 {
	animation-delay: 0.17s;
}
.panel.open .pc.s2 {
	animation-delay: 0.24s;
}
.panel.open .pc.s3 {
	animation-delay: 0.31s;
}
.chip {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	font-family: "Hanken Grotesk", sans-serif;
	font-size: 0.68rem;
	font-weight: 600;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	padding: 0.34em 0.8em;
	border-radius: 999px;
	color: #fff;
}
.panel h2 {
	font-family: "Cormorant Garamond", serif;
	font-style: italic;
	font-weight: 600;
	font-size: clamp(1.8rem, 3.4vw, 2.5rem);
	margin: 1rem 0 0.4rem;
	line-height: 1.05;
}
.panel .sum {
	font-style: italic;
	color: var(--rust);
	font-size: clamp(1.05rem, 1.6vw, 1.2rem);
	margin: 0 0 1.5rem;
	line-height: 1.42;
}
.panel .rule {
	height: 1px;
	background: var(--rule);
	margin: 0 0 1.5rem;
}
.panel .body {
	font-size: 1.07rem;
	line-height: 1.66;
	color: #22344c;
}
.panel .body p {
	margin: 0 0 1rem;
}
.panel .body ul {
	margin: 0 0 1rem;
	padding-left: 1.05rem;
}
.panel .body li {
	margin: 0.34rem 0;
}
.panel .body strong {
	font-weight: 600;
	color: #15233a;
}
.panel .body a.ln {
	color: var(--rust);
	text-decoration: none;
	background-image: linear-gradient(var(--rust), var(--rust));
	background-size: 0% 1.5px;
	background-repeat: no-repeat;
	background-position: 0 100%;
	border-bottom: 1px solid rgba(184, 90, 37, 0.3);
	cursor: pointer;
	font-weight: 500;
	transition: background-size 0.3s var(--eo-quint);
}
.panel .body a.ln:hover {
	background-size: 100% 1.5px;
	border-color: transparent;
}
.panel .neighbors {
	margin-top: 1.6rem;
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
}
.panel .neighbors .tag {
	font-family: "Hanken Grotesk", sans-serif;
	font-size: 0.74rem;
	cursor: pointer;
	padding: 0.3rem 0.7rem;
	border-radius: 999px;
	border: 1px solid var(--rule);
	color: var(--ink);
	background: rgba(255, 255, 255, 0.3);
	transition:
		transform 0.2s var(--eo-quint),
		background 0.2s;
}
.panel .neighbors .tag:hover {
	transform: translateY(-1px);
	background: var(--paper-l);
}
.panel .prov {
	margin-top: 1.4rem;
	font-family: "Hanken Grotesk", sans-serif;
	font-size: 0.74rem;
	color: var(--ink-2);
	line-height: 1.6;
}
.panel .prov .provlbl {
	color: var(--rust);
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	font-size: 0.64rem;
	margin-right: 0.35rem;
}
/* provenance par fait : chaque paragraphe sait d'où il vient */
.panel .body .fact {
	position: relative;
}
.panel .body .fact .why {
	display: inline-block;
	margin-left: 0.45em;
	font-family: "Hanken Grotesk", sans-serif;
	font-size: 0.6rem;
	font-weight: 600;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--rust);
	opacity: 0;
	cursor: pointer;
	vertical-align: middle;
	transition: opacity 0.2s;
	white-space: nowrap;
}
.panel .body .fact:hover .why,
.panel .body .fact.open .why {
	opacity: 0.85;
}
.panel .body .fact.hl {
	background: rgba(205, 169, 79, 0.16);
	border-radius: 6px;
	box-shadow: 0 0 0 6px rgba(205, 169, 79, 0.16);
}
.panel .body .prov-line {
	display: none;
	font-family: "Hanken Grotesk", sans-serif;
	font-size: 0.74rem;
	color: var(--ink-2);
	line-height: 1.6;
	margin: -0.45rem 0 1rem;
	padding: 0.5rem 0.75rem;
	border-left: 2px solid var(--rust);
	background: rgba(255, 255, 255, 0.28);
	border-radius: 0 8px 8px 0;
}
.panel .body .fact.open + .prov-line {
	display: block;
}
.panel .body .prov-line b {
	color: var(--rust);
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	font-size: 0.6rem;
	margin-right: 0.3em;
}
.panel .body .fact.past {
	opacity: 0.55;
}
.panel .body .fact .past-lbl {
	display: inline-block;
	margin-left: 0.45em;
	font-family: "Hanken Grotesk", sans-serif;
	font-size: 0.6rem;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--burg);
	border: 1px solid rgba(138, 46, 46, 0.35);
	border-radius: 4px;
	padding: 0.05em 0.4em;
	vertical-align: middle;
}
.panel .body .fact.future {
	display: none;
}
.panel .gen .think {
	font-family: "Cormorant Garamond", serif;
	font-style: italic;
	color: var(--ink-2);
	animation: breathe 1.6s ease-in-out infinite;
}
@keyframes breathe {
	0%,
	100% {
		opacity: 0.45;
	}
	50% {
		opacity: 1;
	}
}
body.nebula .panel .body .prov-line {
	background: rgba(255, 255, 255, 0.05);
}
body.nebula .panel .body .fact .past-lbl {
	color: #ff9db8;
	border-color: rgba(255, 122, 162, 0.4);
}
body.nebula .panel .body .fact.hl {
	background: rgba(168, 155, 255, 0.14);
	box-shadow: 0 0 0 6px rgba(168, 155, 255, 0.14);
}
.panel .file {
	margin-top: 1.2rem;
	font-family: "Hanken Grotesk", sans-serif;
	font-size: 0.78rem;
}
.panel .file a {
	color: var(--ink);
	opacity: 0.55;
	text-decoration: none;
	letter-spacing: 0.03em;
}
.panel .file a:hover {
	opacity: 1;
	color: var(--rust);
}

@media (max-width: 680px) {
	.controls .hint {
		display: none;
	}
	.masthead .sub {
		display: none;
	}
	.legend {
		max-width: 88vw;
	}
}
@media (max-width: 760px) {
	.masthead h1 {
		font-size: 1.7rem;
	}
	.masthead .eyebrow {
		font-size: 0.6rem;
		letter-spacing: 0.18em;
	}
	.avatar {
		width: 46px;
		height: 46px;
	}
	.masthead {
		gap: 0.65rem;
	}
	.coach {
		font-size: 0.92rem;
		bottom: 5.5rem;
		padding: 0.85rem 1.2rem;
	}
	.search {
		width: auto;
	}
	.search input {
		width: 32vw;
	}
	.legend {
		max-width: 64vw;
		gap: 0.35rem 0.4rem;
	}
	.legend button {
		font-size: 0.68rem;
		padding: 0.28rem 0.55rem;
	}
	.panel {
		width: 100%;
		height: auto;
		max-height: 78vh;
		top: auto;
		bottom: 0;
		left: 0;
		right: 0;
		border-left: none;
		border-top: 1px solid var(--rule);
		border-radius: 20px 20px 0 0;
		transform: translateY(103%);
		box-shadow: 0 -22px 55px rgba(28, 46, 74, 0.18);
		padding: 1.5rem 1.3rem calc(1.8rem + env(safe-area-inset-bottom));
	}
	.panel.open {
		transform: none;
	}
	#close {
		top: 1rem;
		right: 1.1rem;
	}
}

/* commutateur de mode */
.modes {
	top: calc(clamp(1.4rem, 3.4vh, 2.6rem) + 3.4rem);
	right: clamp(1.2rem, 3vw, 2.6rem);
	pointer-events: auto;
	display: flex;
	gap: 2px;
	padding: 3px;
	border-radius: 999px;
	background: rgba(245, 238, 220, 0.82);
	border: 1px solid var(--rule);
	backdrop-filter: blur(3px);
	opacity: 0;
	animation: rise 0.9s var(--eo-expo) 0.6s forwards;
}
.modes button {
	cursor: pointer;
	border: none;
	background: none;
	font-family: "Cormorant Garamond", serif;
	font-style: italic;
	font-size: 0.92rem;
	color: var(--ink);
	padding: 0.3rem 0.85rem;
	border-radius: 999px;
	opacity: 0.6;
	transition:
		opacity 0.25s,
		background 0.25s,
		color 0.25s;
}
.modes button.on {
	opacity: 1;
	background: var(--ink);
	color: var(--paper-l);
}
/* mode nébuleuse : ciel profond, verre sombre, encre lumineuse */
body.nebula {
	--paper: #0a0e2a;
	--paper-d: #060818;
	--paper-l: #151c44;
	--ink: #e9e9ff;
	--ink-2: #b4b7e6;
	--rust: #a89bff;
	--ochre: #ffd57a;
	--rule: rgba(200, 205, 255, 0.16);
	background: #04061a;
}
body.nebula .field {
	display: none;
}
body.nebula canvas {
	filter: saturate(1.22) contrast(1.06);
}
body.nebula .search,
body.nebula .modes,
body.nebula .legend button,
body.nebula .controls button,
body.nebula .insights button,
body.nebula .timeline,
body.nebula .ins-cap {
	background: rgba(12, 16, 46, 0.72);
	border-color: rgba(200, 205, 255, 0.16);
	box-shadow: 0 2px 18px rgba(0, 0, 0, 0.35);
}
body.nebula .legend button:hover,
body.nebula .controls button:hover,
body.nebula .insights button:hover {
	background: rgba(28, 34, 86, 0.9);
}
body.nebula .insights button.on {
	background: var(--rust);
	color: #0a0e2a;
	border-color: var(--rust);
}
body.nebula .modes button.on {
	background: var(--rust);
	color: #0a0e2a;
}
body.nebula .search input::placeholder {
	color: rgba(233, 233, 255, 0.42);
}
body.nebula .askkey {
	border-color: rgba(168, 155, 255, 0.45);
}
body.nebula .controls .hint {
	color: rgba(233, 233, 255, 0.42);
}
body.nebula .avatar {
	box-shadow:
		0 0 0 1px rgba(168, 155, 255, 0.5),
		0 0 26px rgba(120, 110, 255, 0.45);
}
body.nebula .masthead .eyebrow {
	color: #a89bff;
}
body.nebula .timeline input[type="range"] {
	background: rgba(200, 205, 255, 0.22);
}
body.nebula .timeline.playing {
	box-shadow: 0 4px 26px rgba(168, 155, 255, 0.3);
	border-color: rgba(168, 155, 255, 0.45);
}
body.nebula .panel {
	background: linear-gradient(
		180deg,
		rgba(10, 14, 42, 0.97),
		rgba(6, 8, 26, 0.98)
	);
	box-shadow: -26px 0 70px rgba(0, 0, 0, 0.5);
	border-left-color: rgba(200, 205, 255, 0.14);
}
body.nebula .panel .body {
	color: #cfd2f4;
}
body.nebula .panel .body strong {
	color: #fff;
}
body.nebula .panel .sum {
	color: #c4b9ff;
}
body.nebula .panel .neighbors .tag {
	background: rgba(255, 255, 255, 0.05);
}
body.nebula .panel .neighbors .tag:hover {
	background: rgba(168, 155, 255, 0.2);
}
body.nebula .panel::-webkit-scrollbar-thumb {
	background: rgba(200, 205, 255, 0.2);
}
body.nebula .chip {
	box-shadow: 0 0 16px rgba(255, 255, 255, 0.12);
}
body.nebula .coach {
	background: rgba(20, 26, 70, 0.95);
}
body.nebula .recap {
	background: linear-gradient(
		180deg,
		rgba(18, 24, 66, 0.97),
		rgba(10, 14, 42, 0.97)
	);
	box-shadow: 0 16px 60px rgba(0, 0, 0, 0.5);
}
@media (max-width: 760px) {
	.modes {
		top: auto;
		bottom: calc(clamp(1.4rem, 3.2vh, 2.4rem) + 3.1rem);
		right: clamp(1.2rem, 3vw, 2.6rem);
	}
}
@media (prefers-reduced-motion: reduce) {
	* {
		animation-duration: 0.01ms !important;
	}
}
