/* =========================
   1) Variables CSS
   - Centralise couleurs/tailles pour ajuster le thème facilement
   ========================= */
:root {
  --max-width: 1100px;
  --radius: 14px;

  --bg: #0f1220;
  --surface: #171a2b;
  --surface-2: #1d2140;

  --text: #eef0ff;
  --muted: #b7bbdd;

  --accent: #8b5cf6;
  --border: rgba(255, 255, 255, 0.10);

  /* Hauteurs utiles pour le header fixe (évite que le contenu soit masqué) */
  --header-height: 64px; 
  --anchor-offset: 80px; 
}


/* =========================
   2) Reset minimal & base typographique
   ========================= */
* { box-sizing: border-box; }

html {
  scroll-behavior: smooth; /* navigation par ancres plus agréable */
  height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  height: 100%;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  line-height: 1.6;
  color: var(--text);

  /* Fond : 2 halos + couleur de base */
  background:
    radial-gradient(60% 40% at 20% 10%, rgba(139, 92, 246, 0.25), transparent),
    radial-gradient(50% 40% at 90% 20%, rgba(56, 189, 248, 0.18), transparent),
    var(--bg);
  background-repeat: no-repeat;
  background-attachment: fixed;
  background-size: cover;

  /* Header en fixed → on réserve l'espace en haut */
  padding-top: var(--header-height);
}

/* Liens : visibles mais sobres */
a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; }


/* =========================
   3) Layout global
   ========================= */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 24px;
}

/* Chaque section est un "chapitre" : aération + séparation discrète */
.section {
  padding: 56px 0;
  border-bottom: 1px solid var(--border);

  /* Evite que l'ancre soit cachée par le header fixe */
  scroll-margin-top: var(--anchor-offset);
}

.section h2 {
  margin: 0 0 18px;
  font-size: 1.6rem;
}

/* =========================
   4) Header / Navigation
   ========================= */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;

  z-index: 999;
  backdrop-filter: blur(10px);
  background: rgba(15, 18, 32, 0.75);
  border-bottom: 1px solid var(--border);
}

.nav {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 12px 24px;

  display: flex;
  align-items: center;
  gap: 16px;
}

/* Liens d'ancrage */
.nav__links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.nav__links a {
  padding: 8px 10px;
  border-radius: 10px;
}

.nav__links a:hover {
  background: rgba(255, 255, 255, 0.06);
  text-decoration: none;
}

/* Bouton hamburger caché par défaut */
.nav-toggle {
  display: none;
}

.nav-toggle-btn {
  display: none;
  cursor: pointer;
  flex-direction: column;
  gap: 6px;
  padding: 4px;
}

.nav-toggle-btn span {
  width: 24px;
  height: 2px;
  background: var(--text);
  transition: all 0.3s ease;
  border-radius: 2px;
}

/* =========================
   5) Composants réutilisables
   ========================= */

/* Cartes : bloc principal (parcours, compétences, etc.) */
.card {
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.25);

  /* Animations */
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 40px rgba(0,0,0,0.35);
}

.card__title { margin: 0 0 10px; }

/* Header de carte : logo à gauche, titre, badge à droite */
.card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.card__header h3 {
  margin: 0;
  flex: 1;
  min-width: 0; /* autorise le retour à la ligne proprement */
}

.card__footer {
  margin-top: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.proof-link {
  font-size: 0.85rem;
  color: var(--accent);
  text-decoration: none;
  white-space: nowrap;
}

.proof-link:hover {
  text-decoration: underline;
}

/* Badge (année, info courte) */
.badge {
  padding: 4px 10px;
  font-size: 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
  white-space: nowrap;
}

/* Grilles (compétences, cartes multiples, formations) */
.grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.grid--2 {
  grid-template-columns: repeat(2, 1fr);
}

/* Listes */
.list {
  margin: 10px 0 0;
  padding-left: 18px;
}

/* Tags (compétences)*/
.tags {
  list-style: none;
  padding: 0;
  margin: 10px 0 0;

  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tags li {
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.05);
  font-size: 0.92rem;
}

/* Boutons : primaire + ghost */
.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.btn {
  display: inline-block;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--accent);
  color: white;
  font-weight: 600;
}

.btn:hover {
  text-decoration: none;
  filter: brightness(1.05);
}

.btn--ghost {
  background: transparent;
}

/* =========================
   6) Hero (section profil)
   - 2 colonnes desktop : texte/infos | photo
   - 1 colonne mobile avec stack vertical
   ========================= */
.hero {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 32px;
  align-items: flex-start;
}

