/* ---------- tokens ---------- */
:root {
	--bg:            #f6f7f9;
	--surface:       #ffffff;
	--surface-alt:   #eef0f3;
	--border:        #dcdfe4;
	--text:          #23262b;
	--text-soft:     #5c626b;
	--text-faint:    #868d97;
	--accent:        #1892b9;
	--accent-strong: #0f6f8f;
	--accent-soft:   #e2f2f8;
	--on-accent:     #ffffff;
	--shadow:        0 1px 2px rgba(20, 25, 35, .06), 0 8px 24px rgba(20, 25, 35, .06);
	--bar-edge:      rgba(0, 0, 0, .16);


	--radius: 10px;
	--maxw: 1080px;
}

@media (prefers-color-scheme: dark) {
	:root {
		--bg:            #14171b;
		--surface:       #1c2026;
		--surface-alt:   #232830;
		--border:        #333a44;
		--text:          #e8eaee;
		--text-soft:     #a8b0bb;
		--text-faint:    #7d8794;
		--accent:        #46b6d9;
		--accent-strong: #7fd0ea;
		--accent-soft:   #17323d;
		--on-accent:     #0d1114;
		--shadow:        0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .35);
		--bar-edge:      rgba(255, 255, 255, .18);

	}
}

*, *::before, *::after { box-sizing: border-box; }

body {
	margin: 0;
	background: var(--bg);
	color: var(--text);
	font: 16px/1.6 ui-sans-serif, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	-webkit-font-smoothing: antialiased;
}

h1, h2, h3 { line-height: 1.25; margin: 0; font-weight: 650; }

/* ---------- masthead ---------- */
.masthead {
	max-width: var(--maxw);
	margin: 0 auto;
	padding: 40px 24px 24px;
	display: flex;
	gap: 28px;
	align-items: center;
	flex-wrap: wrap;
}

.masthead__photo {
	width: 132px;
	height: 132px;
	border-radius: 50%;
	object-fit: cover;
	object-position: 50% 50%;
	border: 3px solid var(--surface);
	box-shadow: var(--shadow);
	flex: none;
}

.masthead__id { min-width: 0; }
.masthead h1 { font-size: clamp(1.9rem, 4vw, 2.6rem); color: var(--accent); letter-spacing: -.01em; }
.masthead__title { margin: 4px 0 12px; font-size: 1.05rem; color: var(--text-soft); }

.contact {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 6px 18px;
	font-size: .92rem;
	color: var(--text-soft);
}
.contact li { display: flex; align-items: center; gap: 7px; }
.contact a { color: inherit; text-decoration-color: var(--border); }
.contact a:hover { color: var(--accent); }
.contact .ico { color: var(--accent); flex: none; }

/* ---------- barre d'onglets ---------- */
.tabs {
	position: sticky;
	top: 0;
	z-index: 10;
	background: color-mix(in srgb, var(--bg) 88%, transparent);
	backdrop-filter: saturate(1.4) blur(8px);
	border-bottom: 1px solid var(--border);
}
@supports not (background: color-mix(in srgb, red 50%, transparent)) {
	.tabs { background: var(--bg); }
}

.tabs__inner {
	max-width: var(--maxw);
	margin: 0 auto;
	padding: 0 24px;
	display: flex;
	gap: 2px;
	overflow-x: auto;
	scrollbar-width: none;
}
.tabs__inner::-webkit-scrollbar { display: none; }

.tab {
	appearance: none;
	background: none;
	border: 0;
	border-bottom: 2px solid transparent;
	margin-bottom: -1px;
	padding: 15px 16px 13px;
	display: inline-flex;
	align-items: center;
	gap: 9px;
	font: inherit;
	font-weight: 600;
	font-size: .95rem;
	color: var(--text-soft);
	white-space: nowrap;
	cursor: pointer;
	transition: color .13s, border-color .13s;
}
.tab__icon { display: block; flex: none; opacity: .75; transition: opacity .13s; }
.tab:hover .tab__icon,
.tab[aria-selected="true"] .tab__icon { opacity: 1; }
.tab:hover { color: var(--text); }
.tab:focus-visible { outline: 2px solid var(--accent); outline-offset: -4px; border-radius: 4px; }
.tab[aria-selected="true"] { color: var(--accent); border-bottom-color: var(--accent); }

/* ---------- panneaux ---------- */
main { max-width: var(--maxw); margin: 0 auto; padding: 0 24px 64px; }

.panel { margin-top: 28px; }
.panel[hidden] { display: none; }
.panel:focus { outline: none; }
.panel:focus-visible { outline: 2px solid var(--accent); outline-offset: 6px; border-radius: var(--radius); }
.panel > h2 { display: none; } /* l'onglet fait office de titre ; réaffiché à l'impression */

