/* MEKARYX maquette v07 : écran de chargement, sélecteur FR | EN, orbite à dix modèles, démonstration en six étapes,
   compagnon animé par les clips officiels, lueurs et transitions plus riches.
   Aucune règle en ligne (CSP stricte). Tout mouvement s'arrête sous prefers-reduced-motion. */

/* ---------- Écran de chargement (première page vue de la session) ---------- */
.chargeur { display: none; }
.avec-chargeur .chargeur {
  position: fixed; inset: 0; z-index: 200; display: grid; place-content: center; justify-items: center; gap: 1.1rem;
  pointer-events: none;
  background: radial-gradient(60% 50% at 50% 46%, rgb(60 34 150 / .55), transparent 70%), #04060f;
  /* Repli sans JS ou si le script tarde : sortie automatique, terminée à 4,5 s (v07.2, plus long). */
  animation: chargeur-sortie .55s ease 3.95s forwards;
}
.chargeur__scene { position: relative; width: clamp(11rem, 36vw, 15rem); aspect-ratio: 1; display: grid; place-items: center; }
.chargeur__hublot {
  position: relative; z-index: 2; width: 80%; aspect-ratio: 1; border-radius: 50%; overflow: hidden;
  -webkit-mask: radial-gradient(closest-side, #000 66%, transparent); mask: radial-gradient(closest-side, #000 66%, transparent);
}
/* Image officielle du héros, agrandie et centrée sur le bébé (aucune retouche). */
.chargeur__bebe { position: absolute; left: -25%; top: -88%; width: 150%; max-width: none; height: auto; }
.chargeur__halo { position: absolute; inset: -18%; border-radius: 50%; z-index: 0; background: radial-gradient(closest-side, rgb(123 60 255 / .55), rgb(79 231 255 / .12) 55%, transparent); }
.chargeur__anneau {
  position: absolute; inset: 0; border-radius: 50%; z-index: 1;
  background: conic-gradient(from 0deg, transparent 0 55%, rgb(79 231 255 / .9) 78%, #fff 80%, transparent 81%);
  -webkit-mask: radial-gradient(closest-side, transparent calc(100% - 2px), #000 calc(100% - 1px)); mask: radial-gradient(closest-side, transparent calc(100% - 2px), #000 calc(100% - 1px));
}
.chargeur__anneau--2 { inset: 9%; background: conic-gradient(from 180deg, transparent 0 60%, rgb(179 156 255 / .85) 82%, transparent 84%); }
.chargeur__mot { margin: 0; font: 300 clamp(1.3rem, 1rem + 1.4vw, 1.9rem)/1 var(--f-display); letter-spacing: .5em; margin-right: -.5em; color: var(--givre); }
.chargeur__ligne { position: relative; width: 9rem; height: 2px; border-radius: 2px; overflow: hidden; background: rgb(160 190 255 / .16); }
.chargeur__ligne i { position: absolute; inset: 0; transform-origin: 0 50%; background: linear-gradient(90deg, var(--ion), var(--lilas)); box-shadow: 0 0 10px var(--ion); scale: .08 1; }
@media (prefers-reduced-motion: no-preference) {
  .motion .chargeur__anneau { animation: chargeur-tour 1.6s linear infinite; }
  .motion .chargeur__anneau--2 { animation-duration: 2.4s; animation-direction: reverse; }
  .motion .chargeur__halo { animation: chargeur-souffle 2.2s ease-in-out infinite; }
  .motion .chargeur__hublot { animation: chargeur-flotte 2.6s ease-in-out infinite; }
  .motion .chargeur__mot { animation: chargeur-mot .9s var(--ease-out) both .1s; }
  .motion .chargeur__ligne i { animation: chargeur-ligne 2.6s cubic-bezier(.2, .7, .2, 1) forwards; }
}
@keyframes chargeur-tour { to { rotate: 360deg; } }
@keyframes chargeur-souffle { 50% { scale: 1.12; opacity: .75; } }
@keyframes chargeur-flotte { 50% { translate: 0 -5px; } }
@keyframes chargeur-mot { from { opacity: 0; translate: 0 8px; } }
@keyframes chargeur-ligne { to { scale: 1 1; } }
@keyframes chargeur-sortie { to { opacity: 0; visibility: hidden; } }
/* Sortie déclenchée par le script dès que la page est prête : le bébé s'élève et le voile se dissipe. */
.avec-chargeur.chargeur-fini .chargeur { animation: chargeur-depart .5s ease forwards; }
@keyframes chargeur-depart { from { opacity: 1; } to { opacity: 0; visibility: hidden; } }
.motion.avec-chargeur.chargeur-fini .chargeur__scene { transition: scale .5s var(--ease), translate .5s var(--ease); scale: 1.15; translate: 0 -8px; }
.motion.avec-chargeur.chargeur-fini .chargeur__ligne i { animation: none; scale: 1 1; transition: scale .3s; }
.avec-chargeur.chargeur-parti .chargeur { display: none; }
/* Mode calme : logo fixe, simple fondu. */
@media (prefers-reduced-motion: reduce) {
  .avec-chargeur .chargeur { animation: chargeur-sortie .4s ease 1s forwards; }
  .chargeur__ligne { display: none; }
}

/* ---------- Sélecteur de langue FR | EN (interrupteur) ---------- */
.langue-switch {
  position: relative; display: inline-grid; grid-template-columns: 1fr 1fr; align-items: center; flex: none;
  width: 6.2rem; min-height: 44px; padding: 4px; border-radius: 999px; text-decoration: none;
  background: rgb(7 11 29 / .7); border: 1px solid var(--trait-fort);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .05);
  font: 600 .8rem/1 var(--f-display); letter-spacing: .14em; color: var(--brume);
  -webkit-tap-highlight-color: transparent;
}
.langue-switch__opt { position: relative; z-index: 2; display: grid; place-items: center; min-height: 34px; margin-right: -.14em; transition: color .3s; }
.langue-switch__pouce {
  position: absolute; z-index: 1; top: 4px; bottom: 4px; left: 4px; width: calc(50% - 4px); border-radius: 999px;
  background: linear-gradient(135deg, rgb(79 231 255 / .9), rgb(123 60 255 / .95));
  box-shadow: 0 0 16px -2px rgb(79 231 255 / .7), inset 0 1px 0 rgb(255 255 255 / .35);
  transition: translate .32s var(--ease), box-shadow .3s;
}
.langue-switch[aria-checked="true"] .langue-switch__pouce { translate: 100% 0; }
/* v07.1 : glissement avant le changement de page, sans toucher à aria-checked. */
.langue-switch.is-bascule[aria-checked="false"] .langue-switch__pouce { translate: 100% 0; }
.langue-switch.is-bascule[aria-checked="true"] .langue-switch__pouce { translate: 0 0; }
.langue-switch[aria-checked="false"] .langue-switch__opt:first-child,
.langue-switch[aria-checked="true"] .langue-switch__opt:nth-child(2) { color: #04060f; }
.fine .langue-switch:hover { border-color: var(--lilas); }
.fine .langue-switch:hover .langue-switch__pouce { box-shadow: 0 0 22px 0 rgb(79 231 255 / .85), inset 0 1px 0 rgb(255 255 255 / .35); }
.langue-switch:focus-visible { outline: 2px solid var(--ion); outline-offset: 3px; }
.langue-switch:active .langue-switch__pouce { scale: .94 .9; }
@media (prefers-reduced-motion: reduce) { .langue-switch__pouce, .langue-switch__opt { transition: none; } }
/* Bureau : après la navigation ; mobile : à côté du bouton Menu, toujours visible. */
.bar .nav { margin-left: auto; }
.bar .langue-switch { order: 2; }
@media (max-width: 71.99rem) {
  .bar .langue-switch { order: 0; margin-left: auto; }
  /* Le menu déroulant est positionné en absolu : la barre tient sur une seule ligne (aucun saut de mise en page). */
  .nav-openable .bar { flex-wrap: nowrap; column-gap: .55rem; }
}
/* Petits écrans : le bouton Menu garde son nom accessible mais n'affiche que son icône (44 x 44). */
@media (max-width: 29.99rem) {
  .nav-toggle > span:first-child { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .nav-openable .nav-toggle { width: 44px; min-width: 44px; flex-shrink: 0; padding: 0; justify-content: center; }
  .langue-switch { width: 5.6rem; }
}

/* ---------- v07.1 : héros mobile, le texte ne touche jamais le dôme ----------
   Sous 30rem, la mention d'Hexterm tient sur une ligne et le clip descend un peu : le haut du dôme reste
   sous la dernière ligne du paragraphe, en FR comme en EN (mesuré de 360 à 414 px). */
@media (max-width: 29.99rem) {
  .hero__parent { font-size: .78rem; gap: .45rem; white-space: nowrap; }
  .hero__parent img { width: 18px; height: 18px; }
  .hero__clip { --clip-top: calc(5svh + 1.5rem); }
}
@media (max-width: 23.99rem) {
  .hero__parent { font-size: .72rem; }
  .hero__sub { font-size: .9rem; }
}
/* Pied de page à 360 px : l'adresse de contact, plus large que sa colonne, élargissait la page de 4 px.
   Elle peut maintenant passer à la ligne au besoin. */
.foot__col a:not(.brand) { max-width: 100%; overflow-wrap: anywhere; }

/* ---------- Centre : dix modèles ---------- */
.centre__nodes li:nth-child(1) .node-chip { --chip-c: hsl(160 75% 60%); }
.centre__nodes li:nth-child(2) .node-chip { --chip-c: hsl(28 90% 68%); }
.centre__nodes li:nth-child(3) .node-chip { --chip-c: hsl(190 90% 64%); }
.centre__nodes li:nth-child(4) .node-chip { --chip-c: hsl(20 85% 68%); }
.centre__nodes li:nth-child(5) .node-chip { --chip-c: hsl(150 70% 60%); }
.centre__nodes li:nth-child(6) .node-chip { --chip-c: hsl(260 90% 76%); }
.centre__nodes li:nth-child(7) .node-chip { --chip-c: hsl(220 90% 72%); }
.centre__nodes li:nth-child(8) .node-chip { --chip-c: hsl(95 70% 58%); }
.centre__nodes li:nth-child(9) .node-chip { --chip-c: hsl(48 95% 62%); }
.centre__nodes li:nth-child(10) .node-chip { --chip-c: hsl(300 80% 76%); }
/* Écran étroit : bébé un peu plus petit, centré sur l'anneau calculé par le script (--cy). */
.centre__stage.is-etroit .centre__core { width: 10.5rem; top: var(--cy, 50%); }
.centre__stage.is-etroit .centre__nodes li { transition: opacity .3s; }
/* Halos : deux ondes lumineuses partent du noyau du bébé. */
.centre__core::before, .centre__core::after {
  content: ""; position: absolute; left: 50%; top: 62%; width: 70%; aspect-ratio: 1; border-radius: 50%; z-index: -1;
  translate: -50% -50%; border: 1px solid rgb(79 231 255 / .45); box-shadow: 0 0 24px rgb(79 231 255 / .25), inset 0 0 18px rgb(123 60 255 / .25);
  opacity: 0; pointer-events: none;
}
@media (prefers-reduced-motion: no-preference) {
  .motion .centre__core::before { animation: onde 4.8s ease-out infinite; }
  .motion .centre__core::after { animation: onde 4.8s ease-out 2.4s infinite; }
  .centre.is-away .centre__core::before, .centre.is-away .centre__core::after { animation-play-state: paused; }
}
@keyframes onde { 0% { opacity: 0; scale: .55; } 15% { opacity: .9; } 100% { opacity: 0; scale: 1.9; } }

/* ---------- Démonstration : six étapes ---------- */
.mission__steps { grid-template-columns: repeat(6, 1fr); }
.mission__steps::before, .mission__steps::after { left: 8.33%; right: 8.33%; }
.mission__log { min-height: 18.5rem; }
@media (max-width: 39.99rem) {
  .mission__steps { grid-template-columns: 1fr; }
  .mission__steps::before, .mission__steps::after { left: 13px; right: auto; }
  .mission__log { min-height: 0; }
}
@media (min-width: 64rem) and (max-width: 79.99rem) { .etape__qui { font-size: .84rem; } .etape__quoi { font-size: .76rem; } }

/* ---------- Studio : six clips ---------- */
.studio__film { grid-template-columns: repeat(6, minmax(0, 1fr)); width: min(100%, 34rem); }
@media (max-width: 29.99rem) { .studio__film { grid-template-columns: repeat(3, minmax(0, 1fr)); width: min(100%, 17rem); } .studio__vignette { aspect-ratio: 9 / 11; } }

/* ---------- Compagnon : vrais clips officiels dans le hublot ---------- */
.compagnon img { transition: rotate .4s var(--ease), scale .3s var(--ease), opacity .35s; }
.compagnon__clip {
  position: absolute; inset: 4px; width: calc(100% - 8px); height: calc(100% - 8px); border-radius: 50%;
  object-fit: cover; opacity: 0; transition: opacity .35s; pointer-events: none;
}
.compagnon.is-clip .compagnon__clip { opacity: 1; }
.compagnon.is-clip img { opacity: 0; }
@media (prefers-reduced-motion: reduce) { .compagnon__clip { display: none; } }

/* ---------- Lueur qui suit le pointeur ou le doigt sur les panneaux ---------- */
.lueur { position: relative; isolation: isolate; }
.lueur::before {
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; pointer-events: none;
  background: radial-gradient(340px circle at var(--gx, 50%) var(--gy, 0%), rgb(79 231 255 / .15), rgb(123 60 255 / .08) 45%, transparent 70%);
  opacity: 0; transition: opacity .4s;
}
.lueur.is-lueur::before { opacity: 1; }
/* Cartes des modèles et des produits : le bord lumineux s'allume aussi au toucher. */
.carte.is-lueur::after { opacity: 1; }

/* ---------- Mouvement : révélations plus nettes, transitions de section (la parallaxe du héros existe déjà, pilotée par v05.js) ---------- */
@media (prefers-reduced-motion: no-preference) {
  .motion [data-reveal]:not([data-reveal="scale"]) { filter: blur(5px); transition-property: opacity, translate, filter; }
  .motion [data-reveal].is-in { filter: none; }
  /* Titres de section : balayage à l'entrée, déclenché par la classe is-in (v05.js) et minuté :
     il finit toujours à l'état complet, même si l'on s'arrête de défiler (v07.1). */
  .motion :is(.securite, .studio, .api, .app, .faq, .modeles) h2[data-kinetic].is-in { animation: titre-voile 1.1s var(--ease-out) both; }
}
@keyframes titre-voile { from { clip-path: inset(-.2em 100% -.2em 0); opacity: .2; } to { clip-path: inset(-.2em -.2em -.2em 0); opacity: 1; } }
/* Compteurs : un éclat quand ils atteignent leur valeur. */
.chiffres__n.is-fini { animation: compte-eclat .9s var(--ease-out); }
@keyframes compte-eclat { 30% { filter: drop-shadow(0 0 14px rgb(79 231 255 / .9)); scale: 1.06; } }

/* Manifeste : l'encre part de zéro sans mesure au démarrage (v05.js la fait avancer dès le premier défilement). */
.motion .manifeste__line { --p: 0; }
.capture .manifeste__line { --p: 1 !important; }

/* ---------- Performance : césure « pretty » retirée (mise en page coûteuse à chaque arrivée de police) ---------- */
.lead, .hero p { text-wrap: wrap; }
h3 { text-wrap: wrap; }

/* ---------- Mode capture et mode calme ---------- */
.capture h2 { animation: none !important; }
.capture [data-reveal] { filter: none !important; }
@media (prefers-reduced-motion: reduce) {
  .centre__core::before, .centre__core::after { display: none; }
  .chiffres__n.is-fini { animation: none; }
}