.hero__left {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.hero__text {
  flex: 1;
}

.hero h1 {
  margin: 0;
  font-size: 2.2rem;
  letter-spacing: 0.2px;
}

.subtitle {
  margin: 8px 0 14px;
  color: var(--muted);
}

/* =========================
   Photo (avatar) - Hero
   ========================= */
.hero__side {
  display: flex;
  justify-content: center;
}

.avatar {
  width: 160px;
  height: 160px;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.04);
  box-shadow: 0 10px 30px rgba(0,0,0,0.25);
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* léger "glow" au survol */
.avatar:hover {
  transform: translateY(-3px);
  transition: transform 0.2s ease;
}

/* =========================
   7) Icônes / logos
   - Taille fixée (px/rem) pour un rendu stable
   ========================= */
.edu-icon {
  width: 100px;
  height: 60px;
  object-fit: contain;
  flex: 0 0 auto;
  border-radius: 8px;
  background: rgba(255,255,255,0.04);
  padding: 6px;
}

/* =========================
   8) Contact (liste avec icônes)
   ========================= */
.contact-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.contact-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.contact-list .icon {
  width: 30px;
  height: 30px;
  object-fit: contain;
  flex-shrink: 0;
}

/* =========================
   9) Utilitaires
   - Petites classes pour éviter de dupliquer du CSS
   ========================= */
.muted { color: var(--muted); }
.small { font-size: 0.92rem; }

/* =========================
   10) Footer
   ========================= */
.footer {
  padding: 24px 0;
  text-align: center;
  border-bottom: none;
}

/* =========================
   11) Responsive (tablet 600-900px)
   ========================= */
@media (max-width: 900px) {
  /* Grilles : 2 colonnes → 1 colonne */
  .grid {
    grid-template-columns: repeat(2, 1fr);
  }

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

  /* Layout hero : stack vertical */
  .hero {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .hero__left {
    gap: 32px;
  }

  /* Photo centrée sur mobile */
  .hero__side {
    justify-content: center;
  }

  .avatar {
    width: 130px;
    height: 130px;
  }

  /* Icônes : réduites sur tablet */
  .edu-icon {
    width: 80px;
    height: 50px;
  }

  /* Navigation : compact */
  .nav__links {
    gap: 8px;
    font-size: 0.9rem;
  }

  .nav__links a {
    padding: 6px 8px;
  }

  /* Hero card : pleine largeur */
  .hero__card {
    width: 100%;
  }
}

/* =========================
   12) Responsive (mobile < 600px)
   ========================= */
@media (max-width: 600px) {
  /* Réduire hauteur du header sur mobile */
  :root {
    --header-height: 50px;
    --anchor-offset: 70px;
  }

  /* Container et sections : padding réduit */
  .container {
    padding: 16px;
  }

  .section {
    padding: 40px 0;
  }

  /* Grilles : 1 seule colonne */
  .grid {
    grid-template-columns: 1fr;
  }

  /* Titres : plus petits */
  .hero h1 {
    font-size: 1.8rem;
  }

  .section h2 {
    font-size: 1.3rem;
  }

  /* Card : moins de padding */
  .card {
    padding: 14px;
  }

  /* Boutons : empilés et full-width */
  .actions {
    flex-direction: column;
    gap: 8px;
  }

  .btn {
    width: 100%;
    text-align: center;
    padding: 12px;
  }

  /* Header nav : ultra compact */
  .site-header {
    height: 50px;
  }

  .nav {
    padding: 6px 8px;
    gap: 4px;
    flex-wrap: nowrap;
    overflow-x: hidden;
  }

  /* Afficher le bouton hamburger sur mobile */
  .nav-toggle-btn {
    display: flex;
  }

  /* Quand la checkbox est cochée : afficher le menu */
  .nav-toggle:checked ~ .nav__links {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 50px;
    left: 0;
    right: 0;
    background: rgba(15, 18, 32, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    padding: 12px 8px;
    gap: 6px;
    z-index: 998;
  }

  .nav-toggle:not(:checked) ~ .nav__links {
    display: none;
  }

  /* Animation hamburger quand ouvert */
  .nav-toggle:checked ~ .nav-toggle-btn span:nth-child(1) {
    transform: rotate(45deg) translate(10px, 10px);
  }

  .nav-toggle:checked ~ .nav-toggle-btn span:nth-child(2) {
    opacity: 0;
  }

  .nav-toggle:checked ~ .nav-toggle-btn span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
  }

  .nav__links {
    font-size: 0.65rem;
    gap: 3px;
  }

  .nav__links a {
    padding: 8px 12px;
    border-radius: 4px;
    white-space: nowrap;
    display: block;
    width: 100%;
    text-align: left;
  }

  /* Card footer responsive */
  .card__footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .proof-link {
    display: block;
    width: 100%;
  }

  /* Icônes contact : un peu plus petites */
  .contact-list .icon {
    width: 24px;
    height: 24px;
  }

  /* Footer */
  .footer {
    padding: 16px 0;
  }
}

/* =========================
   13) Ultra-mobile (< 400px)
   ========================= */
@media (max-width: 400px) {
  /* Réduire encore plus sur ultra-mobile */
  :root {
    --header-height: 45px;
    --anchor-offset: 60px;
  }

  /* Réduction drastique des fonts */
  .section h2 {
    font-size: 1.1rem;
    margin: 0 0 12px;
  }

  .hero h1 {
    font-size: 1.6rem;
  }

  .subtitle {
    font-size: 0.9rem;
  }

  /* Badges plus petits */
  .badge {
    padding: 2px 8px;
    font-size: 0.75rem;
  }

  /* Navigation : très compacte */
  .site-header {
    height: 45px;
  }

  .nav {
    padding: 4px 6px;
    gap: 2px;
  }

  .nav__links {
    font-size: 0.6rem;
    gap: 2px;
  }

  .nav__links a {
    padding: 2px 3px;
    font-size: 0.6rem;
  }

  /* Réduction padding global */
  .actions {
    gap: 6px;
  }

  .btn {
    padding: 10px 12px;
    font-size: 0.9rem;
  }
}