/* =========================================
   VARIABLES & RESET
========================================= */
:root {
  --bg-color: #0f1016;
  --panel-bg: rgba(30, 30, 36, 0.6);
  --text-main: #f3f4f6;
  --text-muted: #a1a1aa;
  --accent: #8b5cf6;
  --accent-glow: rgba(139, 92, 246, 0.4);
  --accent-hover: #a78bfa;
  --radius: 16px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', system-ui, sans-serif;
  background-color: var(--bg-color); /* Couleur de fond au cas où l'image charge lentement */

  background-image: url('./images/25.png');
  background-size: cover; /* Pour que l'image prenne tout l'écran sans se déformer */
  background-position: center; /* Pour centrer l'image */
  background-repeat: no-repeat; /* Pour éviter que l'image ne se répète */
  background-attachment: fixed; /* Pour que l'image reste fixe quand on scroll */
  
  color: var(--text-main);
  line-height: 1.6;
  overflow-x: hidden;
  scroll-behavior: smooth;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--text-main);
}

/* =========================================
   NAVIGATION GLOBALE (HEADER)
========================================= */
header {
  position: sticky;
  top: 0;
  z-index: 900;
  background: rgba(15, 16, 22, 0.8);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding: 1.5rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

header .logo-text {
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--text-main);
}

.hamburger {
  display: none;
  flex-direction: column;
  cursor: pointer;
  gap: 5px;
  z-index: 1000;
}

.hamburger span {
  width: 25px;
  height: 2px;
  background-color: var(--text-main);
  transition: var(--transition);
  border-radius: 2px;
}

nav.main-nav {
  display: flex;
  gap: 2rem;
}

nav.main-nav a {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.95rem;
  position: relative;
}

nav.main-nav a:hover,
nav.main-nav a.active {
  color: var(--text-main);
}

nav.main-nav a::after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: -4px;
  left: 0;
  background-color: var(--accent);
  transition: var(--transition);
}

nav.main-nav a:hover::after,
nav.main-nav a.active::after {
  width: 100%;
}

/* =========================================
   MISE EN PAGE PRINCIPALE & TYPOGRAPHIE
========================================= */
main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 4rem 2rem 6rem;
  min-height: calc(100vh - 150px);
}

h1 {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 800;
  letter-spacing: -1px;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, #fff, var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.1;
}

h2 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 2rem;
  display: inline-block;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.subtitle {
  color: var(--text-muted);
  font-size: 1.15rem;
  max-width: 700px;
  margin-bottom: 3rem;
}

/* Menu de filtrage interne (Projets, GEII) */
.filter-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-bottom: 3rem;
  padding: 0.8rem;
  background: var(--panel-bg);
  backdrop-filter: blur(10px);
  border-radius: 50px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  position: sticky;
  top: 80px;
  z-index: 100;
}

.filter-nav a {
  padding: 0.5rem 1.2rem;
  border-radius: 99px;
  font-size: 0.9rem;
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.03);
}

.filter-nav a:hover {
  background: var(--accent);
  box-shadow: 0 0 15px var(--accent-glow);
}

/* =========================================
   BOUTONS
========================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.8rem 1.8rem;
  border-radius: 99px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  border: none;
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 15px var(--accent-glow);
}

.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px var(--accent-glow);
  color: #fff;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-2px);
}

/* =========================================
   COMPOSANTS : CARTES (Projets, Parcours)
========================================= */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 2rem;
  margin-bottom: 5rem;
}

.card {
  background: var(--panel-bg);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius);
  padding: 2rem;
  display: flex;
  flex-direction: column;
  transition: var(--transition);
  backdrop-filter: blur(10px);
}

.card:hover {
  transform: translateY(-8px);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.4);
  border-color: rgba(139, 92, 246, 0.4);
}

.card h3 {
  font-size: 1.3rem;
  margin-bottom: 1rem;
}

.card .meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.card .tag {
  font-size: 0.75rem;
  color: var(--accent);
  background: rgba(139, 92, 246, 0.1);
  padding: 0.3rem 0.8rem;
  border-radius: 6px;
  font-weight: 600;
}

.card p {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 1rem;
}

