/*
 * Interactive network diagram, shared by the home page and the « Plan »
 * variant (behaviour in network.js). Six voices of an organisation and the
 * cross-reading at the centre. Dark blue, light blue and an orange spark.
 */
.intro-visual {
  --net-orange: #e8833a;
  --net-blue: #1e78c8;
}

/* Network illustration: the organisation, its people and one signal. */
.intro-visual svg {
  display: block;
  width: 100%;
  max-width: 460px;
  height: auto;
  margin-inline: auto;
  overflow: visible;
}
.net-lines path {
  fill: none;
  stroke: #9dbde0;
  stroke-width: 1.5;
  stroke-dasharray: 420;
  stroke-dashoffset: 0;
}
.net-node {
  fill: #e5eef8;
  stroke: #7fa6cf;
  stroke-width: 1.3;
}
.net-core {
  fill: #0e2747;
}
.net-plus {
  stroke: #fff;
  stroke-width: 2.6;
  stroke-linecap: round;
}
.net-pulse {
  fill: none;
  stroke: var(--net-orange);
  stroke-width: 2;
  transform-box: fill-box;
  transform-origin: center;
  animation: net-pulse 3.2s cubic-bezier(0.22, 1, 0.36, 1) infinite;
}
.net-spark {
  fill: var(--net-orange);
}
@keyframes net-pulse {
  0% {
    opacity: 0.9;
    transform: scale(0.75);
  }
  100% {
    opacity: 0;
    transform: scale(1.7);
  }
}
@keyframes net-draw {
  from {
    stroke-dashoffset: 420;
  }
}
.motion-on .net-lines path {
  animation: net-draw 1.6s cubic-bezier(0.22, 1, 0.36, 1) 0.4s both;
}
.motion-on .net-node,
.motion-on .net-core {
  animation: mp-rise 800ms cubic-bezier(0.22, 1, 0.36, 1) 0.9s both;
}
html.dark-theme .net-node {
  fill: #142941;
  stroke: #3d638b;
}
html.dark-theme .net-lines path {
  stroke: #345779;
}
html.dark-theme .net-core {
  fill: #58a8f5;
}
html.dark-theme .net-plus {
  stroke: #080f1c;
}

/* ---------- Reduced motion: the loops stop ---------- */
@media (prefers-reduced-motion: reduce) {
  .net-pulse {
    animation: none !important;
  }
}
html.reduce-motion .net-pulse {
  animation: none !important;
}

/* ---------- Interactive network (see network.js) ---------- */
.intro-visual {
  margin: 0;
}
.net-hit {
  fill: transparent;
  stroke: none;
}
.net-item,
.net-center {
  cursor: pointer;
  outline: none;
}
.net-item {
  transform-box: fill-box;
  transform-origin: center;
  transition: transform 350ms cubic-bezier(0.22, 1, 0.36, 1);
}
.net-item .net-node,
.net-lines path {
  transition:
    fill 250ms ease,
    stroke 250ms ease,
    stroke-width 250ms ease,
    opacity 250ms ease;
}
.has-active .net-lines path:not(.is-active) {
  opacity: 0.45;
}
.net-lines path.is-active {
  stroke: #0e2747;
  stroke-width: 2.4;
}
.net-item.is-active {
  transform: scale(1.18);
}
.net-item.is-active .net-node {
  fill: #ffffff;
  stroke: #0e2747;
  stroke-width: 2;
}
.net-item:focus-visible .net-node,
.net-center:focus-visible .net-core {
  stroke: var(--net-orange);
  stroke-width: 3;
}
.net-center {
  transform-box: fill-box;
  transform-origin: center;
  transition: transform 300ms cubic-bezier(0.22, 1, 0.36, 1);
}
.net-center:hover {
  transform: scale(1.06);
}
.net-center.is-hit {
  animation: net-hit 600ms cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes net-hit {
  35% {
    transform: scale(1.12);
  }
}
.net-center.is-hit .net-core {
  fill: var(--net-blue);
  transition: fill 120ms ease;
}
.net-signal {
  fill: var(--net-orange);
  opacity: 0;
  pointer-events: none;
}
.net-signal.is-moving {
  opacity: 1;
}
.net-caption {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2px 8px;
  max-width: 26em;
  min-height: 3.2em;
  margin: 12px auto 0;
  text-align: center;
  font-size: var(--fs-small);
  line-height: 1.5;
  color: var(--muted);
}
.net-caption strong {
  font-weight: 600;
  color: var(--ink);
}
html.dark-theme .net-lines path.is-active {
  stroke: #f2f6fc;
}
html.dark-theme .net-item.is-active .net-node {
  fill: #080f1c;
  stroke: #f2f6fc;
}
@media (prefers-reduced-motion: reduce) {
  .net-item,
  .net-center {
    transition: none;
  }
  .net-center.is-hit {
    animation: none;
  }
}
html.reduce-motion .net-center.is-hit {
  animation: none;
}

/* ---------- Site map: one named branch per menu entry ---------- */
.intro-visual {
  --net-size: 620px;
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, var(--net-size));
  justify-content: center;
  padding-inline: clamp(8px, 4%, 36px);
}
.intro-visual svg,
.net-links {
  grid-area: 1 / 1;
}
.intro-visual svg {
  width: 100%;
  max-width: none;
}
.net-links {
  position: relative;
  pointer-events: none;
}
.net-caption {
  grid-row: 2;
}
.net-link {
  position: absolute;
  left: var(--x);
  top: var(--y);
  pointer-events: auto;
  padding: 5px 11px;
  border-radius: 999px;
  background: rgb(255 255 255 / 0.9);
  border: 1px solid #c9d8ea;
  font-size: clamp(13px, 1.15vw, 15px);
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  color: #0e2747;
  transition:
    background-color 200ms ease,
    color 200ms ease,
    border-color 200ms ease;
}
.net-link--above {
  transform: translate(-50%, -100%);
}
.net-link--above-start {
  transform: translate(-30%, -100%);
}
.net-link--right {
  transform: translate(0, -50%);
}
.net-link--below {
  transform: translate(-50%, 0);
}
.net-link--below-start {
  transform: translate(-30%, 0);
}
.net-link--below-end {
  transform: translate(-70%, 0);
}
.net-link:hover,
.net-link.is-active {
  background: #0e2747;
  border-color: #0e2747;
  color: #ffffff;
}
.net-link:focus-visible {
  outline: 3px solid var(--net-orange);
  outline-offset: 2px;
}
.net-item {
  cursor: pointer;
}
html.dark-theme .net-link {
  background: rgb(8 15 28 / 0.88);
  border-color: #3d638b;
  color: #f2f6fc;
}
html.dark-theme .net-link:hover,
html.dark-theme .net-link.is-active {
  background: #f2f6fc;
  border-color: #f2f6fc;
  color: #080f1c;
}
@media (max-width: 900px) {
  .intro-visual {
    --net-size: 520px;
  }
}
@media (max-width: 600px) {
  .intro-visual {
    --net-size: 400px;
    padding-inline: 0;
  }
  .net-link {
    padding: 4px 8px;
  }
}

