:root {
  --bg: #ffffff;             /* Fond global blanc */
  --fg: #1e1e1e;             /* Texte principal noir/gris foncé */
  --accent: #f80040;         /* Rouge principal (extrait du CV) */
  --accent-dark: #660140;    /* Rouge foncé pour les survols, boutons */
  --card-bg: #f5f5f5;        /* Fond des sections ou encadrés */
  --shadow: rgba(0, 0, 0, 0.05); /* Légère ombre pour les cartes */
}

body.dark-theme {
  --bg: #0d0d0d;
  --fg: #f1f1f1;
  --accent: #00ffd5;
  --accent-dark: #00c2a2;
  --card-bg: #1a1a1a;
  --shadow: rgba(0, 0, 0, 0.3);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Outfit', sans-serif;
  background-color: var(--bg);
  color: var(--fg);
  line-height: 1.6;
}

.container {
  max-width: 1100px;
  margin: auto;
  padding: 2rem;
}

.navbar {
  background: var(--card-bg);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.navbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent);
}

.logo span {
  color: var(--fg);
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 1.2rem;
}

.nav-links a {
  color: var(--fg);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.3s;
}

.nav-links a:hover {
  color: var(--accent);
}

.hero {
  background: url('../assets/images/bg.jpg') center/cover no-repeat;
  position: relative;
  height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

#matrix-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  display: block;
  background-color: var(--bg);
}

.hero .overlay {
  background-color: rgba(0, 0, 0, 0.2);
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
}

.hero h1 {
  font-size: 3rem;
  margin-bottom: 0.5rem;
}

.hero p {
  font-size: 1.2rem;
  margin-bottom: 1.5rem;
}

.btn {
  padding: 0.7rem 1.5rem;
  background: var(--accent);
  color: black;
  border: none;
  font-weight: bold;
  border-radius: 30px;
  text-decoration: none;
  transition: background 0.3s;
}

.btn:hover {
  background: var(--accent-dark);
}

.section {
  padding: 4rem 2rem;
}

.section h2 {
  text-align: center;
  margin-bottom: 2rem;
  font-size: 2rem;
  color: var(--accent);
}

.section.dark {
  background-color: #121212;
}

.card {
  background: var(--card-bg);
  padding: 1.5rem;
  border-radius: 12px;
  margin-bottom: 2rem;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
}

.timeline .event {
  margin-bottom: 2rem;
}

.timeline .event h3 {
  color: var(--accent);
}

.timeline .event span {
  font-size: 0.9rem;
  opacity: 0.7;
}

.about-details {
  list-style: none;
  margin-top: 1rem;
}

.about-details li {
  margin: 0.3rem 0;
}

.socials {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  margin-top: 1rem;
}

footer {
  text-align: center;
  padding: 2rem 1rem;
  background: var(--card-bg);
  color: #999;
}

#theme-toggle {
  position: absolute;
  top: 1rem;
  right: 1.5rem;
  z-index: 1000;
  background: var(--accent);
  color: black;
  border: none;
  border-radius: 30px;
  padding: 0.5rem 1rem;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.3s;
}

#theme-toggle:hover {
  background: var(--accent-dark);
}

.card, .section {
  box-shadow: 0 4px 20px var(--shadow);
  border-radius: 12px;
}

#menu-toggle {
  display: none; 
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  width: 30px;
  height: 20px;
  background: transparent;
  border: none;
  cursor: pointer;
  z-index: 1001;
}

.bar {
  width: 30px;
  height: 4px;
  background-color: var(--fg); 
  border-radius: 2px;
  transition: all 0.3s ease-in-out;
}

.navbar.open #menu-toggle .bar:nth-child(1) {
  transform: rotate(45deg); 
  position: relative;
  top: 7px;
}

.navbar.open #menu-toggle .bar:nth-child(2) {
  opacity: 0;
}

.navbar.open #menu-toggle .bar:nth-child(3) {
  transform: rotate(-45deg); 
  position: relative;
  top: -7px;
}

#menu-toggle:hover .bar {
  background-color: var(--accent); 
}

@media (max-width: 768px) {
  .navbar {
    padding: 0.5rem 0;
  }

  .navbar .container {
    flex-direction: column;
    align-items: flex-start;
  }

  .logo {
    font-size: 1.3rem;
    margin-bottom: 1rem;
  }

  .nav-links {
    display: none;
    width: 100%;
    flex-direction: column;
    text-align: center;
    gap: 1rem;
  }

  .nav-links a {
    padding: 1rem;
    width: 100%;
    font-size: 1rem;
  }

  .navbar.open .nav-links {
    display: block;
  }

  #menu-toggle {
    display: flex;
  }
}

@media (max-width: 480px) {
  .hero h1 {
    font-size: 1.8rem;
  }

  .hero p {
    font-size: 1rem;
  }

  .hero-content {
    padding: 0 1rem;
  }

  .btn {
    padding: 0.5rem 1rem;
    font-size: 1rem;
  }

  .navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    transition: top 0.3s ease-in-out;
  }

  .navbar .container {
    flex-direction: column;
    padding: 0.5rem;
  }

  .nav-links a {
    padding: 1rem;
    width: 100%;
  }
}
