/* ==========================================================================
   PADC — page d'accueil (route /) — version 3, épurée
   Seuls trois éléments sont animés : le logo (apparition, respiration lente,
   orbite), les pays pilotes (apparition, signal d'émission) et les branches qui
   les relient au logo (tracé, impulsions lumineuses). Les textes sont statiques.
   Le logo reste intact : échelle et opacité uniformes, aucune recoloration.
   Accessibilité : « Mettre en pause les animations » (WCAG 2.2.2), préférence
   « réduire les animations » respectée (tout est alors immobile).
   États : .intro-deja-vue · .intro-terminee · .mouvement-reduit · .animations-en-pause
   ========================================================================== */
.page-accueil { background: var(--surface); }

.accueil {
  position: relative;
  overflow-x: clip;
  padding-bottom: var(--e-8);
  background:
    radial-gradient(ellipse 60% 55% at 50% 32%, var(--vert-50) 0%, rgba(238, 247, 245, 0) 70%),
    var(--surface);
}

/* --- Commande de pause (WCAG 2.2.2) ------------------------------------------ */
.commande-animations {
  position: absolute;
  top: var(--e-3);
  inset-inline-end: var(--gouttiere);
  z-index: 5;
  display: inline-flex;
  align-items: center;
  gap: var(--e-2);
  min-height: 40px;
  padding: 0.35rem 0.85rem;
  border: 1px solid var(--trait-fort);
  border-radius: var(--r-pilule);
  background: rgba(255, 255, 255, 0.94);
  color: var(--encre-2);
  font-size: var(--taille-xs);
  font-weight: 650;
}
.commande-animations:hover { border-color: var(--vert-600); color: var(--vert-900); }
.commande-animations .icone { width: 1.1rem; height: 1.1rem; }
.mouvement-reduit .commande-animations { display: none; }

/* --- Scène : logo au centre, pays de part et d'autre, branches ----------------- */
.hub {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: clamp(1.5rem, 6vw, 6.5rem);
  max-width: 68rem;
  margin: 0 auto;
  padding: var(--e-8) var(--gouttiere) var(--e-6);
}
.hub__branches {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}
.hub__pays { position: relative; z-index: 2; display: grid; gap: var(--e-7); }
.hub__pays--ouest { justify-items: end; text-align: right; }
.hub__pays--est { justify-items: start; text-align: left; }
/* Légère rotation de la composition : les pays ne sont pas alignés au cordeau. */
.hub__pays--ouest .n1 { margin-right: 2.75rem; }
.hub__pays--est .n4 { margin-left: 2.75rem; }
.hub__region {
  margin: 0 0 calc(-1 * var(--e-4));
  color: var(--encre-3);
  font-size: var(--taille-xs);
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}
.hub__region span { display: block; margin-top: 2px; color: var(--vert-700); font-weight: 600; letter-spacing: 0.04em; text-transform: none; }

/* --- Logo ------------------------------------------------------------------------- */
.hub__centre { position: relative; z-index: 2; display: grid; place-items: center; }
.hub__logo { position: relative; width: clamp(9.5rem, 15vw, 13rem); aspect-ratio: 1; }
.hub__image {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: #fff;
  object-fit: cover;
  box-shadow: 0 22px 44px -22px rgba(10, 53, 48, 0.5), 0 0 0 1px var(--trait);
}
.hub__orbite {
  position: absolute;
  inset: -13%;
  border: 1.5px dashed var(--vert-300);
  border-radius: 50%;
}
.hub__satellite {
  position: absolute;
  top: -5px;
  left: 50%;
  width: 10px;
  height: 10px;
  margin-left: -5px;
  border-radius: 50%;
  background: var(--vert-500);
  box-shadow: 0 0 0 4px rgba(38, 154, 135, 0.18);
}
/* Halo quand une impulsion arrive au logo. */
.hub__logo::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: 50%;
  pointer-events: none;
}
.hub__logo.recoit::after { animation: logo-halo 1.1s var(--courbe-sortie); }