.card ul {
  margin-left: 1.5rem;
  margin-bottom: 1.5rem;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.card-assets {
  margin-top: auto;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.card-image {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.pdf-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--accent);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
}

/* =========================================
   COMPOSANTS : TIMELINE (Parcours)
========================================= */
.timeline-container {
  position: relative;
  max-width: 900px;
  margin: 0 auto;
}

.timeline-line {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  background: linear-gradient(180deg, transparent, var(--accent) 5%, var(--accent) 95%, transparent);
  transform: translateX(-50%);
}

.timeline-item {
  position: relative;
  width: 50%;
  padding: 2rem 3rem;
}

.timeline-item:nth-child(odd) { left: 0; text-align: right; }
.timeline-item:nth-child(even) { left: 50%; text-align: left; }

.timeline-dot {
  width: 20px;
  height: 20px;
  background: var(--bg-color);
  border: 4px solid var(--accent);
  border-radius: 50%;
  position: absolute;
  top: 2.5rem;
  box-shadow: 0 0 15px var(--accent-glow);
  z-index: 2;
}

.timeline-item:nth-child(odd) .timeline-dot { right: -10px; }
.timeline-item:nth-child(even) .timeline-dot { left: -10px; }

/* =========================================
   COMPOSANTS : CARROUSEL HORIZONTAL (Loisirs)
========================================= */
.gallery-scroll {
  display: flex;
  gap: 1.5rem;
  overflow-x: auto;
  padding-bottom: 1.5rem;
  scroll-snap-type: x mandatory;
}

.gallery-scroll::-webkit-scrollbar { height: 8px; }
.gallery-scroll::-webkit-scrollbar-thumb {
  background: rgba(139, 92, 246, 0.5);
  border-radius: 10px;
}
.gallery-scroll::-webkit-scrollbar-track { background: rgba(255, 255, 255, 0.05); }

.gallery-item {
  flex: 0 0 320px;
  height: 220px;
  scroll-snap-align: center;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.gallery-item:hover img {
  transform: scale(1.08);
}

/* =========================================
   MODAL / POPUP
========================================= */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(5px);
  z-index: 2000;
  justify-content: center;
  align-items: center;
  padding: 1rem;
  opacity: 0;
  transition: opacity var(--transition);
}

.modal-overlay.active {
  display: flex;
  opacity: 1;
}

.modal-content {
  width: 100%;
  max-width: 1000px;
  height: 90vh;
  background: var(--bg-color);
  border-radius: var(--radius);
  border: 1px solid rgba(139, 92, 246, 0.3);
  box-shadow: 0 0 40px rgba(0,0,0,0.5);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(20px);
  transition: transform var(--transition);
}

.modal-overlay.active .modal-content {
  transform: translateY(0);
}

.modal-header {
  padding: 1rem 1.5rem;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.close-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  transition: color 0.2s;
}

.close-btn:hover { color: #ef4444; }

iframe.modal-frame {
  flex-grow: 1;
  width: 100%;
  border: none;
}

/* =========================================
   FOOTER
========================================= */
footer {
  text-align: center;
  padding: 3rem 2rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* =========================================
   RESPONSIVE DESIGN (Mobiles & Tablettes)
========================================= */
@media (max-width: 768px) {
  .hamburger { display: flex; }
  
  nav.main-nav {
    position: fixed;
    top: 70px;
    right: -100%;
    width: 100%;
    height: calc(100vh - 70px);
    background: var(--bg-color);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    transition: 0.4s ease-in-out;
  }
  
  nav.main-nav.active { right: 0; }
  nav.main-nav a { font-size: 1.5rem; }

  .hamburger.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .hamburger.active span:nth-child(2) { opacity: 0; }
  .hamburger.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  /* Timeline mobile */
  .timeline-line { left: 20px; transform: none; }
  .timeline-item { width: 100%; padding: 0 0 3rem 3.5rem; }
  .timeline-item:nth-child(odd), .timeline-item:nth-child(even) { left: 0; text-align: left; }
  .timeline-item:nth-child(odd) .timeline-dot, .timeline-item:nth-child(even) .timeline-dot { left: 10px; right: auto; }
}