/* ==========================================================================
   LAYOUT · composition de la page d'accueil.
   neo.css tient le systeme (tokens + composants reutilisables) ; ce fichier
   ne tient que l'assemblage propre a cette page. La separation evite qu'une
   retouche de mise en page ne contamine le design system.
   ========================================================================== */

/* --- Lien d'evitement --------------------------------------------------- */
.neo-skip {
  position: absolute;
  left: -9999px;
  z-index: 100;
  padding: 14px 20px;
  border: var(--neo-b) solid var(--neo-ink);
  background: var(--neo-secondary);
  box-shadow: var(--neo-sh-md);
  text-transform: uppercase;
  letter-spacing: .08em;
}
.neo-skip:focus { left: 16px; top: 16px; }

/* --- Navigation --------------------------------------------------------- */
.neo-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--neo-bg);
}
.neo-nav__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  max-width: var(--neo-max);
  margin-inline: auto;
  padding: 12px var(--neo-gutter);
}

.neo-logo { display: flex; align-items: center; gap: 12px; }
.neo-logo__mark {
  display: grid;
  place-items: center;
  width: 42px; height: 42px;
  border: var(--neo-b) solid var(--neo-ink);
  background: var(--neo-secondary);
  box-shadow: var(--neo-sh-sm);
  font-size: 22px;
  line-height: 1;
  transition: transform .12s linear, background-color .12s linear;
}
.neo-logo:hover .neo-logo__mark { transform: rotate(-8deg); background: var(--neo-accent); }
.neo-logo__name {
  font-size: 19px;
  letter-spacing: -.01em;
  text-transform: uppercase;
  white-space: nowrap;
}

.neo-nav__links { display: flex; align-items: center; gap: 6px; }
.neo-nav__links a {
  padding: 8px 10px;
  border: var(--neo-b-thin) solid transparent;
  font-size: 14px;
  letter-spacing: .1em;
  text-transform: uppercase;
  transition: transform .1s linear, box-shadow .1s linear, background-color .1s linear, border-color .1s linear;
}
/* Le lien n'a pas d'etat "discret" : il claque en place, bordure et ombre
   comprises. */
.neo-nav__links a:hover {
  border-color: var(--neo-ink);
  background: var(--neo-accent);
  box-shadow: var(--neo-sh-sm);
  transform: translate(-1px, -1px);
}

.neo-nav__end { display: flex; align-items: center; gap: 12px; }
.neo-nav__cta { min-height: 44px; padding: 0 16px; font-size: 13px; }

.neo-nav__progress {
  height: 8px;
  background: var(--neo-paper);
  border-bottom: var(--neo-b) solid var(--neo-ink);
}
.neo-nav__progress > span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--neo-accent);
  border-right: var(--neo-b-thin) solid var(--neo-ink);
}

/* Bouton burger : un carre bordé, pas une icone flottante. */
.neo-burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 48px; height: 48px;
  padding: 0 10px;
  border: var(--neo-b) solid var(--neo-ink);
  background: var(--neo-paper);
  box-shadow: var(--neo-sh-sm);
  cursor: pointer;
  transition: transform .1s linear, box-shadow .1s linear;
}
.neo-burger span { display: block; height: 3px; background: var(--neo-ink); }
.neo-burger:active { transform: translate(4px, 4px); box-shadow: none; }
.neo-burger[aria-expanded="true"] { background: var(--neo-accent); }

/* --- Hero --------------------------------------------------------------- */
.neo-hero { padding-top: clamp(44px, 7vh, 76px); }
.neo-hero__grid {
  display: grid;
  /* 60/40 plutot qu'un demi-demi : l'asymetrie est voulue. */
  grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: center;
  position: relative;
  z-index: 1;
}
.neo-hero__left { display: grid; gap: clamp(22px, 3vh, 34px); justify-items: start; min-width: 0; }
/* Une piste de grille a un min-width:auto implicite : sans ce garde-fou, le
   moindre contenu insecable elargit la colonne au-dela du viewport et le
   overflow-x:hidden du body coupe le texte au lieu de le faire rentrer. */
.neo-hero__left > * { max-width: 100%; }
.neo-hero__kicker { background: var(--neo-secondary); white-space: normal; }
.neo-hero__title { display: grid; gap: clamp(6px, 1vh, 12px); justify-items: start; }
.neo-hero__title > span { display: block; }
.neo-hero__pitch { width: 100%; max-width: 60ch; }
.neo-hero__pitch .neo-card__body { border-left: 10px solid var(--neo-accent); }
.neo-hero__cta { display: flex; flex-wrap: wrap; gap: 16px; width: 100%; }

