:root {
	/* --- VARIABLES PAR DÉFAUT (BLUE) --- */
	--bg-body: #0b1120;
	--bg-card: #151e32;
	--bg-card-hover: #1e293b;
	--text-main: #f8fafc;
	--text-muted: #94a3b8;
	--accent: #38bdf8;
	--accent-glow: rgba(56, 189, 248, 0.3);
	--accent-light: rgba(56, 189, 248, 0.1);
	--border-light: rgba(255, 255, 255, 0.05);
	--font-heading: 'Space Grotesk', sans-serif;
	--font-body: 'Outfit', sans-serif;
	--container-width: 1200px;
	--section-spacing: 100px;
	--header-height: 80px;
}

/* --- DÉFINITION DES THÈMES --- */
[data-theme='red'] {
	--bg-body: #1a0505;
	--bg-card: #2d0b0b;
	--bg-card-hover: #3f1212;
	--accent: #ef4444;
	--accent-glow: rgba(239, 68, 68, 0.3);
	--accent-light: rgba(239, 68, 68, 0.15);
	--text-muted: #dcaaaa;
}
[data-theme='green'] {
	--bg-body: #051a0a;
	--bg-card: #0b2d12;
	--bg-card-hover: #123f1a;
	--accent: #22c55e;
	--accent-glow: rgba(34, 197, 94, 0.3);
	--accent-light: rgba(34, 197, 94, 0.15);
	--text-muted: #aadcba;
}
[data-theme='yellow'] {
	--bg-body: #1a1605;
	--bg-card: #2d260b;
	--bg-card-hover: #3f3512;
	--accent: #eab308;
	--accent-glow: rgba(234, 179, 8, 0.3);
	--accent-light: rgba(234, 179, 8, 0.15);
	--text-muted: #dcd4aa;
}
[data-theme='mono'] {
	--bg-body: #0a0a0a;
	--bg-card: #171717;
	--bg-card-hover: #262626;
	--accent: #ffffff;
	--accent-glow: rgba(255, 255, 255, 0.2);
	--accent-light: rgba(255, 255, 255, 0.1);
	--text-muted: #a3a3a3;
}

/* Transition Globale Fluide */
body,
div,
section,
header,
nav,
a,
p,
h1,
h2,
h3,
h4,
span,
i,
button,
input,
li {
	transition: background-color 0.5s ease, color 0.5s ease,
		border-color 0.5s ease, box-shadow 0.5s ease, transform 0.3s ease;
}

/* --- Reset & Base --- */
* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;

	/* Empecher la sélection de texte */
	-webkit-user-select: none;
	-ms-user-select: none;
	user-select: none;
}

/* Réactiver la sélection pour les inputs */
input,
textarea {
	-webkit-user-select: text;
	user-select: text;
	cursor: text !important;
}

/* --- SCROLLBAR --- */
html {
	scrollbar-width: thin;
	scrollbar-color: var(--accent) var(--bg-body);
}
::-webkit-scrollbar {
	width: 12px;
}
::-webkit-scrollbar-track {
	background: var(--bg-body);
}
::-webkit-scrollbar-thumb {
	background-color: var(--accent);
	border-radius: 20px;
	border: 3px solid var(--bg-body);
	background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover {
	border: 2px solid var(--bg-body);
	background-color: var(--text-main);
}

/* Configuration Lenis */
html.lenis,
html.lenis body {
	height: auto;
}
.lenis.lenis-smooth {
	scroll-behavior: auto !important;
}
.lenis.lenis-smooth [data-lenis-prevent] {
	overscroll-behavior: contain;
}
.lenis.lenis-stopped {
	overflow: hidden;
}

body {
	background-color: var(--bg-body);
	color: var(--text-main);
	font-family: var(--font-body);
	line-height: 1.7;
	overflow-x: hidden;
	font-size: 16px;
	cursor: auto;
}

/* Style quand on attrape la page */
body.dragging {
	cursor: grabbing !important;
}
body.dragging #cursor-dot,
body.dragging #cursor-outline {
	opacity: 0;
	transition: opacity 0.2s;
}

