/* ==== VARIABLES ==== */
:root {
  /* Couleurs */
  --color-primary: #2563eb;
  --color-primary-dark: #1d4ed8;
  --color-secondary: #10b981;
  --color-accent: #f59e0b;

  --color-bg: #111827; /* Fond principal sombre */
  --color-card-bg: rgba(
    17,
    24,
    39,
    0.7
  ); /* Fond semi-transparent pour Glassmorphism */
  --color-text: #f8fafc;
  --color-text-muted: #9ca3af;
  --color-border: rgba(255, 255, 255, 0.1);

  /* Typographie */
  --font-main: "Lato", "Segoe UI", sans-serif;

  /* Espacements */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2rem;
  --space-xl: 4rem;

  /* Header */
  --header-height: 70px;

  /* UI */
  --radius: 1rem;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1),
    0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-hover: 0 20px 25px -5px rgba(0, 0, 0, 0.1),
    0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --transition: all 0.3s ease;
}

/* ==== RESET & BASE ==== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-main);
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  overflow-x: hidden; /* Évite le scroll horizontal accidentel */
}

img,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

h1,
h2,
h3 {
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: var(--space-sm);
}
h1 {
  font-size: clamp(2rem, 5vw, 3rem);
}
h2 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
}
h3 {
  font-size: 1.25rem;
}

a {
  text-decoration: none;
  color: inherit;
}
ul {
  list-style: none;
}

/* ==== UTILITAIRES ==== */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-sm);
}

.accent {
  color: var(--color-secondary);
}

.section__title {
  text-align: center;
  color: var(--color-secondary);
  margin-bottom: var(--space-sm);
}

.section__subtitle {
  text-align: center;
  color: var(--color-text-muted);
  max-width: 600px;
  margin: 0 auto var(--space-lg);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ==== BOUTONS ==== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  font-weight: 600;
  transition: var(--transition);
  border: 2px solid transparent;
  cursor: pointer;
}

.btn--primary {
  background: var(--color-primary);
  color: white;
}
.btn--primary:hover {
  background: var(--color-primary-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.btn--secondary {
  background: transparent;
  border-color: var(--color-secondary);
  color: var(--color-secondary);
}
.btn--secondary:hover {
  background: var(--color-secondary);
  color: var(--color-bg);
}

.btn--outline {
  border-color: var(--color-text-muted);
  color: var(--color-text-muted);
}
.btn--outline:hover {
  border-color: var(--color-text);
  color: var(--color-text);
}

.btn--full {
  width: 100%;
}

/* ==== HEADER ==== */
.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: rgba(17, 24, 39, 0.9); /* Semi-transparent */
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--color-border);
  z-index: 1000;
}

.header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  text-transform: uppercase;
}
.logo span {
  color: var(--color-secondary);
}

.nav__list {
  display: flex;
  gap: var(--space-lg);
}
.nav__link {
  font-weight: 500;
  position: relative;
  padding: 0.5rem 0;
}
.nav__link::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--color-secondary);
  transition: var(--transition);
}
.nav__link:hover::after {
  width: 100%;
}

/* Burger Menu Mobile */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  flex-direction: column;
  gap: 5px;
}
.menu-toggle span {
  width: 25px;
  height: 3px;
  background: white;
  border-radius: 2px;
  transition: 0.3s;
}

/* ==== HERO SECTION ==== */
.hero {
  padding-top: calc(var(--header-height) + var(--space-xl));
  padding-bottom: var(--space-xl);
  background: radial-gradient(
    circle at top right,
    rgba(37, 99, 235, 0.1),
    transparent 40%
  );
}

.hero__content {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.hero__presentation {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
  align-items: center;
}

picture {
  display: block;
  width: 100%;
  height: 100%;
}

.hero__image img {
  border-radius: var(--radius);
  border: 2px solid var(--color-primary);
  box-shadow: var(--shadow);
}

.hero__caption {
  margin-top: 1rem;
  font-weight: 600;
  text-align: center;
}

.hero__text {
  text-align: center;
  max-width: 600px;
}
.hero__text p {
  font-size: 1.1rem;
  margin-bottom: var(--space-md);
}
.hero__cta-mobile {
  margin-top: var(--space-md);
}

/* ==== CARDS (Skills, Services, Projects) ==== */
.skill-card,
.service-card,
.project-card {
  background: var(--color-card-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: var(--space-lg);
  transition: var(--transition);
}

.skill-card:hover,
.service-card:hover,
.project-card:hover {
  transform: translateY(-5px);
  border-color: var(--color-secondary);
  box-shadow: var(--shadow-hover);
}

/* Section Skills */
.skills {
  padding: var(--space-xl) 0;
}
.skills__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--space-md);
}
.skill-card {
  text-align: center;
}
.skill-card__icon img {
  width: 60px;
  margin: 0 auto var(--space-sm);
}

