/* --- VARIABLES (Thème Sombre par défaut) --- */
:root {
  --bg-app: #050505;
  --bg-card: #141414;
  --bg-card-hover: #1f1f1f;
  --border-card: rgba(255, 255, 255, 0.08);

  /* Textes */
  --text-primary: #ffffff;
  --text-secondary: #a1a1aa;

  /* Navigation & Contact (C'est ici qu'on corrige !) */
  --nav-bg: rgba(5, 5, 5, 0.7);
  --contact-bg: linear-gradient(135deg, #141414, #0a0a0a);

  /* Accents */
  --accent-primary: #3b82f6;
  --shadow-card: 0 20px 40px rgba(0, 0, 0, 0.4);

  --font-main: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    sans-serif;
  --radius-card: 24px;
  --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* --- THEME CLAIR (Surcharge les variables) --- */
body.light-mode {
  --bg-app: #f0f2f5; /* Fond gris très clair */
  --bg-card: #ffffff; /* Cartes blanches */
  --bg-card-hover: #f8fafc;
  --border-card: rgba(0, 0, 0, 0.08);

  /* Textes en sombre pour le fond clair */
  --text-primary: #18181b;
  --text-secondary: #52525b;

  /* Navigation & Contact CLAIRS */
  --nav-bg: rgba(255, 255, 255, 0.85); /* Blanc transparent */
  --contact-bg: linear-gradient(
    135deg,
    #ffffff,
    #e4e4e7
  ); /* Dégradé blanc/gris */

  --shadow-card: 0 10px 25px rgba(0, 0, 0, 0.05);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg-app);
  color: var(--text-primary);
  font-family: var(--font-main);
  line-height: 1.6;
  overflow-x: hidden;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* --- HEADER / NAV (CORRIGÉ) --- */
.header-nav {
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 1000;
  /* Utilise la variable maintenant ! */
  background: var(--nav-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-card);
  transition: background 0.3s ease, border-color 0.3s ease;
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 24px;
}

.logo {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.05em;
  color: var(--text-primary);
}

.header-nav nav ul {
  display: flex;
  gap: 30px;
  list-style: none;
}

.header-nav nav a {
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  transition: var(--transition);
}

.header-nav nav a:hover {
  color: var(--text-primary);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 15px;
}

/* Bouton Dark Mode */
.theme-btn {
  background: transparent;
  border: 1px solid var(--border-card);
  color: var(--text-primary);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  font-size: 1.1rem;
}
.theme-btn:hover {
  background: var(--bg-card-hover);
}

.btn-contact {
  background: var(--text-primary); /* S'adapte : Blanc en dark, Noir en light */
  color: var(--bg-app); /* S'adapte : Noir en dark, Blanc en light */
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 600;
  transition: var(--transition);
  text-decoration: none;
}
.btn-contact:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

/* --- GRID LAYOUT --- */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  max-width: 1200px;
  margin: 120px auto 40px;
  padding: 0 24px;
}
.col-span-2 {
  grid-column: span 2;
}
.col-span-3 {
  grid-column: span 3;
}

/* Responsive */
@media (max-width: 1024px) {
  .bento-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .col-span-3 {
    grid-column: span 2;
  }
  .header-nav nav {
    display: none;
  }
}
@media (max-width: 768px) {
  .bento-grid {
    grid-template-columns: 1fr;
  }
  .col-span-2,
  .col-span-3 {
    grid-column: span 1;
  }
}

/* --- CARD GENERIC --- */
.card {
  background-color: var(--bg-card);
  border-radius: var(--radius-card);
  padding: 32px;
  border: 1px solid var(--border-card);
  position: relative;
  overflow: hidden;
  transition: var(--transition);
  box-shadow: var(--shadow-card);
}
.clickable {
  cursor: pointer;
}
.clickable:hover {
  background-color: var(--bg-card-hover);
  border-color: rgba(120, 120, 120, 0.2);
  transform: translateY(-4px);
}

/* --- TEXT UTILS --- */
h1 {
  font-size: 3rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 10px;
  color: var(--text-primary);
}
h2 {
  font-size: 1.8rem;
  font-weight: 600;
  margin-bottom: 20px;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}
h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 15px;
  color: var(--text-primary);
}
h4 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-primary);
}
p {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.text-gradient {
  background: linear-gradient(to right, #60a5fa, #a78bfa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* --- HERO SECTION --- */
.hero-card {
  display: flex;
  align-items: center;
  /* Fond subtil qui marche dans les deux modes grâce à la transparence */
  background: radial-gradient(
      circle at top right,
      rgba(59, 130, 246, 0.1),
      transparent 40%
    ),
    var(--bg-card);
}
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(48, 209, 88, 0.15);
  color: #30d158;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 20px;
}
.dot {
  width: 8px;
  height: 8px;
  background: currentColor;
  border-radius: 50%;
  box-shadow: 0 0 8px currentColor;
}
.hero-actions {
  display: flex;
  gap: 15px;
  margin-top: 10px;
}

/* Boutons */
.btn-primary {
  background: var(--accent-primary);
  color: white !important;
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition);
  border: 1px solid var(--accent-primary);
}
.btn-primary:hover {
  filter: brightness(1.1);
}

.btn-secondary {
  background: rgba(125, 125, 125, 0.1);
  color: var(--text-primary);
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition);
}
.btn-secondary:hover {
  background: rgba(125, 125, 125, 0.2);
}