/* --- Pays pilotes ---------------------------------------------------------------- */
.pays-noeud {
  position: relative;
  display: inline-grid;
  justify-items: center;
  gap: 2px;
  width: 8.75rem;
  padding: var(--e-2);
  border-radius: var(--r-3);
  color: var(--encre);
  text-align: center;
  text-decoration: none;
}
.pays-noeud:hover { color: var(--encre); }
.pays-noeud__disque {
  display: grid;
  place-items: center;
  width: 5.25rem;
  height: 5.25rem;
  margin-bottom: var(--e-1);
  overflow: hidden;
  border: 2px solid var(--vert-100);
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 10px 24px -14px rgba(10, 53, 48, 0.45);
  transition: border-color var(--duree-moyenne), box-shadow var(--duree-moyenne), transform var(--duree-moyenne) var(--courbe-sortie);
}
.pays-noeud__disque img { width: 86%; height: 86%; object-fit: contain; }
.pays-noeud__nom { font-size: var(--taille-m); font-weight: 700; line-height: 1.2; }
.pays-noeud__compte { color: var(--encre-3); font-size: var(--taille-xs); font-variant-numeric: tabular-nums; }
.pays-noeud__compte strong { color: var(--vert-800); font-size: var(--taille-s); }
.pays-noeud:hover .pays-noeud__disque,
.pays-noeud:focus-visible .pays-noeud__disque,
.pays-noeud.est-active .pays-noeud__disque {
  border-color: var(--vert-500);
  box-shadow: 0 14px 30px -12px rgba(10, 53, 48, 0.55), 0 0 0 6px rgba(38, 154, 135, 0.12);
  transform: translateY(-3px);
}
.pays-noeud.emet .pays-noeud__disque { animation: pays-emet 0.9s var(--courbe-sortie); }

/* --- Branches et impulsions (dessinées par accueil.js) -------------------------------- */
.branche { fill: none; stroke: var(--vert-300); stroke-width: 1.6; stroke-linecap: round; transition: stroke var(--duree-moyenne), stroke-width var(--duree-moyenne); }
.branche--halo { stroke: var(--vert-100); stroke-width: 7; opacity: 0.6; }
.branche.est-active { stroke: var(--vert-600); stroke-width: 2.4; }
.branche.est-tracee { stroke-dasharray: 1; animation: branche-tracer 1.1s var(--courbe-sortie) both; }
.impulsion { pointer-events: none; }
.impulsion__halo { fill: var(--vert-400); opacity: 0.22; }
.impulsion__coeur { fill: var(--vert-600); }

/* --- Texte (statique) ----------------------------------------------------------------- */
.accueil__texte {
  position: relative;
  z-index: 2;
  max-width: 50rem;
  margin: 0 auto;
  padding: var(--e-2) var(--gouttiere) 0;
  text-align: center;
}
.accueil__titre {
  margin: 0 0 var(--e-5);
  color: var(--encre);
  font-family: var(--police-document);
  font-size: clamp(1.5rem, 0.95rem + 2vw, 2.4rem);
  font-weight: 600;
  line-height: 1.18;
}
.accueil__titre span { display: block; color: var(--vert-800); }
.accueil__total {
  display: inline-flex;
  align-items: center;
  gap: var(--e-3);
  margin: 0;
  padding: var(--e-3) var(--e-5) var(--e-3) var(--e-4);
  border: 1px solid var(--vert-100);
  border-radius: var(--r-pilule);
  background: #fff;
  box-shadow: var(--ombre-1);
}
.accueil__total strong {
  color: var(--vert-800);
  font-family: var(--police-titre);
  font-size: clamp(2rem, 1.5rem + 1.6vw, 2.75rem);
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  line-height: 1;
}
.accueil__total span { color: var(--encre-2); font-size: var(--taille-m); font-weight: 600; line-height: 1.3; text-align: start; }
.accueil__perimetre { margin: var(--e-3) 0 var(--e-5); color: var(--encre-3); font-size: var(--taille-s); }
.accueil__action { margin: 0; }
.accueil__bouton { min-width: min(100%, 17rem); font-size: 1.0625rem; letter-spacing: 0.08em; text-transform: uppercase; }