.panel__hint { margin: 0 0 18px; color: var(--text-faint); font-size: .9rem; }
.panel__subhead {
	margin: 34px 0 14px;
	font-size: 1.05rem;
	color: var(--text);
	padding-bottom: 6px;
	border-bottom: 2px solid var(--accent);
	display: inline-block;
}

.prose { max-width: 68ch; color: var(--text-soft); }
.prose p { margin: 0 0 10px; }

/* ---------- timeline ---------- */
.timeline-scroll {
	overflow-x: auto;
	overflow-y: hidden;
	padding-bottom: 6px;
	-webkit-overflow-scrolling: touch;
}

.timeline {
	--bar-h: 15px;
	--entry-h: 26px;
	position: relative;
	min-width: 900px; /* en dessous, la frise défile horizontalement */
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 14px 18px 10px;
	box-shadow: var(--shadow);
}

/* Bandeau des phases de carrière, au-dessus de l'axe des années. */
.timeline__eras { position: relative; height: 21px; margin-bottom: 5px; }
.era {
	position: absolute;
	top: 0;
	bottom: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--surface-alt);
	border: 1px solid var(--border);
	border-radius: 5px;
	overflow: hidden;
}
.era__label {
	font-size: .64rem;
	font-weight: 700;
	letter-spacing: .07em;
	text-transform: uppercase;
	color: var(--text-faint);
	white-space: nowrap;
	padding: 0 8px;
}

.era-divider {
	position: absolute;
	bottom: 6px;
	width: 1px;
	background: var(--border);
	z-index: 0;
}

.timeline__axis { position: relative; height: 26px; }
.tick {
	position: absolute;
	top: 0;
	transform: translateX(-50%);
	font-size: .72rem;
	color: var(--text-faint);
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}
.gridline {
	position: absolute;
	bottom: 6px;
	width: 1px;
	background: var(--border);
	opacity: .55;
	z-index: 0; /* derrière les barres, sinon elles paraissent coupées */
}
.gridline--now { background: var(--accent); opacity: .45; }

.timeline__lanes { position: relative; z-index: 1; }

.entry {
	position: absolute;
	display: flex;
	align-items: center;
	gap: 8px;
	height: var(--entry-h);
	background: none;
	border: 0;
	padding: 0;
	margin: 0;
	font: inherit;
	color: inherit;
	cursor: pointer;
	white-space: nowrap;
	border-radius: 6px;
	transition: opacity .15s, transform .15s;
}
.entry:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.entry__bar {
	height: var(--bar-h);
	border-radius: 999px; /* une barre réduite au plancher devient un cercle */
	background: var(--brand);
	flex: none;
	position: relative;
	transition: box-shadow .15s, height .15s;
	/* Liseré discret : certaines couleurs de marque sont très claires (le jaune
	   InReaLife est à 1,3:1 sur le fond blanc) et disparaîtraient en thème clair.
	   On utilise outline plutôt que box-shadow, réservé à l'anneau de sélection. */
	outline: 1px solid var(--bar-edge);
	outline-offset: -1px;
}
/* La barre « en cours » s'estompe : un contour la refermerait en capsule. */
.entry__bar--open { outline: none; }
/* Mission en cours : la barre s'estompe vers la droite.
   Le fondu fait partie du fond de la barre — un pseudo-élément superposé
   chevauchait son extrémité et ajoutait une seconde extrémité arrondie, ce qui
   donnait l'illusion d'une barre en doublon derrière la dernière période. */
.entry__bar--open {
	background: linear-gradient(to right, var(--brand) 72%, transparent);
}

.entry__label {
	font-size: .8rem;
	font-weight: 600;
	color: var(--text-soft);
	pointer-events: none;
}
.entry__label--inside {
	position: absolute;
	left: 10px;
	color: #fff;
	text-shadow: 0 1px 1px rgba(0, 0, 0, .28);
}

.entry:hover .entry__bar { height: calc(var(--bar-h) + 4px); }
.entry:hover .entry__label { color: var(--text); }

.entry.is-selected .entry__bar { box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--brand); height: calc(var(--bar-h) + 4px); }
.entry.is-selected .entry__label { color: var(--text); }

.timeline.is-filtering .entry { opacity: .22; }
.timeline.is-filtering .entry.is-match { opacity: 1; }
.timeline.is-filtering .entry.is-match .entry__bar { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--brand); }

/* Mode compact (petits écrans) : la frise tient dans la largeur de l'écran.
   Les libellés disparaissent — les couleurs et la légende situent les missions,
   et le détail s'ouvre au toucher. Barres plus épaisses pour la cible tactile. */
.timeline.is-compact {
	--bar-h: 18px;
	--entry-h: 30px;
	padding: 14px 12px 10px;
}
.timeline.is-compact .entry__label { display: none; }
.timeline.is-compact .entry { gap: 0; }