/* --- CUSTOM CURSOR STYLES --- */
#cursor-dot,
#cursor-outline {
	position: fixed;
	top: 0;
	left: 0;
	border-radius: 50%;
	pointer-events: none;
	z-index: 100000000;
	display: none;
}

#cursor-dot {
	width: 8px;
	height: 8px;
	background-color: var(--accent);
	transform: translate(-50%, -50%);
}

#cursor-outline {
	width: 40px;
	height: 40px;
	border: 1px solid var(--accent);
	opacity: 0.5;
	transform: translate(-50%, -50%);
	transition: width 0.2s, height 0.2s, background-color 0.2s;
}

body.hovered #cursor-outline {
	width: 60px;
	height: 60px;
	background-color: var(--accent-light);
	border-color: transparent;
}

/* Desktop Only Logic via CSS */
@media (min-width: 992px) {
	body,
	a,
	button,
	.theme-switcher-container {
		cursor: none !important;
	}
	#cursor-dot,
	#cursor-outline {
		display: block !important;
	}
	input {
		cursor: text !important;
	}
	body.dragging {
		cursor: grabbing !important;
	}
}

a {
	text-decoration: none;
	color: inherit;
}
ul {
	list-style: none;
}

/* --- Background Canvas --- */
#bg-canvas {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	z-index: -1;
	pointer-events: none;
}

/* --- Layout --- */
.container {
	max-width: var(--container-width);
	margin: 0 auto;
	padding: 0 20px;
	position: relative;
	z-index: 1;
}

section {
	padding: var(--section-spacing) 0;
	opacity: 0;
	transform: translateY(20px);
	transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}
section.visible {
	opacity: 1;
	transform: translateY(0);
}

.section-header {
	margin-bottom: 40px;
	text-align: left;
}
.section-title {
	font-family: var(--font-heading);
	font-size: 2rem;
	font-weight: 700;
	display: inline-block;
	position: relative;
}
.section-title::after {
	content: '';
	position: absolute;
	bottom: -8px;
	left: 0;
	width: 50px;
	height: 3px;
	background: var(--accent);
	border-radius: 2px;
}

/* --- Header --- */
header {
	position: fixed;
	top: 0;
	width: 100%;
	height: var(--header-height);
	background: rgba(var(--bg-body), 0.95);
	backdrop-filter: blur(10px);
	border-bottom: 1px solid var(--border-light);
	z-index: 1000;
	background: var(--bg-body);
	opacity: 0.98;
}
header .container {
	height: 100%;
}

nav {
	height: 100%;
	display: flex;
	justify-content: space-between;
	align-items: center;
}

.logo {
	font-family: var(--font-heading);
	font-size: 1.5rem;
	font-weight: 700;
	letter-spacing: -1px;
	z-index: 1001;
}
.logo span {
	color: var(--accent);
}

.nav-menu {
	display: none;
}
@media (min-width: 768px) {
	.nav-menu {
		display: flex;
		gap: 30px;
	}
}

.nav-link {
	font-size: 0.95rem;
	font-weight: 500;
	color: var(--text-muted);
	position: relative;
	transition: color 0.3s;
}
.nav-link:hover,
.nav-link.active {
	color: var(--text-main);
}
.nav-link::before {
	content: '';
	position: absolute;
	bottom: -5px;
	left: 0;
	width: 0;
	height: 2px;
	background: var(--accent);
	transition: width 0.3s ease;
}
.nav-link:hover::before,
.nav-link.active::before {
	width: 100%;
}

/* Hamburger */
.hamburger {
	display: block;
	font-size: 1.5rem;
	color: var(--text-main);
	z-index: 1001;
	cursor: pointer;
}
@media (min-width: 768px) {
	.hamburger {
		display: none;
	}
}

.mobile-menu-overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100vh;
	background: var(--bg-body);
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	gap: 40px;
	z-index: 1000;
	transform: translateX(100%);
	transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.mobile-menu-overlay.open {
	transform: translateX(0);
}
.mobile-link {
	font-size: 1.5rem;
	font-weight: 700;
	color: var(--text-main);
	font-family: var(--font-heading);
}

