/* =========================================================
   PALETTE DE COULEURS
   Modifiez ces valeurs pour changer les couleurs de tout le site.
   ========================================================= */
:root {
  --bg: #0B1020;          /* fond principal : bleu nuit très sombre */
  --bg-alt: #10172B;      /* fond des sections alternées */
  --surface: #161F38;     /* fond des cartes */
  --border: #24304F;      /* bordures discrètes */
  --text: #E7EAF3;        /* texte principal : blanc cassé */
  --muted: #9AA4BF;       /* texte secondaire : gris bleuté */
  --accent: #F5B841;      /* couleur d'accent : or chaud */
  --accent-hover: #FFCB63;
  --whatsapp: #25D366;    /* vert officiel WhatsApp */
  --whatsapp-hover: #1EBE5A;

  --font-title: "Sora", system-ui, sans-serif;
  --font-text: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --radius: 16px;
  --header-h: 64px;       /* hauteur du menu fixe */
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
}

/* =========================================================
   BASES
   ========================================================= */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;                 /* défilement fluide */
  scroll-padding-top: var(--header-h);     /* évite que le menu fixe cache les titres */
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-text);
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; }
h1, h2, h3 { font-family: var(--font-title); line-height: 1.2; margin: 0 0 .5em; }
p { margin: 0 0 1em; }

.container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

.icon { width: 1.25em; height: 1.25em; flex-shrink: 0; }

/* Lien "Aller au contenu" : caché jusqu'à ce qu'on navigue au clavier */
.skip-link {
  position: absolute; left: 1rem; top: -100px; z-index: 200;
  background: var(--accent); color: var(--bg); padding: .5rem 1rem; border-radius: 8px;
}
.skip-link:focus { top: 1rem; }

/* Contour visible pour la navigation au clavier */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

/* =========================================================
   BARRE DE PROGRESSION DE LECTURE
   ========================================================= */
.progress {
  position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 120;
}
.progress__bar {
  height: 100%; width: 100%;
  background: linear-gradient(90deg, var(--accent), var(--whatsapp));
  transform: scaleX(0);           /* rempli par script.js de 0 à 1 */
  transform-origin: left;
}

/* =========================================================
   MENU DE NAVIGATION (mobile d'abord)
   ========================================================= */
.header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--header-h);
  background: rgba(11, 16, 32, .85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s, background .3s;
}
.header.is-scrolled { border-bottom-color: var(--border); background: rgba(11, 16, 32, .95); }

.nav { height: 100%; display: flex; align-items: center; justify-content: space-between; }

.nav__logo {
  font-family: var(--font-title); font-weight: 700; font-size: 1.1rem; color: var(--text);
  display: flex; align-items: center; gap: .5rem;
}
.nav__logo-mark { color: var(--accent); }

/* Bouton hamburger : 3 barres qui se transforment en croix */
.nav__toggle {
  width: 44px; height: 44px; padding: 10px;
  background: none; border: 0; cursor: pointer;
  display: flex; flex-direction: column; justify-content: space-between;
}
.nav__toggle span {
  display: block; height: 2px; width: 100%; background: var(--text); border-radius: 2px;
  transition: transform .3s, opacity .3s;
}
.nav__toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(11px) rotate(45deg); }
.nav__toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav__toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-11px) rotate(-45deg); }

/* Menu déroulant sur téléphone */
.nav__menu {
  position: fixed; top: var(--header-h); left: 0; right: 0;
  margin: 0; padding: 1rem 1.25rem 1.5rem; list-style: none;
  background: var(--bg); border-bottom: 1px solid var(--border);
  display: flex; flex-direction: column; gap: .25rem;
  transform: translateY(-120%); visibility: hidden;
  transition: transform .35s ease, visibility .35s;
}
.nav__menu.is-open { transform: translateY(0); visibility: visible; }

.nav__link {
  display: block; padding: .75rem 0; color: var(--muted); font-weight: 500;
  transition: color .2s;
}
.nav__link:hover, .nav__link.is-active { color: var(--accent); }

/* =========================================================
   BOUTONS
   ========================================================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .6rem;
  min-height: 48px; padding: .8rem 1.5rem;
  border-radius: 999px; border: 2px solid transparent;
  font-weight: 600; font-size: 1rem; text-align: center;
  transition: transform .2s, box-shadow .2s, background .2s, color .2s;
}
.btn:hover { transform: translateY(-3px); }

.btn--primary { background: var(--accent); color: var(--bg); }
.btn--primary:hover { background: var(--accent-hover); box-shadow: 0 8px 24px rgba(245, 184, 65, .35); }

.btn--whatsapp { background: var(--whatsapp); color: #062B14; }
.btn--whatsapp:hover { background: var(--whatsapp-hover); box-shadow: 0 8px 24px rgba(37, 211, 102, .35); }

.btn--big { font-size: 1.1rem; padding: 1rem 2rem; }

/* =========================================================
   SECTIONS
   ========================================================= */
