.mathesis-constellation{
  --constellation-line:
    rgba(250,249,246,.22);

  --constellation-line-strong:
    rgba(212,175,55,.78);

  --constellation-text:
    var(--neutral);

  width:100%;

  min-height:320px;

  overflow:visible;

  opacity:0;

  transition:
    opacity .35s ease;
}


.mathesis-constellation.is-ready{
  opacity:1;
}


.mathesis-constellation.has-error{
  opacity:.35;
}


/*
 * Variante utilisable
 * sur un fond clair.
 */
.mathesis-constellation[
  data-theme="light"
]{
  --constellation-line:
    rgba(0,41,88,.2);

  --constellation-text:
    var(--blue);
}


/* =========================
   ARÊTES
   ========================= */

.constellation__edge{
  fill:none;

  stroke:
    var(--constellation-line);

  stroke-width:
    1.6;

  stroke-linecap:
    round;

  transition:
    opacity .2s ease,
    stroke .2s ease,
    stroke-width .2s ease;
}


.constellation__edge.is-mastered{
  stroke:
    var(--constellation-line-strong);

  stroke-width:
    2;
}


/* =========================
   NŒUDS
   ========================= */

.constellation__node{
  cursor:pointer;

  outline:none;

  transition:
    opacity .2s ease;
}


.constellation__core{
  fill:
    var(--blue);

  stroke:
    var(--neutral);

  stroke-width:
    1.5;

  transition:
    fill .2s ease,
    stroke .2s ease,
    filter .2s ease;
}


.constellation__halo{
  fill:none;

  stroke:
    var(--neutral);

  opacity:.1;

  transition:
    opacity .2s ease,
    stroke .2s ease,
    transform .2s ease;

  transform-box:
    fill-box;

  transform-origin:
    center;
}


.constellation__halo--inner{
  stroke-width:
    1.2;
}


.constellation__halo--outer{
  stroke-width:
    1;
}


/* =========================
   ACCESSIBLE
   ========================= */

.constellation__node[
  data-state="accessible"
]
.constellation__core{
  fill:
    var(--blue-2);
}


.constellation__node[
  data-state="accessible"
]
.constellation__halo--inner{
  stroke:
    var(--neutral);

  opacity:.24;
}


/* =========================
   ACQUIS
   ========================= */

.constellation__node[
  data-state="acquired"
]
.constellation__core,

.constellation__node[
  data-state="consolidated"
]
.constellation__core{
  fill:
    var(--gold);
}


.constellation__node[
  data-state="acquired"
]
.constellation__halo--inner{
  stroke:
    var(--gold);

  opacity:.5;
}


/* =========================
   CONSOLIDÉ
   ========================= */

.constellation__node[
  data-state="consolidated"
]
.constellation__halo--inner{
  stroke:
    var(--gold);

  opacity:.72;
}


.constellation__node[
  data-state="consolidated"
]
.constellation__halo--outer{
  stroke:
    var(--gold);

  opacity:.32;
}


/* =========================
   NOTION ACTUELLE
   ========================= */

.constellation__node.is-current
.constellation__halo--outer{
  stroke:
    var(--gold);

  opacity:.72;

  animation:
    mathesis-breathe
    3.8s
    ease-in-out
    infinite;
}


/* =========================
   HOVER / FOCUS
   ========================= */

.constellation__node:hover
.constellation__core,

.constellation__node:focus-visible
.constellation__core{
  filter:
    drop-shadow(
      0 0 7px
      rgba(212,175,55,.55)
    );
}


/* =========================
   LABELS
   ========================= */

.constellation__label{
  fill:
    var(--constellation-text);

  font-family:
    Poppins,
    sans-serif;

  font-size:
    12px;

  font-weight:
    500;

  text-anchor:
    middle;

  opacity:
    0;

  pointer-events:
    none;

  transition:
    opacity .16s ease;
}


.mathesis-constellation[
  data-labels="always"
]
.constellation__label,

.constellation__node:hover
.constellation__label,

.constellation__node:focus-visible
.constellation__label{
  opacity:.88;
}


/* =========================
   VOISINAGE
   ========================= */

.constellation__node.is-dimmed,
.constellation__edge.is-dimmed{
  opacity:.13;
}


/* =========================
   RESPIRATION
   ========================= */

@keyframes mathesis-breathe{

  0%,
  100%{
    transform:
      scale(.94);

    opacity:
      .45;
  }


  50%{
    transform:
      scale(1.08);

    opacity:
      .78;
  }

}


/* =========================
   ACCESSIBILITÉ
   ========================= */

@media (
  prefers-reduced-motion:reduce
){

  .constellation__node.is-current
  .constellation__halo--outer{
    animation:none;
  }


  .mathesis-constellation,
  .constellation__edge,
  .constellation__node,
  .constellation__core,
  .constellation__halo,
  .constellation__label{
    transition:none;
  }

}