/* Nioxen — site vitrine
   Charte : nioxen-design-handoff.md. Le N porte toute la couleur, le reste est monochrome. */

:root {
  --nx-fond: #F2F2F5;
  --nx-encre: #111118;
  --nx-texte-2: #4A4A5C;
  --nx-label: #5E5E70;
  --nx-filet: #8E8EA0;

  --nx-font-titre: 'Unbounded', 'Segoe UI', sans-serif;
  --nx-font-texte: 'Inter', 'Segoe UI', sans-serif;
  --nx-font-marque: 'Montserrat', 'Segoe UI', sans-serif;

  --gouttiere: clamp(20px, 5.6vw, 96px);
  --header-h: 76px;
  --mesure: 34rem;           /* largeur de lecture, ~70 caractères */
  --section: clamp(96px, 14vw, 200px);

  /* Hero : taille du titre et place qu'il laisse au N */
  --titre: clamp(44px, 8.2vw, 152px);
  --hero-bas: clamp(32px, 6vh, 64px);
  --hero-air: clamp(20px, 4vh, 48px);
  --n-deborde: 3vw;          /* le N sort du cadre d'environ 8 % de sa largeur */
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--nx-fond);
  color: var(--nx-encre);
  font-family: var(--nx-font-texte);
  font-size: 1.0625rem;
  line-height: 1.45;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, p, ul { margin: 0; }
ul { padding: 0; list-style: none; }
img { display: block; max-width: 100%; }

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.22em; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible { outline: 3px solid var(--nx-encre); outline-offset: 4px; border-radius: 2px; }

.skip {
  position: absolute; left: var(--gouttiere); top: -100px; z-index: 10;
  padding: 10px 16px; background: var(--nx-encre); color: var(--nx-fond);
}
.skip:focus { top: 12px; }

/* ---------- En-tête ---------- */

.site-header {
  position: absolute; inset: 0 0 auto; z-index: 2;
  height: var(--header-h);
  display: flex; align-items: center; justify-content: space-between;
  padding-inline: var(--gouttiere);
}

.wordmark {
  font-family: var(--nx-font-marque);
  font-weight: 600;
  font-size: 1.25rem;
  letter-spacing: 0.06em;
  line-height: 1;
  text-decoration: none;
}