/* Page names stay hidden: they appear when a branch is hovered, focused,
   tapped once, or briefly when a branch lights up on its own. */
.net-link {
  opacity: 0;
  translate: 0 4px;
  transition:
    opacity 250ms ease,
    translate 300ms cubic-bezier(0.22, 1, 0.36, 1),
    background-color 200ms ease,
    color 200ms ease,
    border-color 200ms ease;
}
.net-link.is-active,
.net-link.is-teased,
.net-link:focus-visible {
  opacity: 1;
  translate: 0 0;
}
.net-link.is-teased:not(.is-active) {
  background: rgb(255 255 255 / 0.95);
  border-color: #c9d8ea;
  color: #0e2747;
}
html.dark-theme .net-link.is-teased:not(.is-active) {
  background: rgb(8 15 28 / 0.9);
  border-color: #3d638b;
  color: #f2f6fc;
}
@media (prefers-reduced-motion: reduce) {
  .net-link {
    translate: none;
    transition: none;
  }
}
html.reduce-motion .net-link {
  translate: none;
  transition: none;
}

/* ---------- Page transition from a point of the site map ---------- */
.page-wipe {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  background: #0e2747;
  clip-path: circle(0 at 50% 50%);
  pointer-events: none;
}
.page-wipe span {
  padding: 0 24px;
  text-align: center;
  font: italic clamp(40px, 7vw, 96px) / 1 var(--serif, "Instrument Serif", Georgia, serif);
  color: #ffffff;
  opacity: 0;
}
html.wipe-in::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: #0e2747;
  pointer-events: none;
  animation: wipe-reveal 650ms cubic-bezier(0.65, 0, 0.35, 1) 80ms forwards;
}
@keyframes wipe-reveal {
  to {
    opacity: 0;
    visibility: hidden;
  }
}
@media (prefers-reduced-motion: reduce) {
  html.wipe-in::after {
    display: none;
  }
}
html.reduce-motion.wipe-in::after {
  display: none;
}

/* Clicking inside the diagram must not frame the whole picture: keyboard
   focus is shown on each point, the centre and the page names instead. */
.intro-visual svg:focus,
.intro-visual svg:focus-visible {
  outline: none;
}

/* Small phones: the two lower names would leave the screen when centred,
   so they shift toward the inside just enough. */
@media (max-width: 420px) {
  .net-link[data-node="qui-sommes-nous"] {
    transform: translate(-72%, 0);
  }
  .net-link[data-node="cas-pratiques"] {
    transform: translate(-28%, 0);
  }
}