/* Formes flottantes : posees aux coins, jamais sous un texte. */
.neo-hero__sq1 { top: 8%;  left: -34px;  width: 86px;  height: 86px;  background: var(--neo-accent); transform: rotate(-14deg); }
.neo-hero__ci1 { top: 12%; right: 3%;    width: 74px;  height: 74px;  background: var(--neo-secondary); --r: 0deg; }
.neo-hero__sq2 { bottom: 16%; right: -30px; width: 108px; height: 108px; background: var(--neo-muted); transform: rotate(12deg); }

/* Carte d'identite : le "chaos organise" du hero. Les pastilles debordent
   volontairement de ses bords. */
/* La marge haute laisse passer le tampon au-dessus du coin de la carte :
   celle-ci est pivotee, son bord gauche remonte, et sans cette reserve le
   tampon mordrait sur l'en-tete. */
.neo-hero__right { position: relative; padding: 48px 18px 30px; }
.neo-idcard { background: var(--neo-muted); box-shadow: var(--neo-sh-lg); }
.neo-idcard .neo-card__head { background: var(--neo-paper); }
.neo-idcard__body { display: grid; gap: 18px; }
.neo-idcard__rows { display: grid; gap: 12px; margin: 0; }
.neo-idcard__rows > div { display: grid; gap: 2px; padding-bottom: 10px; border-bottom: var(--neo-b-thin) solid var(--neo-ink); }
.neo-idcard__rows > div:last-child { border-bottom: 0; padding-bottom: 0; }
.neo-idcard__rows dd { margin: 0; font-size: 18px; line-height: 1.25; }
.neo-idcard__tags { display: flex; flex-wrap: wrap; gap: 8px; }
.neo-idcard__stamp { position: absolute; top: 0; left: -6px; background: var(--neo-ink); color: var(--neo-bg); }
.neo-idcard__star { position: absolute; right: -4px; bottom: 6px; display: grid; place-items: center;
  width: 58px; height: 58px; border: var(--neo-b) solid var(--neo-ink);
  border-radius: 999px; background: var(--neo-secondary); box-shadow: var(--neo-sh-sm); }

/* Chiffres cles : les blocs sont colles, l'ecart lui-meme fait la bordure. */
.neo-stats {
  display: grid;
  /* Colonnes explicites, pas d'auto-fit : avec trois cases, un repli a deux
     colonnes laisse une case vide ou le fond noir du conteneur transparait. */
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--neo-b);
  margin-top: clamp(48px, 8vh, 92px);
  border: var(--neo-b) solid var(--neo-ink);
  background: var(--neo-ink);
  box-shadow: var(--neo-sh-lg);
  position: relative;
  z-index: 1;
}
.neo-stat { background: var(--neo-bg); padding: clamp(18px, 2.4vw, 28px); }
.neo-stat b {
  display: block;
  font-size: clamp(42px, 5.4vw, 68px);
  line-height: .9;
  letter-spacing: -.04em;
  -webkit-text-stroke: .04em currentColor;
  paint-order: stroke fill;
}
.neo-stat .neo-label { display: block; margin-top: 10px; }

/* --- Grilles ------------------------------------------------------------ */
/* min(Xpx, 100%) plutot que Xpx sec : sur un tres petit ecran la piste peut
   descendre sous son minimum au lieu de deborder. */
.neo-grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(296px, 100%), 1fr)); gap: clamp(22px, 2.6vw, 34px); }
.neo-grid4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(258px, 100%), 1fr)); gap: clamp(22px, 2.4vw, 30px); }
.neo-grid5 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(202px, 100%), 1fr)); gap: clamp(20px, 2.2vw, 28px); }

.neo-card__body .neo-h3 { margin-bottom: 12px; }
.neo-card__body .neo-lead { margin-bottom: 16px; }
.neo-card__body > :last-child { margin-bottom: 0; }
.neo-tags { display: flex; flex-wrap: wrap; gap: 7px; }

/* --- Projets ------------------------------------------------------------ */
.neo-proj { display: flex; flex-direction: column; }
.neo-proj .neo-card__body { display: flex; flex-direction: column; flex: 1; }
.neo-proj .neo-tags { margin-top: auto; }
.neo-proj__shot {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 10;
  padding: 26px;
  border-bottom: var(--neo-b) solid var(--neo-ink);
}
.neo-proj__shot img { width: auto; height: auto; object-fit: contain; }
.neo-proj__year { position: absolute; bottom: -18px; left: 16px; font-size: 12px; padding: 6px 12px; }
.neo-proj__kind { margin: 0 0 12px; color: inherit; }
.neo-proj .neo-card__body { padding-top: 30px; }

