/* CV classique, inspire du CV PDF (bleu vif + bleu marine). */
:root {
	--page: #eef1f8;
	--sheet: #ffffff;
	--ink: #1d2433;
	--muted: #5d6679;
	--navy: #0e2a56;
	--blue: #4f6cff;
	--blue-dark: #3a55e0;
	--side-ink: #ffffff;
	--side-muted: rgba(255, 255, 255, .82);
	--tag: #e9edff;
	--tag-ink: #2b3fb8;
	--line: #e4e8f2;
	color-scheme: light;
}
@media (prefers-color-scheme: dark) {
	:root:not(.force-light) {
		--page: #0f1320;
		--sheet: #171c2b;
		--ink: #e3e7f1;
		--muted: #9aa3b8;
		--navy: #c9d4ff;
		--blue: #3d55d6;
		--blue-dark: #2f45b8;
		--tag: #232b45;
		--tag-ink: #b9c5ff;
		--line: #262d42;
		color-scheme: dark;
	}
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
	margin: 0;
	background: var(--page);
	color: var(--ink);
	font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
}
[hidden] { display: none !important; }
a { color: inherit; }

/* ---- Boutons langue / style (coin superieur droit) ---- */
.controls {
	position: fixed;
	top: 14px;
	right: 14px;
	z-index: 10;
	display: flex;
	gap: 8px;
}
.ctrl {
	min-width: 42px;
	height: 38px;
	padding: 0 12px;
	border: 1px solid var(--line);
	border-radius: 10px;
	background: var(--sheet);
	color: var(--navy);
	font: 600 14px/1 ui-monospace, "Cascadia Code", Consolas, monospace;
	cursor: pointer;
	box-shadow: 0 2px 8px rgba(14, 42, 86, .08);
	transition: transform .12s ease, border-color .12s ease;
}
.ctrl-link { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.ctrl:hover, .ctrl:focus-visible { border-color: var(--blue); transform: translateY(-1px); outline: none; }

/* Bouton terminal : pulsation discrete a la premiere visite. */
.ctrl.pulse { animation: ctrl-pulse 1.6s ease-out 3; }
@keyframes ctrl-pulse {
	0% { box-shadow: 0 0 0 0 rgba(79, 108, 255, .55); }
	100% { box-shadow: 0 0 0 14px rgba(79, 108, 255, 0); }
}

/* Bulle d'invitation (une fois par jour), sous le bouton terminal. */
.term-hint {
	position: fixed;
	top: 64px;
	right: 14px;
	z-index: 11;
	display: flex;
	align-items: flex-start;
	gap: 4px;
	max-width: min(300px, calc(100vw - 28px));
	padding: 6px 6px 6px 14px;
	border-radius: 12px;
	background: var(--navy);
	color: var(--sheet);
	box-shadow: 0 8px 24px rgba(14, 42, 86, .25);
	animation: hint-in .25s ease-out;
}
.term-hint-text, .term-hint-close {
	padding: 4px 0;
	border: 0;
	background: none;
	color: inherit;
	font: 500 14px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	text-align: left;
	cursor: pointer;
}
.term-hint-text:hover, .term-hint-text:focus-visible { text-decoration: underline; text-underline-offset: 3px; outline: none; }
.term-hint-close {
	flex: none;
	width: 26px;
	height: 26px;
	padding: 0;
	border-radius: 8px;
	text-align: center;
	opacity: .75;
}
.term-hint-close:hover, .term-hint-close:focus-visible { opacity: 1; background: rgba(255, 255, 255, .15); outline: none; }
.term-hint::before {
	content: "";
	position: absolute;
	top: -6px;
	right: 34px;
	width: 12px;
	height: 12px;
	background: inherit;
	transform: rotate(45deg);
}
.term-hint.leaving { opacity: 0; transform: translateY(-4px); transition: opacity .25s ease, transform .25s ease; }
@keyframes hint-in { from { opacity: 0; transform: translateY(-6px); } }

/* Lien "Version terminal disponible" sous le titre. */
.term-cta {
	margin: 12px 0 0;
	padding: 0;
	border: 0;
	background: none;
	color: var(--blue);
	font: 600 .95rem/1.4 ui-monospace, "Cascadia Code", Consolas, monospace;
	text-align: left;
	cursor: pointer;
}
.term-cta:hover, .term-cta:focus-visible { text-decoration: underline; text-underline-offset: 4px; outline: none; }
.term-cta-arrow { display: inline-block; transition: transform .15s ease; }
.term-cta:hover .term-cta-arrow { transform: translateX(3px); }

@media (prefers-reduced-motion: reduce) {
	.ctrl.pulse, .term-hint { animation: none; }
}

/* ---- Feuille ---- */
.classic { padding: 72px 16px 48px; }
.sheet {
	max-width: 1040px;
	margin: 0 auto;
	display: grid;
	grid-template-columns: 330px 1fr;
	background: var(--sheet);
	border-radius: 20px;
	overflow: hidden;
	box-shadow: 0 10px 40px rgba(14, 42, 86, .10);
}

/* Colonne laterale */
.side {
	background: linear-gradient(180deg, var(--blue) 0%, var(--blue-dark) 100%);
	color: var(--side-ink);
	padding: 40px 32px;
}
.photo {
	display: block;
	width: 180px;
	height: 180px;
	margin: 0 auto 28px;
	border-radius: 50%;
	object-fit: cover;
	border: 4px solid rgba(255, 255, 255, .9);
}
.profile { margin: 0 0 8px; color: var(--side-muted); font-size: .95rem; }
.side .block { margin-top: 28px; }
.side h2 {
	margin: 0 0 10px;
	font-size: .8rem;
	letter-spacing: .18em;
	text-transform: uppercase;
	color: var(--side-ink);
}
.plain { list-style: none; margin: 0; padding: 0; }
.plain li { margin: 6px 0; color: var(--side-muted); font-size: .95rem; overflow-wrap: anywhere; }
.plain strong { color: var(--side-ink); font-weight: 600; }
.side a { color: var(--side-ink); text-decoration-color: rgba(255, 255, 255, .5); text-underline-offset: 3px; }

/* Colonne principale */
.main { padding: 44px 48px 48px; min-width: 0; }
.head h1 {
	margin: 0;
	color: var(--navy);
	font-size: clamp(2.2rem, 5vw, 3.4rem);
	line-height: 1.02;
	font-weight: 900;
	letter-spacing: -.01em;
	text-transform: uppercase;
}
.subtitle { margin: 8px 0 0; color: var(--muted); font-size: 1.25rem; }
.head-photo { display: none; }

.main .block { margin-top: 36px; }
.main h2 {
	margin: 0 0 14px;
	padding-bottom: 8px;
	border-bottom: 2px solid var(--line);
	color: var(--navy);
	font-size: .85rem;
	letter-spacing: .16em;
	text-transform: uppercase;
}
.entry { margin: 0 0 18px; }
.entry-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.entry h3 { margin: 0; color: var(--navy); font-size: 1.02rem; font-weight: 700; }
.period { flex: none; color: var(--muted); font-size: .85rem; font-variant-numeric: tabular-nums; }
.meta { margin: 2px 0 0; color: var(--muted); font-size: .9rem; }
.entry ul { margin: 6px 0 0; padding-left: 20px; }
.entry li { margin: 3px 0; }

.stack { margin: 6px 0 0; display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
	padding: 2px 10px;
	border-radius: 999px;
	background: var(--tag);
	color: var(--tag-ink);
	font-size: .8rem;
	font-weight: 600;
}

.sub { margin: 14px 0 8px; color: var(--navy); font-size: .95rem; }
.skills { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.skills li { display: grid; grid-template-columns: 240px 1fr; gap: 12px; }
.skills strong { font-weight: 600; }
.skills span { color: var(--muted); }

/* Bouton PDF en bas de la colonne laterale. */
.side-pdf {
	display: inline-block;
	margin-top: 32px;
	padding: 10px 16px;
	border: 1px solid rgba(255, 255, 255, .7);
	border-radius: 10px;
	color: var(--side-ink);
	font-weight: 600;
	font-size: .95rem;
	text-decoration: none;
	transition: background-color .12s ease, border-color .12s ease;
}
.side .side-pdf { text-decoration: none; }
.side-pdf:hover, .side-pdf:focus-visible { background: rgba(255, 255, 255, .15); border-color: #fff; outline: none; }

.noscript { max-width: 600px; margin: 80px auto; padding: 0 16px; text-align: center; }

/* ---- Mobile ---- */
@media (max-width: 820px) {
	.classic { padding: 64px 12px 32px; }
	.sheet { grid-template-columns: 1fr; border-radius: 16px; }
	.side { padding: 32px 24px; }
	.main { padding: 32px 24px 36px; order: -1; }
	.head { display: flex; align-items: center; gap: 16px; }
	.head-photo {
		display: block;
		flex: none;
		width: 84px;
		height: 84px;
		border-radius: 50%;
		object-fit: cover;
	}
	.side .photo { display: none; }
	.subtitle { font-size: 1.05rem; }
	.skills li { grid-template-columns: 1fr; gap: 0; }
	.entry-head { flex-direction: column; gap: 0; }
}

/* ---- Impression / PDF : A4 sur deux colonnes, meme sur un ecran etroit ---- */
@page { size: A4; margin: 0; }
@media print {
	:root { color-scheme: light; }
	html { font-size: 12px; }
	body { background: #fff; font-size: 10.5px; line-height: 1.4; }
	.controls, .terminal, .term-hint, .term-cta, .side-pdf { display: none !important; }
	.classic { padding: 0; }
	.sheet {
		max-width: none;
		min-height: 296mm;
		grid-template-columns: 70mm 1fr;
		border-radius: 0;
		box-shadow: none;
	}
	.side { padding: 10mm 7mm; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
	.side .photo { display: block; width: 34mm; height: 34mm; margin-bottom: 6mm; }
	.main { order: 0; padding: 8mm 10mm 6mm; }
	.head { display: block; }
	.head-photo { display: none !important; }
	.head h1 { font-size: 2.3rem; }
	.subtitle { margin-top: 1mm; font-size: 1.1rem; }
	.main .block { margin-top: 4mm; }
	.main h2 { break-after: avoid; margin-bottom: 2.5mm; }
	.entry { break-inside: avoid; margin-bottom: 2.5mm; }
	.sub { margin: 2mm 0 1.5mm; }
	.skills { gap: 1mm; }
	.entry li { margin: 1px 0; }
	.entry-head { flex-direction: row; }
	.skills li { grid-template-columns: 48mm 1fr; }
	.tag { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