.btn-outline {
  border: 1px solid var(--border-card);
  color: var(--text-primary);
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition);
}
.btn-outline:hover {
  border-color: var(--text-primary);
  background: var(--bg-card-hover);
}
.large {
  width: fit-content;
}

/* --- STATS CARD --- */
.stat-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 20px;
  align-items: center;
  text-align: center;
}
.stat-number {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
}
.stat-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-transform: uppercase;
}

/* --- SKILLS SECTION --- */
.skills-wrapper {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 30px;
}
.skill-category h4 {
  border-bottom: 1px solid var(--border-card);
  padding-bottom: 5px;
  color: var(--text-secondary);
}
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.tags span {
  background: var(--bg-card-hover); /* S'adapte auto */
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 0.9rem;
  color: var(--text-primary);
  border: 1px solid var(--border-card);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* --- PROJETS (IMPORTANT : TEXTE BLANC FORCÉ) --- */
.section-title {
  margin-top: 40px;
  margin-bottom: 10px;
}
.project-card {
  height: 320px;
  position: relative;
  padding: 0;
}
.project-content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  top: 0;
  padding: 30px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
/* FORCE LE BLANC SUR LES IMAGES MÊME EN MODE CLAIR */
.project-content h4,
.project-content p,
.project-content i {
  color: #ffffff !important;
}
.project-top {
  display: flex;
  justify-content: space-between;
}
.tag {
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  color: white !important;
  padding: 4px 12px;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.2);
}
.project-bottom p {
  opacity: 0.9;
  font-size: 0.95rem;
  margin-bottom: 0;
}

/* --- TIMELINE --- */
.timeline-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.timeline-item {
  display: flex;
  gap: 20px;
  border-left: 2px solid var(--border-card);
  padding-left: 20px;
  margin-left: 10px;
  position: relative;
}
.timeline-item::before {
  content: "";
  width: 10px;
  height: 10px;
  background: var(--accent-primary);
  border-radius: 50%;
  position: absolute;
  left: -6px;
  top: 5px;
  /* Anneau pour détacher le point du fond */
  box-shadow: 0 0 0 4px var(--bg-card);
}
.tl-date {
  min-width: 100px;
  font-size: 0.85rem;
  color: var(--text-secondary);
}
.tl-content strong {
  display: block;
  color: var(--text-primary);
}
.tl-content span {
  color: var(--accent-primary);
  font-size: 0.9rem;
}

/* --- CERTIFS --- */
.cert-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 15px;
}
.cert-list li {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 10px;
  border-radius: 12px;
  transition: var(--transition);
}
.cert-list li:hover {
  background: var(--bg-card-hover);
}
.cert-icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  background: var(--bg-card-hover);
}
.box-blue {
  color: #60a5fa;
}
.box-purple {
  color: #c084fc;
}

/* --- CONTACT (CORRIGÉ) --- */
.contact-card {
  /* Utilise la variable maintenant ! */
  background: var(--contact-bg);
  text-align: center;
}
.contact-card h3 {
  color: var(--text-primary);
} /* Force la couleur du texte */
.contact-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 0;
}
.contact-buttons {
  display: flex;
  gap: 15px;
  margin-top: 30px;
  flex-wrap: wrap;
  justify-content: center;
}

/* --- FOOTER --- */
footer {
  text-align: center;
  padding: 60px 0;
  color: var(--text-secondary);
  font-size: 0.85rem;
  border-top: 1px solid var(--border-card);
  margin-top: 40px;
}