.horloge {
  margin: 0 auto 0 clamp(20px, 2.4vw, 36px);
  color: var(--nx-label);
  font-size: 0.875rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.nav { display: flex; align-items: center; gap: clamp(16px, 2.6vw, 36px); font-weight: 500; font-size: 0.9375rem; }
.nav a:not(.button) { text-decoration: none; }
.nav a:not(.button):hover { text-decoration: underline; }

/* Bouton : les extrémités arrondies reprennent les terminaisons du N */
.button {
  display: inline-flex; align-items: center;
  min-height: 44px; padding: 0 22px;
  border-radius: 999px;
  background: var(--nx-encre); color: var(--nx-fond);
  text-decoration: none; font-weight: 600;
  transition: background-color .2s ease;
}
.button:hover { background: #2A2A36; }

/* ---------- Hero ---------- */

.hero {
  position: relative;
  min-height: 100svh;
  padding: var(--header-h) var(--gouttiere) var(--hero-bas);
  display: flex; flex-direction: column; justify-content: flex-end;
  overflow-x: clip; /* le N déborde, la page ne défile pas pour autant */
}

/* Le N déborde à droite, et sa base s'arrête au-dessus de la dernière ligne du titre :
   « Web. » et « Mobile. » vivent à sa gauche, « Sur mesure. » passe dessous. */
.hero__n {
  position: absolute;
  top: calc(var(--header-h) + 1vh);
  right: calc(var(--n-deborde) * -1);
  width: auto;
  height: min(
    calc(100svh - var(--header-h) - 1vh - var(--hero-bas) - var(--titre) * 1.03 - var(--hero-air)),
    53vw
  );
  aspect-ratio: 458 / 529;
  pointer-events: none;
  user-select: none;
  will-change: transform;
}
.hero__n img { width: 100%; height: 100%; max-width: none; }

.hero__titre {
  position: relative;
  font-family: var(--nx-font-titre);
  font-weight: 700;
  font-size: var(--titre);
  line-height: 1.03;
  letter-spacing: -0.02em;
}
.ligne { display: block; overflow: hidden; padding-bottom: 0.04em; margin-bottom: -0.04em; }
.ligne > span { display: block; }

/* Le seul moment animé : le N se pose, puis le titre monte ligne par ligne. */
@media (prefers-reduced-motion: no-preference) {
  .hero__n img { animation: n-pose 1.3s cubic-bezier(.16, 1, .3, 1) both; }
  .ligne > span { animation: ligne-monte 1s cubic-bezier(.16, 1, .3, 1) both; }
  .ligne:nth-child(1) > span { animation-delay: .35s; }
  .ligne:nth-child(2) > span { animation-delay: .45s; }
  .ligne:nth-child(3) > span { animation-delay: .55s; }
}

@keyframes n-pose {
  from { opacity: 0; transform: translate3d(6vw, 2vh, 0) scale(1.06); filter: blur(12px); }
  to   { opacity: 1; transform: none; filter: none; }
}
@keyframes ligne-monte {
  from { transform: translateY(105%); }
  to   { transform: none; }
}

/* Écrans étroits ou portrait : le N passe au-dessus, le texte s'empile dessous. */
@media (max-width: 1099px), (max-aspect-ratio: 1/1) {
  .hero { justify-content: flex-start; min-height: 0; padding-top: calc(var(--header-h) + 8px); }
  .hero__n {
    position: relative; top: auto; right: auto;
    height: auto;
    width: min(92vw, 62svh);
    max-width: none;
    margin-left: auto;
    margin-right: calc(var(--gouttiere) * -1 - var(--n-deborde) * 2);
  }
  .hero__titre { margin-top: clamp(48px, 14vw, 120px); }
}

/* ---------- Approche ---------- */

.approche {
  padding: clamp(56px, 9vw, 120px) var(--gouttiere) 0;
}

.signature-phrase {
  max-width: 18ch;
  font-weight: 600;
  font-size: clamp(28px, 4.2vw, 64px);
  line-height: 1.18;
  letter-spacing: -0.015em;
}

.approche__texte {
  max-width: var(--mesure);
  margin-top: clamp(32px, 4vw, 56px);
  color: var(--nx-texte-2);
  font-size: clamp(1.0625rem, 1.3vw, 1.25rem);
}
.approche__texte p + p { margin-top: 1em; }

/* Page 404 */
.introuvable { padding-bottom: clamp(80px, 10vw, 140px); }
.introuvable__retour { margin-top: clamp(32px, 4vw, 52px); }

/* ---------- Titres de section ---------- */

.h2 {
  font-family: var(--nx-font-titre);
  font-weight: 700;
  font-size: clamp(26px, 3vw, 44px);
  line-height: 1.04;
  letter-spacing: -0.02em;
}

/* Surtitre de la charte (« Nos plateformes ») */
.label {
  color: var(--nx-label);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

/* ---------- Services ---------- */

.services { padding: var(--section) var(--gouttiere) 0; }

.services__liste {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0 clamp(24px, 3vw, 48px);
  margin-top: clamp(40px, 5vw, 72px);
}
.services__liste li { border-top: 1px solid var(--nx-filet); padding-top: 22px; }
.services__liste h3 {
  font-family: var(--nx-font-titre);
  font-weight: 700;
  font-size: clamp(18px, 1.5vw, 22px);
  line-height: 1.15;
  letter-spacing: -0.01em;
}
.services__liste p { margin-top: 14px; color: var(--nx-texte-2); max-width: 30ch; }

@media (max-width: 1099px) {
  .services__liste { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 48px; }
}
@media (max-width: 599px) {
  .services__liste { grid-template-columns: 1fr; row-gap: 36px; }
}

/* ---------- Réalisations ---------- */

.realisations { padding: var(--section) var(--gouttiere) 0; }

/* Texte à gauche, capture à droite qui sort du cadre, comme le N. */
.projet {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(32px, 5vw, 88px);
  align-items: center;
  margin-top: clamp(64px, 8vw, 128px);
}

.projet__texte { display: flex; flex-direction: column; align-items: flex-start; }

.projet__nom {
  margin-top: 14px;
  font-family: var(--nx-font-titre);
  font-weight: 700;
  font-size: clamp(30px, 4vw, 60px);
  line-height: 1.02;
  letter-spacing: -0.02em;
}

.projet__desc { margin-top: 20px; max-width: 46ch; color: var(--nx-texte-2); }
.projet__preuve { margin-top: 12px; max-width: 46ch; font-weight: 500; }

.projet__lien {
  margin-top: 24px;
  font-weight: 500;
  color: var(--nx-texte-2);
  text-decoration-color: var(--nx-filet);
}
.projet__lien:hover { color: var(--nx-encre); text-decoration-color: currentColor; }
.projet__lien--bientot { color: var(--nx-label); }

.projet__visuel { position: relative; margin-right: calc(var(--gouttiere) * -1); }

.projet__ecran {
  display: block;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  background: #E4E4EA;
}
.projet__ecran img {
  width: 100%; height: 100%;
  object-fit: cover; object-position: left top;
  transition: transform 1.2s cubic-bezier(.16, 1, .3, 1);
}
.projet__ecran:hover img { transform: scale(1.025); }

/* La version mobile du même site, posée devant l'écran : « Web. Mobile. » */
.projet__mobile {
  position: absolute;
  left: clamp(-56px, -3.5vw, -20px);
  bottom: -14%;
  width: 22%;
  height: auto;
  border: clamp(4px, 0.5vw, 7px) solid var(--nx-fond);
  border-radius: clamp(16px, 2.2vw, 30px);
  background: var(--nx-fond);
  box-shadow: 0 0 0 1px rgba(17, 17, 24, .12); /* filet, pas une ombre : détache les captures claires */
}

.projet--a-venir { grid-template-columns: minmax(0, 1fr); }

/* Chiffres du Tournoi des Pépites */
.chiffres {
  display: grid;
  grid-template-columns: repeat(3, auto);
  justify-content: start;
  gap: 8px clamp(24px, 3vw, 48px);
  margin: 32px 0 0;
}
.chiffres div { display: flex; flex-direction: column-reverse; }
.chiffres dd {
  margin: 0;
  font-family: var(--nx-font-titre);
  font-weight: 700;
  font-size: clamp(28px, 3vw, 44px);
  line-height: 1.04;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.chiffres dt { margin-top: 6px; color: var(--nx-texte-2); font-size: 0.9375rem; }
.chiffres__legende { margin-top: 16px; color: var(--nx-label); font-size: 0.9375rem; }

/* Apparition des captures : un balayage de gauche à droite, une seule fois. */
@media (prefers-reduced-motion: no-preference) {
  .js [data-revele] .projet__ecran { clip-path: inset(0 0 0 100%); transition: clip-path 1.3s cubic-bezier(.7, 0, .2, 1); }
  .js [data-revele] .projet__ecran img { transform: scale(1.12); }
  .js [data-revele].est-visible .projet__ecran { clip-path: inset(0); }
  .js [data-revele].est-visible .projet__ecran img { transform: none; transition-duration: 1.8s; }
  .js [data-revele].est-visible .projet__ecran:hover img { transform: scale(1.025); transition-duration: 1.2s; }

  /* Le téléphone arrive une fois l'écran dévoilé. */
  .js [data-revele] .projet__mobile { opacity: 0; transform: translateY(18%); transition: opacity .6s ease .9s, transform 1.1s cubic-bezier(.16, 1, .3, 1) .9s; }
  .js [data-revele].est-visible .projet__mobile { opacity: 1; transform: none; }
}

@media (max-width: 899px) {
  .projet { grid-template-columns: minmax(0, 1fr); }
  .projet__visuel { margin-bottom: 14%; }
  .projet__mobile { left: 0; width: 30%; }
}
@media (max-width: 479px) {
  .chiffres { grid-template-columns: repeat(2, auto); }
}

/* ---------- Contact ---------- */

.contact { padding: var(--section) var(--gouttiere) clamp(80px, 10vw, 140px); }

.contact__titre {
  max-width: 20ch;
  font-family: var(--nx-font-titre);
  font-weight: 700;
  font-size: clamp(30px, 4.6vw, 72px);
  line-height: 1.04;
  letter-spacing: -0.02em;
}

.contact__texte {
  max-width: var(--mesure);
  margin-top: 28px;
  color: var(--nx-texte-2);
  font-size: clamp(1.0625rem, 1.3vw, 1.25rem);
}

.contact__mail {
  display: inline-block;
  margin-top: clamp(32px, 4vw, 52px);
  font-weight: 600;
  font-size: clamp(22px, 3.2vw, 48px);
  letter-spacing: -0.015em;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.18em;
  overflow-wrap: anywhere;
}
.contact__mail:hover { text-decoration-thickness: 4px; }

/* ---------- Signature ---------- */

.site-footer {
  margin-inline: var(--gouttiere);
  padding: 36px 0 44px;
  border-top: 3px solid var(--nx-encre);
  display: flex; align-items: flex-end; justify-content: space-between; gap: 24px;
  color: var(--nx-texte-2);
  font-weight: 500;
}

.site-footer__nioxen {
  margin-bottom: 10px;
  color: var(--nx-encre);
  font-family: var(--nx-font-marque);
  font-weight: 600;
  font-size: clamp(36px, 5.4vw, 80px);
  letter-spacing: 0.06em;
  line-height: 1;
}

@media (max-width: 599px) {
  .nav li:not(:last-child), .horloge { display: none; }
  .site-footer { flex-direction: column; align-items: flex-start; }
}