.section { padding: 5rem 0; }
.section--alt { background: var(--bg-alt); }

.section__title { font-size: 1.75rem; margin-bottom: 2rem; }
.section__title span { color: var(--accent); font-size: .8em; margin-right: .3rem; }
.section__title--center { text-align: center; }

/* ---------- 1. Accueil ---------- */
.hero {
  min-height: 100vh; min-height: 100svh;
  display: flex; align-items: center;
  padding-top: calc(var(--header-h) + 2rem);
  background:
    radial-gradient(600px circle at 85% 20%, rgba(245, 184, 65, .12), transparent 60%),
    radial-gradient(500px circle at 10% 90%, rgba(37, 211, 102, .08), transparent 60%);
}
/* Photo en haut, texte et boutons centrés en dessous (mobile et ordinateur) */
.hero__inner { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2rem; }

/* Cercle extérieur : la bordure dégradée jaune-vert */
/* Largeur ET hauteur fixes : sinon la photo (très haute) étire le cercle en ovale */
.hero__photo {
  width: 180px; height: 180px; aspect-ratio: 1 / 1; flex-shrink: 0;
  border-radius: 50%; padding: 5px;
  background: linear-gradient(135deg, var(--accent), var(--whatsapp));
  box-shadow: var(--shadow);
}
/* Cercle intérieur : fin liseré sombre + découpe ronde de la photo */
.hero__photo-frame {
  width: 100%; height: 100%; border-radius: 50%; overflow: hidden;
  border: 4px solid var(--bg);
}
/* Cadrage de la photo :
   - object-position : 2e valeur = hauteur du cadrage (0% = tout en haut de l'image)
   - translateX : décale l'image vers la droite pour centrer le visage
   - scale : zoom (1 = pas de zoom)
   Pour une autre photo, commencez avec "transform: none" et ajustez object-position. */
.hero__photo img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center 2%;
  transform: translateX(19%) scale(1.4);
}

.hero__tag { color: var(--muted); margin-bottom: .25rem; }
.hero__title { font-size: clamp(2.2rem, 9vw, 4rem); margin-bottom: .25rem; }
.hero__role { color: var(--accent); font-weight: 600; }
.hero__lead { color: var(--muted); font-size: 1.1rem; max-width: 34rem; margin: 0 auto 2rem; }
.hero__lead strong { color: var(--text); }

.hero__actions { display: flex; flex-direction: column; gap: .9rem; }

/* ---------- 2. À propos ---------- */
.about__text { color: var(--muted); font-size: 1.1rem; max-width: 46rem; }
.about__stats {
  list-style: none; padding: 0; margin: 2.5rem 0 0;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: .75rem;
}
.about__stats li {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1rem .5rem; text-align: center;
}
.about__stats strong { display: block; font-family: var(--font-title); color: var(--accent); font-size: 1.1rem; }
.about__stats span { color: var(--muted); font-size: .85rem; }

/* ---------- Cartes (services et projets) ---------- */
.grid { display: grid; gap: 1.5rem; }

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.75rem;
  transition: transform .3s, border-color .3s, box-shadow .3s;
}
.card:hover { transform: translateY(-6px); border-color: var(--accent); box-shadow: var(--shadow); }
.card p { color: var(--muted); margin: 0; }
.card__icon {
  width: 56px; height: 56px; border-radius: 14px; margin-bottom: 1.25rem;
  display: grid; place-items: center; font-size: 1.6rem;
  background: rgba(245, 184, 65, .12);
}
.card__title { font-size: 1.2rem; }

/* ---------- 4. Compétences ---------- */
.skills { list-style: none; padding: 0; margin: 0 0 2.5rem; display: grid; gap: 1.25rem; }
.skills:last-child { margin-bottom: 0; }
/* Titre de chaque groupe de compétences (Frontend, Backend, IA) */
.skills__group {
  font-size: 1rem; text-transform: uppercase; letter-spacing: .08em;
  color: var(--accent); margin-bottom: 1.25rem;
}
.skill__head { display: flex; justify-content: space-between; align-items: center; margin-bottom: .5rem; }
.skill__badge {
  display: inline-flex; align-items: center; gap: .5rem; font-weight: 600;
}
.skill__badge::before {   /* petite pastille de couleur de la techno */
  content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--c);
}
.skill__value { color: var(--muted); font-size: .9rem; }
.skill__track { height: 10px; background: var(--surface); border: 1px solid var(--border); border-radius: 999px; overflow: hidden; }
.skill__fill {
  height: 100%; width: 0;    /* la largeur est donnée par script.js */
  background: linear-gradient(90deg, var(--accent), var(--whatsapp));
  border-radius: 999px;
  transition: width 1.2s cubic-bezier(.22, 1, .36, 1) .2s;
}