/* --- Listes stack ------------------------------------------------------- */
.neo-list { list-style: none; margin: 0; padding: clamp(16px, 2vw, 22px); display: grid; gap: 10px; }
.neo-list li { display: flex; align-items: center; gap: 10px; font-size: 17px; }
/* Puce carree pleine : un rond serait trop doux pour le systeme. */
.neo-list li::before { content: ""; flex: none; width: 9px; height: 9px; background: var(--neo-ink); }

/* --- Parcours ----------------------------------------------------------- */
.neo-timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: clamp(18px, 2.4vw, 26px); }
.neo-tl {
  display: grid;
  /* Assez large pour que « Sept. 2024 -> auj. » tienne sur une ligne : une
     date coupee en deux se lit comme deux dates. */
  grid-template-columns: minmax(150px, 196px) 1fr;
  gap: clamp(16px, 3vw, 36px);
  padding: clamp(20px, 2.6vw, 30px);
}
.neo-tl__years {
  align-self: start;
  padding: 8px 12px;
  border: var(--neo-b-thin) solid var(--neo-ink);
  background: var(--neo-paper);
  text-align: center;
  white-space: nowrap;
}
.neo-tl__org { margin: 6px 0 12px; color: inherit; font-size: 17px; }
.neo-tl__org::before { content: "\2192\00a0"; }

/* --- A propos ----------------------------------------------------------- */
.neo-about {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: start;
}
.neo-about__text { min-width: 0; }
.neo-about__p { margin-bottom: 20px; max-width: 58ch; font-size: clamp(17px, 1.5vw, 21px); }
.neo-about__tags { margin-top: 26px; }
.neo-portrait { margin: 0; padding: 14px; background: var(--neo-muted); box-shadow: var(--neo-sh-lg); }
.neo-portrait__frame {
  border: var(--neo-b) solid var(--neo-ink);
  background-color: var(--neo-paper);
  aspect-ratio: 4 / 5;
  overflow: hidden;
  display: grid;
  align-items: end;
}
.neo-portrait__frame img { width: 100%; height: 100%; object-fit: contain; object-position: bottom; }
.neo-portrait__cap { display: block; margin-top: 12px; text-align: center; }

/* --- Contact ------------------------------------------------------------ */
.neo-contact { border-bottom: 0; }
.neo-contact__kicker { background: var(--neo-secondary); color: var(--neo-ink); white-space: normal; max-width: 100%; }
.neo-contact__title { margin: clamp(24px, 4vh, 40px) 0 clamp(36px, 6vh, 60px); max-width: 16ch; }
.neo-contact__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: clamp(28px, 4vw, 56px);
  align-items: start;
}
.neo-contact__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.neo-contact__list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  border: var(--neo-b) solid var(--neo-bg);
  font-size: clamp(17px, 1.8vw, 24px);
  transition: transform .12s linear, background-color .12s linear, color .12s linear;
}
.neo-contact__list a span { overflow-wrap: anywhere; }
.neo-contact__list a:hover {
  background: var(--neo-accent);
  border-color: var(--neo-accent);
  color: var(--neo-ink);
  transform: translateX(8px);
}
.neo-contact__note { display: grid; gap: 22px; justify-items: start; padding: clamp(20px, 2.6vw, 28px); border: var(--neo-b) solid var(--neo-secondary); }
.neo-contact__note .neo-lead { max-width: 40ch; }

/* --- Pied de page ------------------------------------------------------- */
.neo-footer { background: var(--neo-secondary); border-top: var(--neo-b-fat) solid var(--neo-ink); }
.neo-footer__bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  padding-block: 24px;
}

/* --- Points de rupture --------------------------------------------------
   On ne degrade pas l'esthetique : on empile, on reduit les ombres, on garde
   les bordures epaisses et les majuscules. */
@media (max-width: 1000px) {
  .neo-hero__grid { grid-template-columns: minmax(0, 1fr); }
  .neo-hero__right { width: 100%; max-width: 460px; }
  .neo-about { grid-template-columns: minmax(0, 1fr); }
  .neo-portrait { max-width: 420px; }
  .neo-contact__grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 860px) {
  .neo-nav__cta { display: none; }
  .neo-burger { display: flex; }

  /* Menu mobile : un panneau bordé qui tombe sous la nav, pas un tiroir
     translucide. */
  .neo-nav__links {
    position: absolute;
    left: 0; right: 0;
    top: 100%;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 18px var(--neo-gutter) 26px;
    background: var(--neo-bg);
    border-bottom: var(--neo-b) solid var(--neo-ink);
  }
  .neo-nav__links.is-open { display: flex; }
  .neo-nav__links a {
    padding: 16px;
    border-color: var(--neo-ink);
    background: var(--neo-paper);
    box-shadow: var(--neo-sh-sm);
    font-size: 16px;
    text-align: center;
  }
}

