:root {
  --bg1: #001f3f;
  --bg2: #000000;
  --text: #ffffff;

  --circle-size: clamp(50px, 10vw, 80px);
  --gap: clamp(10px, 2vw, 28px);
  --first-gap: clamp(40px, 5vh, 60px);
  --sub-gap: clamp(25px, 4vh, 40px);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(135deg, var(--bg1), var(--bg2));
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

/* --------- Mise en page principale --------- */
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
}

h1 {
  margin: 0 0 28px;
  font-size: clamp(2em, 6vw, 3em);
  text-transform: uppercase;
  color: var(--text);
}

.circle-container {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: var(--gap);
  flex-wrap: nowrap;
}

.circle-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
  position: relative;
}

/* --------- Ronds --------- */
.circle,
.sub-circle {
  width: var(--circle-size);
  height: var(--circle-size);
  border-radius: 50%;
  border: 2px solid var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  color: var(--text);
  background: rgba(255, 255, 255, 0.1);
  transition: 0.25s ease;
}

.circle {
  font-size: clamp(1em, 2.5vw, 1.3em);
  cursor: pointer;
}

.sub-circle {
  font-size: clamp(0.9em, 2vw, 1.1em);
}

.circle:hover,
.sub-circle:hover {
  background: #ffffff;
  color: var(--bg1);
  transform: scale(1.04);
  box-shadow: 0 0 8px #ffffff;
}

/* --------- Libellés (desktop) --------- */
.circle::after,
.sub-circle::after {
  content: attr(data-name);
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.9em;
  color: var(--text);
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.2s;
}

.circle::after {
  top: calc(100% + 10px);
}

.sub-circle::after {
  top: calc(100% + 10px);
}

.circle:hover::after {
  opacity: 1;
}

.sub-circle:hover::after {
  opacity: 1;
}

/* --------- Apparition des secondaires (desktop) --------- */
.sub-circles {
  display: flex;
  flex-direction: column;
  align-items: center;
  opacity: 0;
  transform: translateY(-10px);
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
}

.circle-group:hover .sub-circles {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.sub-circle:first-child {
  margin-top: var(--first-gap);
}

.sub-circle:not(:first-child) {
  margin-top: var(--sub-gap);
}

/* --------- Décalage du titre (desktop) --------- */
@media (min-width: 769px) {
  main.hero {
    padding-top: 25vh !important;
  }
}

/* ================================================================== */
/* ========================  MODE MOBILE ONLY  ======================= */
/* ================================================================== */
@media (max-width: 768px) {
  * {
    -webkit-tap-highlight-color: transparent;
  }

  /* Centrer verticalement tout le contenu */
  .hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding-top: 0;
  }

  /* Secondaires toujours visibles, en flux normal */
  .sub-circles {
    display: flex;
    opacity: 1;
    transform: none;
    pointer-events: auto;
    position: static;
    gap: 16px; /* écart uniforme entre ronds secondaires */
  }

  /* Réserver de la place SOUS chaque rond pour le libellé */
  .circle,
  .sub-circle {
    position: relative;
    margin-bottom: 0%; /* zone tampon pour le nom */
  }

  /* Libellés : même position pour tous, cachés par défaut */
  .circle::after,
  .sub-circle::after {
    top: calc(100% + 8px) !important;  /* même distance sous le rond */
    font-size: 14px !important;        /* taille fixe (évite variations em) */
    line-height: 1.2 !important;
    color: #ffffff !important;
    opacity: 0 !important;
  }

  /* Afficher le libellé UNIQUEMENT pour l’élément tapé (classe posée par JS) */
  .circle.show-name::after,
  .sub-circle.show-name::after {
    opacity: 1 !important;
  }

  /* Neutraliser :hover desktop en mobile */
  .circle-group:hover .sub-circles {
    opacity: 1;
    transform: none;
    pointer-events: auto;
  }
}