/* ---------- 5. Réalisations ---------- */
.project { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.project__img {
  width: 100%; aspect-ratio: 16 / 10; object-fit: cover;
  border-bottom: 1px solid var(--border);
  transition: transform .5s;
}
.project:hover .project__img { transform: scale(1.04); }
.project__body { padding: 1.5rem; display: flex; flex-direction: column; flex: 1; background: var(--surface); position: relative; }
.project__body p { flex: 1; margin-bottom: 1.25rem; }
.project__link { font-weight: 600; align-self: flex-start; transition: gap .2s, color .2s; }
.project__link:hover { color: var(--accent-hover); text-decoration: underline; }

/* ---------- 6. Contact ---------- */
.contact { text-align: center; max-width: 40rem; }
.contact__text { color: var(--muted); font-size: 1.1rem; margin-bottom: 2rem; }
.contact__email { margin-top: 1.75rem; color: var(--muted); }
.contact__email a { word-break: break-all; }
.contact__email a:hover { text-decoration: underline; }

/* ---------- Pied de page ---------- */
.footer { border-top: 1px solid var(--border); padding: 2rem 0 6rem; text-align: center; color: var(--muted); font-size: .9rem; }
.footer p { margin: 0; }

/* ---------- Bouton WhatsApp flottant ---------- */
.whatsapp-float {
  position: fixed; right: 1.25rem; bottom: 1.25rem; z-index: 90;
  width: 58px; height: 58px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--whatsapp); color: #fff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .4);
  transition: transform .25s, background .25s;
  animation: pulse 2.5s infinite;
}
.whatsapp-float .icon { width: 30px; height: 30px; }
.whatsapp-float:hover { transform: scale(1.1); background: var(--whatsapp-hover); }

@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(37, 211, 102, .5), 0 8px 24px rgba(0, 0, 0, .4); }
  70%  { box-shadow: 0 0 0 16px rgba(37, 211, 102, 0), 0 8px 24px rgba(0, 0, 0, .4); }
  100% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0), 0 8px 24px rgba(0, 0, 0, .4); }
}

/* =========================================================
   ANIMATIONS D'APPARITION AU SCROLL
   La classe "js" est ajoutée par script.js : sans JavaScript,
   tout reste visible (aucun contenu caché par erreur).
   ========================================================= */
.js .reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity .7s ease, transform .7s ease;
  transition-delay: var(--delay, 0s);   /* décalage entre cartes, réglé par script.js */
}
.js .reveal.is-visible { opacity: 1; transform: none; }

/* =========================================================
   TABLETTE (à partir de 640px)
   ========================================================= */
@media (min-width: 640px) {
  .hero__actions { flex-direction: row; justify-content: center; }
  .grid { grid-template-columns: repeat(2, 1fr); }
  .skills { grid-template-columns: repeat(2, 1fr); column-gap: 2.5rem; }
  .section__title { font-size: 2.1rem; }
}

/* =========================================================
   ORDINATEUR (à partir de 900px)
   ========================================================= */
@media (min-width: 900px) {
  /* Le menu hamburger disparaît, les liens s'affichent en ligne */
  .nav__toggle { display: none; }
  .nav__menu {
    position: static; flex-direction: row; gap: 2rem;
    padding: 0; background: none; border: 0;
    transform: none; visibility: visible; transition: none;
  }
  .nav__link { padding: .25rem 0; position: relative; }
  .nav__link::after {   /* soulignement animé */
    content: ""; position: absolute; left: 0; bottom: -4px; height: 2px; width: 100%;
    background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform .3s;
  }
  .nav__link:hover::after, .nav__link.is-active::after { transform: scaleX(1); }

  .hero__photo { width: 260px; height: 260px; }

  .grid { grid-template-columns: repeat(3, 1fr); }
  .section { padding: 7rem 0; }
  .footer { padding-bottom: 2rem; }
}

/* =========================================================
   ACCESSIBILITÉ : animations réduites
   Si la personne a désactivé les animations sur son appareil,
   on supprime mouvements et transitions.
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
  .js .reveal { opacity: 1; transform: none; }
  .btn:hover, .card:hover, .whatsapp-float:hover, .project:hover .project__img { transform: none; }
}
