/* Reset & Variables */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
:root {
  --light-bg: #f5f7fa;
  --light-text: #1a1a1a;
  --dark-bg: #0e0e0e;
  --dark-text: #f0f0f0;
  --primary: #76c7c0;
  --primary-dark: #5ab0a8;
  --transition: 0.3s ease;
  --font: "Roboto", sans-serif;
}

html {
  scroll-behavior: smooth;
}

/* Mode clair / sombre */
body {
  font-family: var(--font);
  background: var(--light-bg);
  color: var(--light-text);
  transition: background var(--transition), color var(--transition);
}
body.dark {
  background: var(--dark-bg);
  color: var(--dark-text);
}

/* Particules */
#particles-js {
  position: fixed;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  z-index: -1;
}

/* Container */
.container {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
}

/* Header */
.header {
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 10;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0;
}
.logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
}
.nav-links {
  list-style: none;
  display: flex;
  gap: 1.5rem;
}
.nav-links a {
  text-decoration: none;
  color: inherit;
  font-weight: 500;
  position: relative;
  transition: color var(--transition);
}
.nav-links a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 0;
  height: 2px;
  background: var(--primary);
  transition: width var(--transition);
}
.nav-links a:hover::after,
.nav-links a.active::after {
  width: 100%;
}
.nav-links a:hover {
  color: var(--primary);
}
.nav-links a.active {
  color: var(--primary);
}

/* Burger */
.burger {
  display: none;
  flex-direction: column;
  cursor: pointer;
}
.burger span {
  width: 25px;
  height: 3px;
  background: currentColor;
  margin: 4px 0;
  transition: transform var(--transition);
}

/* Toggle theme */
#theme-toggle {
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  color: inherit;
  transition: transform var(--transition);
}
#theme-toggle:hover {
  transform: scale(1.1);
}

/* Hero */
.hero {
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding-top: 4rem;
}
.hero-content {
  max-width: 600px;
}
.hero-img {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  margin-bottom: 1rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  object-fit: cover;
}
h1 {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}
.hero-subtitle {
  font-size: 1.2rem;
  opacity: 0.85;
  margin-bottom: 0.5rem;
}
.hero-description {
  font-size: 1rem;
  opacity: 0.7;
  line-height: 1.6;
  margin-bottom: 1rem;
}
.hero-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}
.btn {
  display: inline-block;
  margin-top: 1rem;
  padding: 0.75rem 1.5rem;
  background: var(--primary);
  color: #fff;
  text-decoration: none;
  border-radius: 4px;
  transition: transform var(--transition), background var(--transition);
}
.btn:hover {
  transform: scale(1.05);
  background: var(--primary-dark);
}
.btn-sm {
  margin-top: 0.75rem;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
}

/* Sections */
.section {
  padding: 6rem 0;
}
.section h2 {
  text-align: center;
  font-size: 2rem;
  margin-bottom: 2.5rem;
  position: relative;
}
.section h2::after {
  content: '';
  display: block;
  width: 60px;
  height: 3px;
  background: var(--primary);
  margin: 0.5rem auto 0;
  border-radius: 2px;
}

/* Grid & Cards */
.grid {
  display: grid;
  gap: 2rem;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}
.card,
.proj-card {
  background: rgba(255, 255, 255, 0.9);
  padding: 1.5rem;
  border-radius: 12px;
  text-align: center;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  transition: transform var(--transition), box-shadow var(--transition);
}
body.dark .card,
body.dark .proj-card {
  background: rgba(30, 30, 30, 0.9);
}
.card:hover,
.proj-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}
.card i {
  color: var(--primary);
  margin-bottom: 0.5rem;
}
.card h3 {
  margin-top: 0.5rem;
}

/* Timeline */
.timeline ul {
  list-style: none;
  position: relative;
}
.timeline ul::before {
  content: "";
  position: absolute;
  left: 32px;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--primary);
}
.timeline li {
  position: relative;
  margin-bottom: 3rem;
  padding-left: 4rem;
}
.timeline li::before {
  content: '';
  position: absolute;
  left: 24px;
  top: 6px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--primary);
  border: 3px solid var(--light-bg);
}
body.dark .timeline li::before {
  border-color: var(--dark-bg);
}
.date {
  font-weight: 700;
  color: var(--primary);
  display: block;
  margin-bottom: 0.5rem;
}