/* --- Theme Switcher --- */
.theme-switcher-container {
	position: fixed;
	right: 0;
	top: 50%;
	transform: translateY(-50%);
	z-index: 2000;
	display: flex;
	align-items: center;
}
.theme-toggle-btn {
	background: var(--bg-card);
	border: 1px solid var(--border-light);
	border-right: none;
	padding: 12px;
	border-top-left-radius: 8px;
	border-bottom-left-radius: 8px;
	cursor: pointer;
	color: var(--text-muted);
	font-size: 1.2rem;
	box-shadow: -2px 2px 10px rgba(0, 0, 0, 0.2);
	transition: color 0.3s, background 0.3s;
	position: relative;
	z-index: 2002;
}
.theme-toggle-btn:hover {
	color: var(--accent);
}
.theme-panel {
	background: var(--bg-card);
	border: 1px solid var(--border-light);
	border-left: none;
	padding: 10px;
	border-top-left-radius: 0;
	border-bottom-left-radius: 0;
	border-bottom-right-radius: 8px;
	display: flex;
	flex-direction: column;
	gap: 12px;
	transform: translateX(100%);
	transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
	position: absolute;
	right: 0;
	top: 0;
	box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
	margin-top: -60px;
	height: auto;
	width: 60px;
	align-items: center;
}
.theme-switcher-container.open .theme-panel {
	transform: translateX(0);
	position: relative;
	margin-top: 0;
	border-left: 1px solid var(--border-light);
	border-top-left-radius: 0;
	border-bottom-left-radius: 8px;
}
.theme-switcher-container.open .theme-toggle-btn {
	border-top-right-radius: 0;
	border-bottom-right-radius: 0;
	border-right: none;
}
.theme-btn {
	width: 24px;
	height: 24px;
	border-radius: 50%;
	border: 2px solid transparent;
	cursor: pointer;
	transition: transform 0.2s;
}
.theme-btn:hover {
	transform: scale(1.2);
}
.theme-btn.active {
	border-color: var(--text-main);
	transform: scale(1.2);
}

/* --- Content Sections --- */
#home {
	min-height: 100vh;
	display: flex;
	align-items: center;
	padding-top: 80px;
}
.hero-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 40px;
	align-items: center;
}
@media (min-width: 992px) {
	.hero-grid {
		grid-template-columns: 1.5fr 1fr;
	}
}
.hero-content {
	text-align: center;
}
@media (min-width: 992px) {
	.hero-content {
		text-align: left;
	}
}
.hero-content h2 {
	font-size: 1rem;
	color: var(--accent);
	margin-bottom: 15px;
	font-weight: 500;
	letter-spacing: 2px;
	text-transform: uppercase;
}
.hero-content h1 {
	font-family: var(--font-heading);
	font-size: 2.8rem;
	line-height: 1.1;
	margin-bottom: 20px;
	font-weight: 700;
}
@media (min-width: 768px) {
	.hero-content h1 {
		font-size: 4rem;
	}
}
.hero-content p {
	font-size: 1.1rem;
	color: var(--text-muted);
	max-width: 600px;
	margin: 0 auto 30px;
}
@media (min-width: 992px) {
	.hero-content p {
		margin: 0 0 40px 0;
	}
}
.hero-actions {
	display: flex;
	flex-direction: column;
	gap: 15px;
	align-items: center;
}
@media (min-width: 480px) {
	.hero-actions {
		flex-direction: row;
		justify-content: center;
	}
}
@media (min-width: 992px) {
	.hero-actions {
		justify-content: flex-start;
	}
}
.btn {
	padding: 12px 28px;
	border-radius: 4px;
	font-weight: 600;
	transition: all 0.3s ease;
	font-family: var(--font-heading);
	letter-spacing: 1px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	width: 100%;
	max-width: 250px;
}
@media (min-width: 480px) {
	.btn {
		width: auto;
	}
}
.btn-primary {
	background: transparent;
	border: 2px solid var(--accent);
	color: var(--accent);
	box-shadow: 0 0 15px var(--accent-light);
}
.btn-primary:hover {
	background: var(--accent-light);
	transform: translateY(-2px);
	box-shadow: 0 0 25px rgba(56, 189, 248, 0.2);
}
.btn-secondary {
	border: 2px solid var(--text-muted);
	color: var(--text-muted);
}
.btn-secondary:hover {
	border-color: var(--text-main);
	color: var(--text-main);
}

