/* Reset */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Variables */
:root {
  --bg-dark: #111316;
  --bg-light: #1e2126;
  --text-main: #eceff4;
  --accent: #61dafb;
  --accent-dark: #21a1f1;
  --card-bg: #23262b;
  --font-main: "Montserrat", sans-serif;
}

body {
  font-family: var(--font-main);
  line-height: 1.6;
  background: var(--bg-dark);
  color: var(--text-main);
}

/* Navbar */
.navbar {
  position: sticky;
  top: 0;
  background: var(--bg-dark);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  z-index: 1000;
}

.navbar .logo {
  font-weight: 700;
}

.navbar ul {
  list-style: none;
  display: flex;
  gap: 1.5rem;
}

.navbar a {
  color: var(--text-main);
  text-decoration: none;
  transition: color 0.3s;
}

.navbar a:hover {
  color: var(--accent);
}

/* Hero */
#hero {
  min-height: 75vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: linear-gradient(135deg, var(--bg-light) 0%, #2d3035 100%);
  padding: 2rem;
}

.hero-inner h2 {
  font-size: 2.8rem;
  margin-bottom: 1rem;
}

.hero-inner p {
  margin-bottom: 2rem;
  font-weight: 300;
}

.btn {
  display: inline-block;
  background: var(--accent);
  color: var(--bg-dark);
  padding: 0.8rem 1.6rem;
  border-radius: 50px;
  text-decoration: none;
  font-weight: 600;
  transition: background 0.3s;
}

.btn:hover {
  background: var(--accent-dark);
}

/* Sections */
.section {
  padding: 4rem 0;
}

.container {
  width: min(90%, 1100px);
  margin: 0 auto;
}

.section h2 {
  font-size: 2rem;
  margin-bottom: 2rem;
  text-align: center;
}

/* Compétences */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.card {
  background: var(--card-bg);
  padding: 2rem;
  border-radius: 8px;
  transition: transform 0.3s, box-shadow 0.3s;
}

.card:hover {
  transform: translateY(-6px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4);
}

.card h3 {
  margin-bottom: 0.8rem;
}

/* Timeline */
.timeline {
  position: relative;
  margin-top: 3rem;
}

.timeline::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 4px;
  background: var(--accent);
  transform: translateX(-50%);
}

.timeline-item {
  width: 50%;
  padding: 2rem 2rem 2rem 0;
  position: relative;
}

.timeline-item.right {
  margin-left: 50%;
  padding: 2rem 0 2rem 2rem;
}

.timeline-item .content {
  background: var(--card-bg);
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.timeline-item::before {
  content: "";
  position: absolute;
  top: 2rem;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--bg-dark);
  border: 4px solid var(--accent);
}

.timeline-item.left::before {
  right: -9px;
}

.timeline-item.right::before {
  left: -9px;
}

/* Contact */
.contact-list {
  list-style: none;
  max-width: 400px;
  margin: 0 auto;
  text-align: center;
}

.contact-list li {
  margin: 0.5rem 0;
}

.contact-list a {
  color: var(--accent);
  text-decoration: none;
}

.contact-list a:hover {
  text-decoration: underline;
}

/* Footer */
footer {
  text-align: center;
  padding: 2rem 0;
  background: var(--bg-light);
  color: var(--text-main);
}

/* Responsive */
@media (max-width: 768px) {
  .timeline::before {
    left: 8px;
  }

  .timeline-item,
  .timeline-item.right {
    width: 100%;
    margin-left: 0;
    padding: 2rem 0 2rem 2rem;
  }

  .timeline-item::before {
    left: -9px;
  }

  .hero-inner h2 {
  font-size: 2rem;
  }
}
/* Timeline Formations */
.edu-timeline {
  position: relative;
  margin-top: 3rem;
  padding-left: 2rem;
}

.edu-timeline::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 1rem;
  width: 2px;
  background: linear-gradient(to bottom, var(--accent), transparent);
}

.edu-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 2rem;
  margin-bottom: 2rem;
  opacity: 0;
  animation: fadeInUp 0.6s ease forwards;
}

.edu-item:nth-child(2) { animation-delay: 0.1s; }
.edu-item:nth-child(3) { animation-delay: 0.2s; }

.edu-year {
  background: var(--accent);
  color: var(--bg-dark);
  font-weight: 700;
  font-size: 1rem;
  border-radius: 50%;
  width: 3rem;
  height: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.edu-year::after {
  content: "";
  position: absolute;
  left: -1rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1rem;
  height: 2px;
  background: var(--accent);
}

.edu-info {
  background: var(--card-bg);
  padding: 1.5rem 2rem;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Animation */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsive */
@media (max-width: 600px) {
  .edu-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
  .edu-year::after { display: none; }
  .edu-timeline::before { left: 0.5rem; }
}

/* portfolio*/
/* Lien actif dans la nav */
.navbar a.active {
  color: var(--accent);
}

/* Grille des projets */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}

.project-card {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.project-card img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.4s ease;
}

.project-card:hover img {
  transform: scale(1.08);
}

.project-info {
  position: absolute;
  inset: 0;
  background: rgba(35, 38, 43, 0.8);
  color: var(--text-main);
  opacity: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 1.5rem;
  transition: opacity 0.3s ease;
}

.project-card:hover .project-info {
  opacity: 1;
}

.project-info h3 {
  margin-bottom: 0.5rem;
}