/* ---------- detail ---------- */
.detail-slot:empty { display: none; }
.detail:empty { display: none; }
.detail {
	margin-top: 18px;
	scroll-margin-top: 72px;
	background: var(--surface);
	border: 1px solid var(--border);
	border-left: 4px solid var(--brand, var(--accent));
	border-radius: var(--radius);
	padding: 20px 22px;
	box-shadow: var(--shadow);
	animation: rise .18s ease-out;
}
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }
@media (prefers-reduced-motion: reduce) {
	.detail { animation: none; }
	.entry, .entry__bar { transition: none; }
}

.detail__head {
	display: flex;
	gap: 12px;
	align-items: baseline;
	flex-wrap: wrap;
	margin-bottom: 4px;
	padding-right: 34px; /* laisse la place au bouton de fermeture */
}
.detail__head h3 { font-size: 1.2rem; }
.detail__company { color: var(--accent); } /* texte : contraste garanti, contrairement à une couleur de marque arbitraire */
.detail__period {
	margin-left: auto;
	font-size: .85rem;
	color: var(--text-faint);
	font-variant-numeric: tabular-nums;
	text-align: right;
}
.detail__duration {
	display: block;
	font-size: .78rem;
	opacity: .85;
}
.detail__summary { margin: 8px 0 0; color: var(--text-soft); max-width: 72ch; }
.detail ul.detail__bullets { margin: 12px 0 0; padding-left: 20px; color: var(--text-soft); }
.detail ul.detail__bullets li { margin-bottom: 3px; }

.close-btn {
	background: none;
	border: 0;
	font-size: 1.3rem;
	line-height: 1;
	color: var(--text-faint);
	cursor: pointer;
	padding: 4px 8px;
	border-radius: 6px;
	flex: none;
}
.close-btn:hover { color: var(--text); background: var(--surface-alt); }
.close-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.detail, .tag-results { position: relative; }
.detail > .close-btn, .tag-results > .close-btn { position: absolute; right: 14px; top: 12px; }

/* ---------- bandeau de filtre (onglet Parcours) ---------- */
.filterbar:empty { display: none; }
.filterbar {
	display: flex;
	align-items: center;
	gap: 12px;
	flex-wrap: wrap;
	margin-bottom: 14px;
	padding: 9px 10px 9px 16px;
	background: var(--accent-soft);
	border: 1px solid var(--border);
	border-radius: 999px;
	font-size: .88rem;
	color: var(--text-soft);
	animation: rise .18s ease-out;
}
.filterbar__text strong { color: var(--text); }
.filterbar__link {
	margin-left: auto;
	font: inherit;
	font-weight: 600;
	background: none;
	border: 0;
	color: var(--accent);
	cursor: pointer;
	padding: 2px 6px;
	border-radius: 6px;
	white-space: nowrap;
}
.filterbar__link:hover { text-decoration: underline; }
.filterbar__link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .filterbar { animation: none; } }

.chips { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 16px; padding: 0; list-style: none; }

/* ---------- tags ---------- */
.tag {
	font: inherit;
	font-size: .8rem;
	line-height: 1.2;
	padding: 5px 11px;
	border-radius: 999px;
	border: 1px solid var(--border);
	background: var(--surface-alt);
	color: var(--text-soft);
	cursor: pointer;
	transition: background .13s, color .13s, border-color .13s;
}
.tag:hover { border-color: var(--accent); color: var(--accent); }
.tag:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.tag.is-active {
	background: var(--accent);
	border-color: var(--accent);
	color: var(--on-accent);
	font-weight: 600;
}

.cloud {
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 20px 22px 24px;
	box-shadow: var(--shadow);
}

.cloud__group + .cloud__group { margin-top: 22px; }
.cloud__cat {
	margin: 0 0 10px;
	font-size: .76rem;
	font-weight: 700;
	letter-spacing: .08em;
	text-transform: uppercase;
	color: var(--text-faint);
}
.cloud__row {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 9px;
	align-items: center;
}