/* --- Petits écrans : même composition, réduite (les branches ne se croisent pas) --------------- */
@media (max-width: 47.99rem) {
  .hub { gap: var(--e-2); padding-top: var(--e-6); }
  .hub__pays { gap: var(--e-5); justify-items: center; text-align: center; }
  .hub__pays .pays-noeud { margin: 0; }
  .hub__region { margin-bottom: 0; font-size: 0.68rem; letter-spacing: 0.05em; }
  .hub__region span { font-size: 0.72rem; }
  .hub__logo { width: clamp(6.5rem, 30vw, 8.5rem); }
  .pays-noeud { width: 100%; max-width: 7rem; padding: var(--e-1); }
  .pays-noeud__disque { width: 3.9rem; height: 3.9rem; }
  .pays-noeud__nom { font-size: var(--taille-s); }
}
@media (max-width: 40rem) {
  .commande-animations { position: static; display: flex; width: max-content; margin: var(--e-3) auto 0; }
  .hub { padding-top: var(--e-5); }
  .accueil__total { flex-direction: column; gap: var(--e-1); padding: var(--e-3) var(--e-5); border-radius: var(--r-4); }
  .accueil__total span { text-align: center; }
  .accueil__bouton { width: 100%; }
}

/* --- Animations (logo, pays, branches uniquement) ------------------------------------------ */
@keyframes logo-entree { from { opacity: 0; transform: scale(0.86); } }
@keyframes logo-respire { 50% { transform: scale(1.025); } }
@keyframes logo-halo { from { box-shadow: 0 0 0 0 rgba(38, 154, 135, 0.45); } to { box-shadow: 0 0 0 30px rgba(38, 154, 135, 0); } }
@keyframes orbite-entree { from { opacity: 0; transform: scale(0.9); } }
@keyframes orbite { to { transform: rotate(360deg); } }
@keyframes pays-entree { from { opacity: 0; transform: translateY(14px) scale(0.9); } }
@keyframes pays-emet {
  from { box-shadow: 0 10px 24px -14px rgba(10, 53, 48, 0.45), 0 0 0 0 rgba(38, 154, 135, 0.4); }
  to { box-shadow: 0 10px 24px -14px rgba(10, 53, 48, 0.45), 0 0 0 16px rgba(38, 154, 135, 0); }
}
@keyframes branche-tracer { from { stroke-dashoffset: 1; } }
@keyframes fondu { from { opacity: 0; } }

.hub__image { animation: logo-entree 0.9s var(--courbe-sortie) both, logo-respire 7s ease-in-out 1.4s infinite; }
.hub__orbite { animation: orbite-entree 0.8s ease 0.45s both, orbite 50s linear 1.25s infinite; }
.pays-noeud { animation: pays-entree 0.7s var(--courbe-sortie) both; }
.pays-noeud.n1 { animation-delay: 0.45s; }
.pays-noeud.n2 { animation-delay: 0.57s; }
.pays-noeud.n3 { animation-delay: 0.69s; }
.pays-noeud.n4 { animation-delay: 0.81s; }
.pays-noeud.emet { animation: none; }

/* Visites suivantes : fondu court. */
.intro-deja-vue .hub__image { animation: fondu 0.35s ease both, logo-respire 7s ease-in-out 1s infinite; }
.intro-deja-vue .hub__orbite { animation: fondu 0.35s ease both, orbite 50s linear 0.35s infinite; }
.intro-deja-vue .pays-noeud { animation: fondu 0.35s ease both; }
/* Interaction clavier pendant l'introduction : état final immédiat. */
.intro-terminee .pays-noeud { animation: none; }
.intro-terminee .branche.est-tracee { animation: none; }

.animations-en-pause .hub__image,
.animations-en-pause .hub__orbite { animation-play-state: paused; }

.mouvement-reduit .hub *,
.mouvement-reduit .hub *::after { animation: none !important; transition: none !important; }

@media print {
  .hub__branches, .hub__orbite, .commande-animations, .evitement { display: none !important; }
  .accueil * { animation: none !important; }
}

/* --- Arabe : la scene garde l'orientation de la carte (Afrique de l'Ouest a gauche),
   seuls les textes se lisent de droite a gauche. ---------------------------------------- */
[dir="rtl"] .hub { direction: ltr; }
[dir="rtl"] .hub__region,
[dir="rtl"] .pays-noeud__nom,
[dir="rtl"] .pays-noeud__compte { direction: rtl; unicode-bidi: isolate; }