/* --- TIMELINE (Utilisé pour Expérience ET Formation) --- */
.timeline {
	position: relative;
	padding-left: 20px;
}
.timeline::before {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	height: 100%;
	width: 2px;
	background: var(--border-light);
}
.timeline-item {
	position: relative;
	margin-bottom: 40px;
	padding-left: 30px;
}
.timeline-item::after {
	content: '';
	position: absolute;
	top: 50%;
	left: -28px;
	width: 12px;
	height: 12px;
	background: var(--bg-body);
	border: 2px solid var(--accent);
	border-radius: 50%;
	box-shadow: 0 0 10px var(--accent);
}

/* Interactive Cards */
.timeline-card {
	background: var(--bg-card);
	padding: 20px;
	border-radius: 8px;
	border: 1px solid var(--border-light);
	transition: 0.3s;
	cursor: pointer;
}
/* Add visual cue for clickability */
.timeline-card:hover {
	border-color: var(--accent);
	transform: translateX(5px);
	background: var(--bg-card-hover);
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

@media (min-width: 768px) {
	.timeline-card {
		padding: 30px;
	}
}

.job-header {
	display: flex;
	flex-direction: column;
	margin-bottom: 15px;
	gap: 5px;
}
@media (min-width: 768px) {
	.job-header {
		flex-direction: row;
		justify-content: space-between;
		align-items: flex-start;
	}
}
.job-title {
	font-size: 1.2rem;
	font-weight: 700;
	color: var(--text-main);
	line-height: 1.3;
}
.job-company {
	color: var(--accent);
	font-weight: 500;
	font-size: 0.95rem;
}
.job-date {
	font-family: monospace;
	font-size: 0.85rem;
	color: var(--text-muted);
}
.job-desc {
	margin-bottom: 20px;
	color: var(--text-muted);
	font-size: 0.95rem;
}
.tech-stack {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}
.tech-tag {
	font-size: 0.75rem;
	padding: 4px 10px;
	background: var(--accent-light);
	color: var(--accent);
	border-radius: 20px;
	font-weight: 500;
}

.skills-controls {
	margin-bottom: 30px;
	display: flex;
	flex-direction: column;
	gap: 15px;
}
.skills-search-bar input {
	width: 100%;
	padding: 12px 20px 12px 45px;
	background: var(--bg-card);
	border: 1px solid var(--border-light);
	color: var(--text-main);
	border-radius: 30px;
	outline: none;
	transition: 0.3s;
}
.skills-search-bar {
	position: relative;
	max-width: 100%;
}
.skills-search-bar i {
	position: absolute;
	left: 18px;
	top: 50%;
	transform: translateY(-50%);
	color: var(--text-muted);
}
.skills-filter-tags {
	display: flex;
	flex-wrap: nowrap;
	overflow-x: auto;
	gap: 10px;
	padding-bottom: 5px;
	-webkit-overflow-scrolling: touch;
}
@media (min-width: 768px) {
	.skills-filter-tags {
		flex-wrap: wrap;
		overflow-x: visible;
	}
}
.filter-tag {
	padding: 6px 14px;
	background: var(--bg-card);
	border: 1px solid var(--border-light);
	color: var(--text-muted);
	border-radius: 20px;
	font-size: 0.85rem;
	white-space: nowrap;
	cursor: pointer;
	transition: all 0.3s ease;
}
.filter-tag.active {
	background: var(--accent-light);
	border-color: var(--accent);
	color: var(--accent);
}
.skills-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 20px;
}
@media (min-width: 600px) {
	.skills-grid {
		grid-template-columns: repeat(2, 1fr);
	}
}
@media (min-width: 992px) {
	.skills-grid {
		grid-template-columns: repeat(3, 1fr);
	}
}
.skill-card {
	background: var(--bg-card);
	padding: 25px;
	border-radius: 8px;
	border: 1px solid var(--border-light);
	transition: 0.3s;
}
.skill-card:hover {
	border-color: var(--accent);
	transform: translateY(-5px);
}
.skill-card h3 {
	font-size: 1.1rem;
	color: var(--text-main);
	display: flex;
	align-items: center;
	gap: 10px;
	margin-bottom: 15px;
}
.skill-card h3 i {
	color: var(--accent);
}
.skill-link {
	display: flex;
	align-items: center;
	color: var(--text-muted);
	padding: 4px;
	border-radius: 4px;
	font-size: 0.95rem;
}
.skill-link:hover {
	color: var(--accent);
	background: rgba(255, 255, 255, 0.03);
	padding-left: 8px;
}
.skill-link::before {
	content: '▹';
	color: var(--accent);
	margin-right: 10px;
	font-size: 1rem;
}