/* Référentiel incohérent : visible, pas seulement dans la console. */
.data-error {
	margin-bottom: 16px;
	padding: 14px 18px;
	border: 1px solid #d4574f;
	border-left: 4px solid #d4574f;
	border-radius: var(--radius);
	background: color-mix(in srgb, #d4574f 12%, var(--surface));
	color: var(--text);
	font-size: .9rem;
}
@supports not (background: color-mix(in srgb, red 50%, transparent)) {
	.data-error { background: var(--surface); }
}
.data-error ul { margin: 8px 0 0; padding-left: 20px; color: var(--text-soft); }
.cloud .tag { padding: 6px 13px; display: inline-flex; align-items: center; }

/* Le logo est dimensionné en em : il suit la taille variable du tag dans le nuage. */
.tag__logo {
	width: 1em;
	height: 1em;
	flex: none;
	margin-right: .45em;
	opacity: .75;
	transition: opacity .13s;
}
.tag:hover .tag__logo,
.tag.is-active .tag__logo { opacity: 1; }
.cloud .tag .count {
	font-size: .68em;
	opacity: .6;
	margin-left: 5px;
	font-variant-numeric: tabular-nums;
}

/* ---------- tag results ---------- */
.tag-results:empty { display: none; }
.tag-results {
	margin-top: 18px;
	scroll-margin-top: 72px;
	background: var(--accent-soft);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 18px 20px;
	animation: rise .18s ease-out;
	position: relative;
}
@media (prefers-reduced-motion: reduce) { .tag-results { animation: none; } }

.tag-results__head { margin: 0 34px 14px 0; font-size: .95rem; color: var(--text-soft); }
.tag-results__head strong { color: var(--text); }

.hits { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.hit {
	width: 100%;
	text-align: left;
	font: inherit;
	background: var(--surface);
	border: 1px solid var(--border);
	border-left: 3px solid var(--brand, var(--accent));
	border-radius: 8px;
	padding: 10px 14px;
	cursor: pointer;
	color: var(--text);
	display: flex;
	gap: 10px;
	align-items: baseline;
	flex-wrap: wrap;
	transition: border-color .13s, transform .13s;
}
.hit:hover { transform: translateX(2px); border-color: var(--accent); }
.hit:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.hit strong { font-weight: 650; }
.hit .hit__role { color: var(--text-soft); font-size: .88rem; }
.hit .hit__period { margin-left: auto; color: var(--text-faint); font-size: .82rem; font-variant-numeric: tabular-nums; }
.hit .hit__version {
	font-size: .75rem;
	color: var(--accent);
	border: 1px solid currentColor;
	border-radius: 999px;
	padding: 1px 8px;
}

/* ---------- education / languages ---------- */
.edu { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.edu li {
	display: grid;
	grid-template-columns: 110px 1fr;
	gap: 4px 18px;
	padding-bottom: 12px;
	border-bottom: 1px solid var(--border);
}
.edu li:last-child { border-bottom: 0; }
.edu .edu__years { color: var(--text-faint); font-variant-numeric: tabular-nums; font-size: .9rem; }
.edu .edu__title { font-weight: 600; }
.edu .edu__school { color: var(--accent); font-size: .92rem; }
.edu .edu__detail { grid-column: 2; color: var(--text-soft); font-size: .9rem; }

.langs { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px 32px; }
.langs li { color: var(--text-soft); }
.langs strong { color: var(--text); }

.footer {
	max-width: var(--maxw);
	margin: 0 auto;
	padding: 20px 24px 48px;
	color: var(--text-faint);
	font-size: .85rem;
	border-top: 1px solid var(--border);
}
.footer p { margin: 16px 0 0; }
.footer code { background: var(--surface-alt); padding: 1px 5px; border-radius: 4px; }

@media (max-width: 620px) {
	.masthead { padding-top: 28px; gap: 20px; }
	.masthead__photo { width: 92px; height: 92px; }

	/* la frise tient dans l'écran : plus de largeur minimale ni de défilement */
	.timeline { min-width: 0; }
	.timeline-scroll { overflow-x: visible; padding-bottom: 0; }

	/* Une seule ligne, sans défilement : seuls l'icône et le libellé de
	   l'onglet actif sont affichés, les autres se réduisent à leur icône.
	   Le nom accessible reste porté par aria-label sur chaque bouton. */
	.tabs__inner { flex-wrap: nowrap; overflow-x: auto; padding: 0 12px; gap: 2px; }
	.tab { padding: 12px 13px 10px; font-size: .9rem; gap: 8px; }
	.tab .tab__label { display: none; }
	.tab[aria-selected="true"] .tab__label { display: inline; }
	.edu li { grid-template-columns: 1fr; }
	.edu .edu__detail { grid-column: 1; }
}

@media print {
	/* les onglets n'ont pas de sens sur papier : on déplie tous les panneaux */
	.tabs, .panel__hint, .footer, .close-btn, .filterbar, .tag-results { display: none; }
	.panel[hidden] { display: block; }
	.panel > h2 {
		display: block;
		font-size: 1.35rem;
		margin: 28px 0 12px;
		padding-bottom: 8px;
		border-bottom: 2px solid var(--accent);
	}
	.panel { break-inside: avoid; }
	body { background: #fff; }
	.timeline, .cloud, .detail { box-shadow: none; }
}

/* libellé rabattu à gauche quand il déborderait du cadre de la frise */
.entry--flip { flex-direction: row-reverse; }