@media (max-width: 1080px) {
  /* Quatre cases se replient en deux rangees pleines : aucune case orpheline,
     donc le fond noir du conteneur ne transparait jamais. */
  .neo-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
  .neo-stats { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 640px) {
  .neo-logo__name { display: none; }
  .neo-tl { grid-template-columns: minmax(0, 1fr); }
  .neo-tl__years { justify-self: start; }
  .neo-hero__sq1, .neo-hero__sq2 { display: none; }
  .neo-hero__cta .neo-btn { width: 100%; }
  .neo-contact__note .neo-btn { width: 100%; }
}

/* --- Bande « toute la chaine » -----------------------------------------
   La piece qui appartient a ce site et a aucun autre : la these de Najib
   (tenir la ligne entiere plutot qu'une tranche) rendue litteralement en
   quatre postes relies. Pas de numero de section : c'est une declaration,
   pas un chapitre. */
.neo-line {
  padding-block: clamp(44px, 7vh, 76px);
  background-color: var(--neo-accent);
  border-bottom: var(--neo-b) solid var(--neo-ink);
  overflow: hidden;
}
.neo-line__inner { display: grid; gap: clamp(26px, 4vh, 40px); justify-items: center; text-align: center; }
.neo-line__chain {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  width: 100%;
}
.neo-line__stop {
  flex: 0 1 auto;
  padding: clamp(12px, 1.8vw, 18px) clamp(14px, 2.2vw, 26px);
  border: var(--neo-b) solid var(--neo-ink);
  background: var(--neo-bg);
  box-shadow: var(--neo-sh-sm);
  font-size: clamp(14px, 1.7vw, 21px);
  letter-spacing: .04em;
  text-transform: uppercase;
  white-space: nowrap;
}
/* Le dernier poste est la livraison : c'est lui qu'on souligne. */
.neo-line__stop:last-child { background: var(--neo-secondary); }
/* Le connecteur est une barre pleine terminee par une pointe : le trait
   continu dit « une seule main », la pointe dit le sens de la marche. */
.neo-line__link {
  position: relative;
  flex: 1 1 18px;
  min-width: 16px;
  max-width: 64px;
  height: 6px;
  background: var(--neo-ink);
}
.neo-line__link::after {
  content: "";
  position: absolute;
  right: -3px; top: 50%;
  transform: translateY(-50%);
  border-left: 14px solid var(--neo-ink);
  border-top: 9px solid transparent;
  border-bottom: 9px solid transparent;
}
.neo-line__thesis { max-width: 62ch; font-size: clamp(17px, 1.5vw, 21px); }

@media (max-width: 780px) {
  /* Empilee, la chaine garde son sens de lecture : la pointe bascule vers
     le bas plutot que de disparaitre. */
  .neo-line__chain { flex-direction: column; align-items: center; }
  .neo-line__stop { width: 100%; max-width: 340px; text-align: center; }
  .neo-line__link {
    flex: none;
    width: 6px; height: 26px; max-width: none;
    margin-block: 9px;
  }
  .neo-line__link::after {
    right: 50%; top: auto; bottom: -14px;
    transform: translateX(50%);
    border-left: 9px solid transparent;
    border-right: 9px solid transparent;
    border-top: 14px solid var(--neo-ink);
    border-bottom: 0;
  }
}

/* --- Bouton « rebattre les couleurs » ----------------------------------
   Un vrai bouton nomme, pas un easter egg cache : il permute les roles des
   trois couleurs d'accent. Les trois ont un contraste >= 7:1 sur le noir,
   donc aucune permutation ne casse la lisibilite. */
.neo-shuffle {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 7px 13px;
  border: var(--neo-b-thin) solid var(--neo-ink);
  background: var(--neo-bg);
  box-shadow: var(--neo-sh-sm);
  font-family: var(--neo-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform .1s linear, box-shadow .1s linear, background-color .1s linear;
}
.neo-shuffle:hover  { background: var(--neo-paper); }
.neo-shuffle:active { transform: translate(3px, 3px); box-shadow: none; }
.neo-shuffle__chips { display: inline-flex; }
.neo-shuffle__chips i {
  width: 11px; height: 14px;
  border: 2px solid var(--neo-ink);
}
.neo-shuffle__chips i + i { border-left: 0; }