/* Contact */
.contact-methods {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
}
.contact-methods a,
.contact-methods p {
  text-decoration: none;
  color: inherit;
  font-size: 1.1rem;
  transition: color var(--transition);
}
.contact-methods a:hover {
  color: var(--primary);
}

/* Diplôme Cards */
.diplome-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}
.diplome-card i {
  color: var(--primary);
}
.diplomes-grid {
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

/* Project images */
.proj-card img {
  border-radius: 8px 8px 0 0;
}
.proj-info {
  padding: 0.5rem 0;
}

/* Icon-based project header */
.proj-icon-header {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 140px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-radius: 8px 8px 0 0;
  margin: -1.5rem -1.5rem 0;
}
.proj-icon-header i {
  color: #fff;
}

/* Project tags */
.proj-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: center;
  margin-top: 0.5rem;
}
.tag {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  font-size: 0.75rem;
  font-weight: 500;
  background: rgba(118, 199, 192, 0.15);
  color: var(--primary-dark);
  border-radius: 12px;
}
body.dark .tag {
  background: rgba(118, 199, 192, 0.2);
  color: var(--primary);
}

/* GitHub button */
.btn-github {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.75rem;
  background: #333;
}
.btn-github:hover {
  background: #555;
}

/* Footer */
footer {
  padding: 2rem 0;
  text-align: center;
  border-top: 1px solid rgba(118, 199, 192, 0.2);
}
.footer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}
.footer-links {
  display: flex;
  gap: 1.5rem;
}
.footer-links a {
  color: inherit;
  font-size: 1.3rem;
  transition: color var(--transition), transform var(--transition);
}
.footer-links a:hover {
  color: var(--primary);
  transform: translateY(-2px);
}

/* Responsive */
@media (max-width: 768px) {
  .grid {
    grid-template-columns: 1fr;
  }
  h1 {
    font-size: 2rem;
  }
}
@media (max-width: 600px) {
  .burger {
    display: flex;
  }
  .nav-links {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--light-bg);
    flex-direction: column;
    width: 240px;
    padding: 1rem;
    border-radius: 0 0 0 12px;
    box-shadow: -4px 4px 15px rgba(0, 0, 0, 0.1);
    transform: translateX(100%);
    transition: transform var(--transition);
  }
  body.dark .nav-links {
    background: var(--dark-bg);
  }
  .nav-links.open {
    transform: translateX(0);
  }
  .nav-links a::after {
    display: none;
  }
  .hero-img {
    width: 120px;
    height: 120px;
  }
  .footer-content {
    padding: 0 1rem;
  }
}
.logo-img {
  height: 40px;
  width: auto;
  vertical-align: middle;
}
@media (max-width: 600px) {
  .logo-img {
    height: 32px;
  }
}
/* Progress Bar */
.progress-bar {
  width: 100%;
  height: 8px;
  background: rgba(0,0,0,0.1);
  border-radius: 4px;
  overflow: hidden;
  margin: 0.75rem 0;
}
.progress-fill {
  width: 0;
  height: 100%;
  background: var(--primary);
  transition: width 3.2s ease-in-out;
}
/* === PRELOADER === */
#preloader {
  position: fixed;
  inset: 0;                 /* top/right/bottom/left = 0 */
  background: var(--light-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.6s ease;
}
body.dark #preloader {
  background: var(--dark-bg);
}

/* Spinner simple */
.spinner {
  width: 48px;
  height: 48px;
  border: 5px solid rgba(0,0,0,0.1);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s infinite linear;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Quand on a fini, on ajoutera .loaded sur <body> pour cacher le preloader */
body.loaded #preloader {
  opacity: 0;
  pointer-events: none;
}
body.loaded #site-content {
  visibility: visible;
}
#site-content{
  visibility: hidden;
}