.contact-container {
	display: grid;
	grid-template-columns: 1fr;
	gap: 40px;
}
@media (min-width: 992px) {
	.contact-container {
		grid-template-columns: 1fr 1fr;
	}
}
.contact-item {
	margin-bottom: 20px;
	display: flex;
	align-items: center;
	gap: 15px;
	font-size: 1rem;
}
.contact-item i {
	width: 40px;
	height: 40px;
	background: var(--accent-light);
	color: var(--accent);
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	font-size: 1rem;
}
footer {
	text-align: center;
	padding: 40px 0;
	color: var(--text-muted);
	font-size: 0.85rem;
	border-top: 1px solid var(--border-light);
	margin-top: 40px;
}

/* --- MODAL SYSTEM --- */
.modal-overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.7);
	backdrop-filter: blur(8px);
	z-index: 10001; /* Above cursor */
	display: flex;
	justify-content: center;
	align-items: center;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.4s ease;
	padding: 20px;
}
.modal-overlay.open {
	opacity: 1;
	pointer-events: all;
}

.modal-content {
	background: var(--bg-card);
	border: 1px solid var(--border-light);
	border-radius: 12px;
	width: 100%;
	max-width: 700px;
	max-height: 90vh;
	overflow-y: auto;
	position: relative;
	transform: scale(0.9);
	transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
	box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}
.modal-overlay.open .modal-content {
	transform: scale(1);
}

/* Modal Slideshow */
.modal-slideshow {
	width: 100%;
	height: 300px;
	background: #000;
	position: relative;
	overflow: hidden;
	border-bottom: 1px solid var(--border-light);
}
.slides-wrapper {
	width: 100%;
	height: 100%;
	display: flex;
	transition: transform 0.5s ease-in-out;
}
.slide {
	min-width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}
/* Navigation Slideshow */
.slide-nav {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	background: rgba(0, 0, 0, 0.5);
	color: white;
	border: none;
	padding: 15px;
	cursor: pointer;
	z-index: 10;
	font-size: 1.5rem;
	transition: background 0.3s;
}
.slide-nav:hover {
	background: rgba(0, 0, 0, 0.8);
}
.slide-nav.prev {
	left: 0;
}
.slide-nav.next {
	right: 0;
}

.slide-indicators {
	position: absolute;
	bottom: 15px;
	left: 50%;
	transform: translateX(-50%);
	display: flex;
	gap: 8px;
	z-index: 10;
}
.slide-dot {
	width: 10px;
	height: 10px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.3);
	cursor: pointer;
	transition: 0.3s;
}
.slide-dot.active {
	background: var(--accent);
	transform: scale(1.2);
}

/* Modal Body */
.modal-body {
	padding: 30px;
}
.modal-close {
	position: absolute;
	top: 15px;
	right: 15px;
	width: 35px;
	height: 35px;
	background: rgba(0, 0, 0, 0.5);
	border-radius: 50%;
	border: 1px solid rgba(255, 255, 255, 0.1);
	color: white;
	font-size: 1.2rem;
	cursor: pointer;
	z-index: 20;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: 0.3s;
}
.modal-close:hover {
	background: var(--accent);
	border-color: var(--accent);
}

.modal-meta {
	font-family: monospace;
	color: var(--accent);
	margin-bottom: 15px;
	font-size: 0.9rem;
}
#modal-title {
	font-size: 1.8rem;
	margin-bottom: 5px;
	line-height: 1.2;
}
#modal-subtitle {
	font-size: 1.1rem;
	color: var(--text-muted);
	margin-bottom: 15px;
	font-weight: 400;
}
#modal-desc {
	color: var(--text-main);
	margin-bottom: 25px;
	line-height: 1.6;
}