/* Section Projects (Masonry) */
.projects {
  padding: var(--space-xl) 0;
}
.projects__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 3rem;
  align-items: stretch; /* Force toutes les cartes à la même hauteur */
}
.project-card {
  background: var(--color-card-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: var(--transition);
  box-shadow: var(--shadow);

  display: flex;
  flex-direction: column;
  height: 100%;
}

.project-card__image {
  height: 240px; /* Hauteur fixe pour l'uniformité */
  width: 100%;
  border-bottom: 1px solid var(--color-border);
}

.project-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover; /* Recadre l'image sans la déformer */
  object-position: top center;
  transition: transform 0.5s ease;
}
.project-card:hover .project-card__image img {
  transform: scale(1.05);
}
.project-card__content {
  padding: 2rem; /* Plus d'espace interne (Aération) */
  display: flex;
  flex-direction: column;
  flex-grow: 1; /* Prend tout l'espace restant sous l'image */
  text-align: left; /* Plus lisible pour des descriptions */
}

.project-card__title {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  color: var(--color-text);
}

.project-card__description {
  color: var(--color-text-muted);
  font-size: 1rem;
  line-height: 1.7; /* interlignage aéré */
  margin-bottom: 2rem; /* Espace avant les boutons */
}

.project-card__actions {
  margin-top: auto; /* POUSSE les boutons tout en bas */
  display: flex;
  gap: 1rem; /* Espace entre les deux boutons */
}

.project-card__actions .btn {
  flex: 1; /* Les boutons prennent la même largeur */
  padding: 10px 15px; /* Ajustement taille */
  font-size: 0.9rem;
}
.projects__more {
  text-align: center;
  margin-top: var(--space-lg);
}

/* Section Services */
.services {
  padding: var(--space-xl) 0;
}
.services__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-md);
}
.service-card {
  text-align: center;
  display: flex;
  flex-direction: column;
}
.service-card__description {
  flex-grow: 1;
  margin-bottom: var(--space-md);
}

/* Section Contact */
.contact {
  padding: var(--space-xl) 0;
}
.contact__methods {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}
.contact__link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 1.5rem;
  background: var(--color-card-bg);
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
  transition: var(--transition);
}
.contact__link:hover {
  background: var(--color-primary);
  border-color: var(--color-primary);
}

.contact-form {
  max-width: 600px;
  margin: 0 auto;
  padding: var(--space-lg);
  background: var(--color-card-bg);
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
}
.form-group {
  margin-bottom: var(--space-sm);
}
.form-label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
}
.form-input,
.form-textarea {
  width: 100%;
  padding: 0.75rem;
  border-radius: 0.5rem;
  border: 1px solid var(--color-border);
  background: rgba(0, 0, 0, 0.2);
  color: white;
  font-family: inherit;
}
.form-input:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--color-primary);
}

/* Footer */
.footer {
  text-align: center;
  padding: var(--space-lg) 0;
  border-top: 1px solid var(--color-border);
  color: var(--color-text-muted);
}

/* ==== RESPONSIVE ==== */
@media (min-width: 768px) {
  .hero__presentation {
    flex-direction: row;
    text-align: left;
    justify-content: center;
  }
  .hero__text {
    text-align: left;
  }
  .hero__cta-mobile {
    display: none;
  }
  .header__cta {
    display: block;
  }
}

@media (max-width: 1024px) {
  .projects__grid {
    column-count: 2;
  }
}

@media (max-width: 768px) {
  .header__cta {
    display: none;
  }
  .menu-toggle {
    display: flex;
  }

  .nav {
    position: fixed;
    top: var(--header-height);
    left: 0;
    width: 100%;
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
    padding: var(--space-lg);
    transform: translateY(-150%);
    transition: var(--transition);
  }
  .nav.active {
    transform: translateY(0);
    box-shadow: var(--shadow-hover);
  }
  .nav__list {
    flex-direction: column;
    align-items: center;
    gap: var(--space-md);
  }

  /* Animation Burger */
  .menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }
  .menu-toggle.active span:nth-child(2) {
    opacity: 0;
  }
  .menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
  }

  .services__grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .projects__grid {
    column-count: 1;
  }
  .hero__title {
    font-size: 2rem;
  }
}

@media (max-width: 480px) {
  .project-card__actions {
    flex-direction: column;
  }
}

/* ==== ANIMATIONS JS ==== */
section,
.skill-card,
.project-card,
.service-card {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}
.fade-in-up {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  section,
  .card {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
