/* =========================================================
   Fond interactif — réseau de particules bleues
   Ne capte aucun clic : pointer-events: none
   ========================================================= */

#bg-fx {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  background: #000;
  box-shadow: inset 0 0 22vmax 6vmax rgba(0, 0, 0, 0.75);
  contain: strict;
  --mx: 0;
  --my: 0;
}

/* halos de profondeur, déplacés par la souris en parallaxe */
#bg-fx::before,
#bg-fx::after {
  content: "";
  position: absolute;
  z-index: 0;
  border-radius: 50%;
  filter: blur(72px);
  mix-blend-mode: screen;
  opacity: 0.55;
  will-change: transform;
}

#bg-fx::before {
  width: 62vmax;
  height: 62vmax;
  left: -18vmax;
  top: -24vmax;
  background: radial-gradient(circle at 50% 50%, rgba(34, 211, 238, 0.30), rgba(29, 78, 216, 0.18) 45%, transparent 70%);
  transform: translate3d(calc(var(--mx) * 28px), calc(var(--my) * 28px), 0);
  animation: bgFloatA 28s ease-in-out infinite;
}

#bg-fx::after {
  width: 74vmax;
  height: 74vmax;
  right: -26vmax;
  bottom: -32vmax;
  background: radial-gradient(circle at 50% 50%, rgba(59, 130, 246, 0.28), rgba(14, 165, 233, 0.16) 45%, transparent 70%);
  transform: translate3d(calc(var(--mx) * -34px), calc(var(--my) * -34px), 0);
  animation: bgFloatB 34s ease-in-out infinite;
}

@keyframes bgFloatA {
  0%, 100% { margin-left: 0; margin-top: 0; }
  50% { margin-left: 6vmax; margin-top: 4vmax; }
}

@keyframes bgFloatB {
  0%, 100% { margin-right: 0; margin-bottom: 0; }
  50% { margin-right: 7vmax; margin-bottom: 5vmax; }
}

#bg-canvas {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
}

/* le contenu passe au-dessus du fond */
body > main,
body > footer {
  position: relative;
  z-index: 1;
}

/* mobile : halos plus discrets pour rester lisible */
@media (max-width: 759px) {
  #bg-fx::before,
  #bg-fx::after {
    filter: blur(56px);
    opacity: 0.45;
  }
}

@media (prefers-reduced-motion: reduce) {
  #bg-fx::before,
  #bg-fx::after {
    animation: none;
  }
}

/* =========================================================
   Curseur personnalisé — réticule fin, liseré noir
   ========================================================= */

@media (hover: hover) and (pointer: fine) {
  html,
  body,
  a,
  button,
  input,
  textarea,
  select,
  summary,
  label {
    cursor: none;
  }

  #cur {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 9999;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.18s ease;
  }

  body.cur-on #cur {
    opacity: 1;
  }

  .cur-body {
    position: relative;
    display: block;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border-radius: 50%;
    filter: drop-shadow(0 0 2.2px rgb(0 0 0 / 1)) drop-shadow(0 0 4px rgb(116 192 242 / 0.7));
    transition: transform 0.18s ease, box-shadow 0.18s ease, width 0.16s ease,
      height 0.16s ease, margin 0.16s ease, background 0.16s ease;
  }

  .cur-body::before,
  .cur-body::after {
    content: "";
    position: absolute;
  }

  /* trait horizontal, coupé au centre */
  .cur-body::before {
    left: 0;
    right: 0;
    top: 50%;
    height: 2px;
    margin-top: -1px;
    background: linear-gradient(to right,
      rgb(116 192 242 / 0.95) 0 7px,
      transparent 7px 13px,
      rgb(116 192 242 / 0.95) 13px 20px);
  }

  /* trait vertical, coupé au centre */
  .cur-body::after {
    top: 0;
    bottom: 0;
    left: 50%;
    width: 2px;
    margin-left: -1px;
    background: linear-gradient(to bottom,
      rgb(116 192 242 / 0.95) 0 7px,
      transparent 7px 13px,
      rgb(116 192 242 / 0.95) 13px 20px);
  }

  /* survol d'un élément cliquable : anneau autour du réticule */
  #cur.is-hot .cur-body {
    transform: scale(1.1);
    box-shadow: 0 0 0 9px rgb(116 192 242 / 0.13), 0 0 22px rgb(116 192 242 / 0.34);
  }

  /* champ de saisie : simple caret, liseré noir conservé */
  #cur.is-text .cur-body {
    width: 2px;
    height: 20px;
    margin: -10px 0 0 -1px;
    border-radius: 1px;
    background: rgb(116 192 242 / 0.9);
    box-shadow: 0 0 0 2.5px rgb(0 0 0 / 0.95);
  }

  #cur.is-text .cur-body::before,
  #cur.is-text .cur-body::after {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cur-body {
    transition: none;
  }
}