/* ============================================================
   Psychopedia · Galaxie des formations
   ============================================================ */

:root {
  --navy: #1E2A3A;
  --corail: #FF4B39;
  --vert: #2D7A6B;
  --orange: #D9882B;

  --bg-deep:   #0B1220;
  --bg-mid:    #15233a;
  --bg-soft:   #1f3050;

  --ink:       #e8eef9;
  --ink-soft:  #b8c2d3;
  --ink-mute:  #7a8597;

  --radius-lg: 22px;
  --radius-md: 14px;

  --ease-soft: cubic-bezier(.22, 1, .36, 1);
  --ease-pop:  cubic-bezier(.34, 1.56, .64, 1);

  --shadow-soft: 0 18px 60px rgba(0,0,0,.35);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html, body { width: 100%; }
body {
  min-height: 100vh;
  font-family: 'Satoshi', system-ui, -apple-system, sans-serif;
  background: radial-gradient(ellipse at 30% 20%, #1b2a4a 0%, var(--bg-deep) 55%, #050912 100%);
  color: var(--ink);
  overflow-x: hidden;
  position: relative;
}

/* ---- Étoiles d'arrière-plan ---- */
.stars {
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    radial-gradient(1px 1px at 12% 18%, rgba(255,255,255,.7), transparent 50%),
    radial-gradient(1px 1px at 24% 76%, rgba(255,255,255,.5), transparent 50%),
    radial-gradient(1.4px 1.4px at 38% 32%, rgba(255,255,255,.8), transparent 50%),
    radial-gradient(1px 1px at 52% 12%, rgba(255,255,255,.55), transparent 50%),
    radial-gradient(1px 1px at 64% 84%, rgba(255,255,255,.45), transparent 50%),
    radial-gradient(1.6px 1.6px at 78% 44%, rgba(255,255,255,.7), transparent 50%),
    radial-gradient(1px 1px at 88% 62%, rgba(255,255,255,.5), transparent 50%),
    radial-gradient(1px 1px at 8% 56%, rgba(255,255,255,.4), transparent 50%),
    radial-gradient(1px 1px at 44% 92%, rgba(255,255,255,.4), transparent 50%);
  animation: twinkle 6s ease-in-out infinite alternate;
}
@keyframes twinkle {
  from { opacity: .55; }
  to   { opacity: .95; }
}

/* ---- Top bar ---- */
.topbar {
  position: relative; z-index: 5;
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px 28px;
  gap: 16px;
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.brand-logo {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: white;
  padding: 4px;
  box-shadow: 0 0 0 2px rgba(255,255,255,.15), 0 6px 16px rgba(0,0,0,.45);
}
.brand-name { font-weight: 700; font-size: 18px; letter-spacing: .2px; }

.topbar-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.link-pill {
  display: inline-flex; align-items: center;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 13px; font-weight: 500;
  text-decoration: none;
  background: rgba(255,255,255,.08);
  color: var(--ink);
  border: 1px solid rgba(255,255,255,.12);
  backdrop-filter: blur(8px);
  transition: background .25s var(--ease-soft), transform .25s var(--ease-soft);
}
.link-pill:hover { background: rgba(255,255,255,.16); transform: translateY(-1px); }
.link-pill--ghost { background: transparent; }

/* ---- Galaxy ---- */
.galaxy {
  position: relative; z-index: 1;
  display: flex; flex-direction: column; align-items: center;
  padding: 12px 20px 80px;
  min-height: calc(100vh - 80px);
}

.galaxy-intro {
  text-align: center;
  max-width: 720px;
  margin: 6px auto 24px;
  padding: 0 12px;
}
.galaxy-intro h1 {
  font-size: clamp(28px, 4.4vw, 44px);
  font-weight: 700;
  letter-spacing: -.4px;
  background: linear-gradient(90deg, #fff, #cdd6e9);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.galaxy-intro p {
  margin-top: 10px;
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1.55;
}

/* ---- Stage : zone où vivent les planètes ---- */
.galaxy-stage {
  position: relative;
  width: min(1080px, 100%);
  height: min(720px, 75vh);
  margin: 8px auto 0;
}

/* Lignes orbitales SVG */
.orbits {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 1;
}

/* Centre : core Psychopedia */
.core {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: 96px; height: 96px;
  border-radius: 50%;
  background: white;
  border: 0;
  cursor: pointer;
  z-index: 6;
  display: grid; place-items: center;
  box-shadow:
    0 0 0 6px rgba(255,255,255,.05),
    0 0 0 14px rgba(255,255,255,.03),
    0 0 60px rgba(255,75,57,.45),
    0 20px 50px rgba(0,0,0,.55);
  animation: pulse 4.5s ease-in-out infinite;
  transition: transform .35s var(--ease-pop);
}
.core:hover { transform: translate(-50%, -50%) scale(1.06); }
.core img { width: 78%; height: 78%; object-fit: contain; }
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 6px rgba(255,255,255,.05), 0 0 0 14px rgba(255,255,255,.03), 0 0 60px rgba(255,75,57,.45), 0 20px 50px rgba(0,0,0,.55); }
  50%      { box-shadow: 0 0 0 8px rgba(255,255,255,.08), 0 0 0 18px rgba(255,255,255,.05), 0 0 90px rgba(255,75,57,.55), 0 20px 50px rgba(0,0,0,.55); }
}

/* ---- Planètes (4 axes) ---- */
.planet {
  position: absolute;
  left: 50%; top: 50%;
  width: 156px; height: 156px;
  border-radius: 50%;
  border: 0;
  cursor: pointer;
  z-index: 4;
  display: grid; place-items: center;
  font-family: inherit;
  color: white;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0;
  text-align: center;
  padding: 16px;
  line-height: 1.2;
  transition: left .55s var(--ease-pop), top .55s var(--ease-pop), transform .45s var(--ease-pop), box-shadow .35s var(--ease-soft), opacity .35s var(--ease-soft), filter .35s var(--ease-soft);
  box-shadow:
    inset 0 -10px 25px rgba(0,0,0,.35),
    inset 0 8px 18px rgba(255,255,255,.15),
    0 0 30px var(--planet-glow, rgba(255,75,57,.5)),
    0 18px 36px rgba(0,0,0,.45);
  background: radial-gradient(circle at 30% 25%, var(--planet-light), var(--planet-color) 65%, var(--planet-dark) 100%);
}
.planet:hover, .planet:focus-visible {
  transform: scale(1.08);
  outline: none;
  box-shadow:
    inset 0 -10px 25px rgba(0,0,0,.35),
    inset 0 8px 18px rgba(255,255,255,.2),
    0 0 60px var(--planet-glow),
    0 18px 36px rgba(0,0,0,.55);
}
.planet-label {
  display: block;
  text-shadow: 0 2px 8px rgba(0,0,0,.55);
}
.planet-count {
  margin-top: 4px;
  display: block;
  font-size: 11.5px;
  font-weight: 500;
  opacity: .9;
}
/* Badge « Cliquez ici » sur chaque planète */
.planet-cta {
  display: inline-block;
  margin-top: 10px;
  padding: 5px 12px;
  background: rgba(255,255,255,.95);
  color: #1E2A3A;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .3px;
  text-transform: uppercase;
  border-radius: 999px;
  box-shadow: 0 2px 8px rgba(0,0,0,.4);
  animation: planet-cta-pulse 1.8s var(--ease-soft) infinite;
  transition: opacity .25s var(--ease-soft);
}
@keyframes planet-cta-pulse {
  0%, 100% { transform: scale(1); box-shadow: 0 2px 8px rgba(0,0,0,.4), 0 0 0 0 rgba(255,255,255,.55); }
  50%      { transform: scale(1.06); box-shadow: 0 2px 10px rgba(0,0,0,.45), 0 0 0 8px rgba(255,255,255,0); }
}
/* En plein écran, on masque le CTA (l'utilisateur a déjà cliqué) */
.galaxy-stage.is-expanded .planet-cta { opacity: 0; pointer-events: none; }

/* ---- Tuiles formations en orbite ---- */
.formation-tile {
  position: absolute;
  left: 50%; top: 50%;
  width: 58px; height: 58px;
  border-radius: 50%;
  border: 3px solid var(--tile-ring, rgba(255,255,255,.3));
  background: #1a253b center/cover no-repeat;
  cursor: pointer;
  z-index: 3;
  /* overflow visible pour laisser le label dépasser en dessous */
  overflow: visible;
  box-shadow:
    0 0 0 2px rgba(0,0,0,.4),
    0 6px 18px rgba(0,0,0,.5);
  transition:
    left .55s var(--ease-pop),
    top .55s var(--ease-pop),
    transform .3s var(--ease-pop),
    border-color .25s var(--ease-soft),
    box-shadow .3s var(--ease-soft),
    opacity .35s var(--ease-soft),
    filter .35s var(--ease-soft);
}

/* Indicateur « Cliquez ici » à l'intérieur de la bulle au hover */
.formation-tile-hint {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .3px;
  text-transform: uppercase;
  color: white;
  background: rgba(10, 16, 28, .68);
  backdrop-filter: blur(1px);
  -webkit-backdrop-filter: blur(1px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s var(--ease-soft);
  z-index: 2;
}
.formation-tile:hover .formation-tile-hint,
.formation-tile:focus-visible .formation-tile-hint { opacity: 1; }

/* Label en caption sous la bulle (desktop uniquement) */
.formation-tile-label {
  position: absolute;
  top: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  width: 110px;
  font-size: 10.5px;
  font-weight: 600;
  line-height: 1.2;
  color: rgba(255,255,255,.92);
  text-align: center;
  text-shadow: 0 1px 3px rgba(0,0,0,.85), 0 0 8px rgba(0,0,0,.6);
  pointer-events: none;
  letter-spacing: 0;
  /* limite à 2 lignes pour rester compact */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  /* Caché par défaut — révélé au hover ou en mode plein écran (axe sélectionné) */
  opacity: 0;
  transition: opacity .25s var(--ease-soft);
}
/* Au hover d'une tuile, on montre son label (même hors plein écran) */
.formation-tile:hover .formation-tile-label,
.formation-tile:focus-visible .formation-tile-label {
  opacity: 1;
}
/* En mode plein écran, tous les labels de l'axe affiché sont visibles en permanence */
.galaxy-stage.is-expanded .formation-tile:not(.is-hidden-axis) .formation-tile-label {
  opacity: 1;
}
.formation-tile:hover .formation-tile-label,
.formation-tile:focus-visible .formation-tile-label {
  color: white;
  text-shadow: 0 1px 3px rgba(0,0,0,.95), 0 0 12px var(--tile-ring);
}
.formation-tile:hover, .formation-tile:focus-visible {
  transform: scale(1.18);
  outline: none;
  border-color: white;
  z-index: 5;
  box-shadow:
    0 0 0 2px rgba(0,0,0,.4),
    0 0 24px var(--tile-ring),
    0 14px 30px rgba(0,0,0,.65);
}
.formation-tile.is-dim {
  opacity: .18;
  filter: grayscale(.6) blur(.5px);
  pointer-events: none;
}
.formation-tile.is-highlight {
  z-index: 5;
  border-color: white;
}

/* ---- Composition de modules : bulle englobante + composants ---- */
.composition-bubble {
  position: absolute;
  pointer-events: none;
  border-radius: 50%;
  border: 2px dashed var(--bubble-color, rgba(255,255,255,.5));
  background: radial-gradient(circle at 50% 30%,
    color-mix(in srgb, var(--bubble-color, #fff) 14%, transparent),
    color-mix(in srgb, var(--bubble-color, #fff) 4%, transparent) 70%,
    transparent 100%);
  box-shadow:
    inset 0 0 60px color-mix(in srgb, var(--bubble-color, #fff) 22%, transparent),
    0 0 40px color-mix(in srgb, var(--bubble-color, #fff) 28%, transparent);
  opacity: 0;
  transform: scale(.85);
  transform-origin: center;
  transition: opacity .35s var(--ease-soft), transform .45s var(--ease-pop);
  z-index: 2;
}
.composition-bubble.is-visible {
  opacity: 1;
  transform: scale(1);
}
.composition-bubble-label {
  position: absolute;
  top: 14px; left: 0; right: 0;
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .8px;
  text-transform: uppercase;
  color: var(--bubble-color, white);
  text-shadow: 0 2px 8px rgba(0,0,0,.7);
  opacity: .9;
}

/* La tuile principale d'un module composé, en survol, monte d'un cran */
.formation-tile.is-composed-host {
  z-index: 7;
  border-color: white;
  box-shadow:
    0 0 0 2px rgba(0,0,0,.4),
    0 0 30px var(--tile-ring),
    0 14px 30px rgba(0,0,0,.65);
}
/* Les composants se révèlent au-dessus */
.formation-tile.is-component {
  z-index: 6;
  border-color: white;
  opacity: 1 !important;
  filter: none !important;
  pointer-events: auto;
}
/* Les autres tuiles s'estompent légèrement quand une composition est affichée */
.formation-tile.is-faded-by-composition {
  opacity: .25;
  filter: grayscale(.4);
}

/* Mode plein écran : on cache complètement les axes non actifs (planètes + tuiles) */
.formation-tile.is-hidden-axis,
.planet.is-hidden-axis {
  opacity: 0 !important;
  pointer-events: none !important;
  transform: translate(-50%, -50%) scale(.6) !important;
  transition: opacity .35s ease, transform .45s cubic-bezier(.6,.05,.28,1);
}

/* En mode plein écran, le core (logo central Psychopedia) est masqué
   car la planète active vient prendre sa place */
.galaxy-stage.is-expanded .core {
  opacity: 0;
  pointer-events: none;
  transition: opacity .35s ease;
}

/* ---- Légende / filtres ---- */
.legend {
  position: fixed;
  bottom: 22px; left: 22px;
  display: flex; flex-direction: column; gap: 6px;
  padding: 12px;
  background: rgba(11,18,32,.7);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: var(--radius-md);
  backdrop-filter: blur(14px);
  z-index: 8;
}
.legend-item {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 12px;
  background: transparent;
  border: 0;
  border-radius: 999px;
  color: var(--ink-soft);
  font-family: inherit; font-size: 13px; font-weight: 500;
  cursor: pointer;
  transition: background .2s var(--ease-soft), color .2s var(--ease-soft);
}
.legend-item:hover { background: rgba(255,255,255,.08); color: var(--ink); }
.legend-item.is-active { background: rgba(255,255,255,.14); color: white; }
.legend-dot {
  width: 12px; height: 12px;
  border-radius: 50%;
  box-shadow: inset 0 -2px 4px rgba(0,0,0,.3);
}

/* ---- Tooltip ---- */
.tooltip {
  position: fixed;
  z-index: 50;
  width: 280px;
  background: rgba(15,22,38,.96);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(14px);
  pointer-events: none;
  opacity: 0;
  transform: translateY(6px) scale(.96);
  transition: opacity .2s var(--ease-soft), transform .2s var(--ease-soft);
  overflow: hidden;
}
.tooltip.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}
.tooltip-image {
  height: 130px;
  background: #0a1322;
}
.tooltip-image img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tooltip-body { padding: 14px 16px 16px; }
.tooltip-body h3 {
  font-size: 14px; font-weight: 700;
  line-height: 1.3;
  color: white;
}
.tooltip-body p {
  margin-top: 6px;
  font-size: 12.5px; color: var(--ink-soft); line-height: 1.5;
}
.tooltip-meta {
  margin-top: 10px; display: flex; gap: 10px;
  font-size: 12px; color: var(--ink-mute);
}
.tooltip-meta span:first-child::before { content: "⏱ "; opacity: .7; }
.tooltip-meta span:last-child::before  { content: "€ "; opacity: .7; }
.tooltip-cta {
  margin-top: 8px;
  font-size: 11.5px; color: var(--corail);
  font-weight: 600;
}

/* ---- Modale détail ---- */
.modal-overlay {
  position: fixed; inset: 0;
  z-index: 100;
  display: grid; place-items: center;
  background: rgba(5, 9, 18, .82);
  backdrop-filter: blur(8px);
  padding: 20px;
  animation: fadeIn .25s var(--ease-soft) both;
}
@keyframes fadeIn { from {opacity:0;} to {opacity:1;} }

.modal {
  position: relative;
  width: 100%; max-width: 580px;
  background: white;
  color: var(--navy);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(0,0,0,.6);
  animation: popIn .35s var(--ease-pop) both;
  max-height: 90vh;
  overflow-y: auto;
}
@keyframes popIn {
  from { opacity: 0; transform: translateY(20px) scale(.95); }
  to   { opacity: 1; transform: translateY(0)    scale(1);    }
}

.modal-image {
  height: 220px;
  background-color: #f0f2f7;
  background-position: center; background-size: cover; background-repeat: no-repeat;
}
.modal-content { padding: 24px 28px 28px; }
.modal-close {
  position: absolute; top: 12px; right: 14px;
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 0;
  background: rgba(255,255,255,.85);
  color: var(--navy);
  font-size: 22px; line-height: 1;
  cursor: pointer;
  z-index: 2;
  transition: background .2s var(--ease-soft), transform .2s var(--ease-soft);
}
.modal-close:hover { background: white; transform: rotate(90deg); }

.modal-category {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px; font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .8px;
  background: rgba(255,75,57,.12);
  color: var(--corail);
  margin-bottom: 12px;
}
.modal h2 {
  font-size: 22px;
  line-height: 1.25;
  font-weight: 700;
  color: var(--navy);
}
.modal-content > p {
  margin-top: 10px;
  color: #4b5566;
  font-size: 14.5px;
  line-height: 1.6;
}
.modal-info {
  margin: 18px 0 22px;
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px 18px;
  padding: 14px;
  background: #f4f6fa;
  border-radius: var(--radius-md);
}
.modal-info > div { font-size: 13px; }
.modal-info dt {
  font-weight: 600;
  font-size: 11px;
  letter-spacing: .5px;
  text-transform: uppercase;
  color: #7a8597;
  margin-bottom: 2px;
}
.modal-info dd { color: var(--navy); font-weight: 600; }
.modal-cta {
  display: inline-flex; align-items: center; justify-content: center;
  width: 100%;
  padding: 14px 20px;
  border-radius: 12px;
  background: var(--corail);
  color: white;
  text-decoration: none;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: .2px;
  transition: background .2s var(--ease-soft), transform .15s var(--ease-soft), box-shadow .2s var(--ease-soft);
  box-shadow: 0 10px 24px rgba(255,75,57,.35);
}
.modal-cta:hover { background: #e6402f; transform: translateY(-1px); box-shadow: 0 14px 30px rgba(255,75,57,.45); }

/* ---- Footer ---- */
.footer {
  position: relative; z-index: 1;
  text-align: center;
  padding: 18px;
  color: var(--ink-mute);
  font-size: 12.5px;
}
.footer a { color: var(--ink-soft); text-decoration: underline; text-decoration-color: rgba(255,255,255,.2); text-underline-offset: 3px; }

/* ============================================================
   Responsive — mobile
   ============================================================ */
@media (max-width: 720px) {
  .topbar { padding: 14px 16px; }
  .brand-name { font-size: 16px; }
  .link-pill { font-size: 12px; padding: 6px 10px; }

  .galaxy { padding: 0 8px 100px; }
  .galaxy-intro h1 { font-size: 24px; }
  .galaxy-intro p { font-size: 13.5px; }

  .galaxy-stage {
    width: 100%;
    aspect-ratio: auto;
    height: auto;
    min-height: 0;
  }

  /* Sur mobile : on bascule en mode liste empilée par planète */
  .galaxy-stage { display: none !important; }
  .mobile-list { display: block !important; }

  .legend {
    position: sticky;
    bottom: 8px;
    left: 8px; right: 8px;
    margin: 16px 8px 8px;
    flex-direction: row; flex-wrap: wrap;
    justify-content: center;
    padding: 8px;
    backdrop-filter: blur(8px);
  }
  .legend-item { padding: 5px 9px; font-size: 12px; }
}

/* Liste mobile (cachée sur desktop) */
.mobile-list { display: none; padding: 0 8px; }
.mobile-planet {
  margin: 28px 0;
  border-radius: var(--radius-lg);
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
  overflow: hidden;
}
.mobile-planet-header {
  display: flex; align-items: center; gap: 14px;
  padding: 18px 18px 14px;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.mobile-planet-icon {
  width: 48px; height: 48px;
  border-radius: 50%;
  flex: 0 0 auto;
  box-shadow: 0 8px 18px rgba(0,0,0,.4), inset 0 -6px 12px rgba(0,0,0,.3);
}
.mobile-planet-title {
  font-size: 16px; font-weight: 700; color: white;
}
.mobile-planet-desc {
  font-size: 12.5px; color: var(--ink-soft); margin-top: 3px;
}
.mobile-planet-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 14px;
}
/* Conteneur d'une tuile mobile : image au-dessus, légende en dessous */
.mobile-tile-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
  cursor: pointer;
  background: transparent;
  border: 0;
  padding: 0;
  margin: 0;
  font: inherit;
  color: inherit;
  text-align: center;
  width: 100%;
}
.mobile-tile {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 14px;
  background: #1a253b center/cover no-repeat;
  border: 2px solid var(--tile-ring, rgba(255,255,255,.2));
  overflow: hidden;
  transition: transform .2s var(--ease-pop), border-color .2s var(--ease-soft);
}
.mobile-tile-wrap:hover .mobile-tile,
.mobile-tile-wrap:focus-visible .mobile-tile { transform: scale(1.04); border-color: white; outline: none; }
/* Label en dessous de la bulle (plus sur l'image) */
.mobile-tile-label {
  color: rgba(255,255,255,.92);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.25;
  text-align: center;
  padding: 0 2px;
  text-shadow: 0 1px 2px rgba(0,0,0,.6);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Hide tooltip on touch / mobile (modale prend le relais) */
@media (hover: none) {
  .tooltip { display: none; }
}

/* ============================================================
   THEME LIGHT — fond blanc, écritures navy
   ============================================================ */
body.theme-light {
  background: #ffffff;
  color: var(--navy);
}
body.theme-light .stars { display: none; }

/* Topbar et marque */
body.theme-light .brand,
body.theme-light .brand-name { color: var(--navy); }
body.theme-light .brand-logo {
  background: var(--navy);
  box-shadow: 0 0 0 2px rgba(30,42,58,.12), 0 6px 16px rgba(30,42,58,.18);
}
body.theme-light .link-pill {
  background: rgba(30,42,58,.06);
  color: var(--navy);
  border: 1px solid rgba(30,42,58,.18);
}
body.theme-light .link-pill:hover { background: rgba(30,42,58,.12); }
body.theme-light .link-pill--ghost { background: transparent; }

/* Titre principal — on désactive le dégradé blanc → texte navy plein */
body.theme-light .galaxy-intro h1 {
  background: none;
  -webkit-background-clip: initial;
  background-clip: initial;
  color: var(--navy);
}
body.theme-light .galaxy-intro p { color: rgba(30,42,58,.78); }

/* Hub central : cercle blanc → on l'entoure d'un anneau navy pour le voir */
body.theme-light .galaxy-hub {
  background: var(--navy);
  box-shadow: 0 0 0 4px #fff, 0 0 0 6px rgba(30,42,58,.18), 0 8px 24px rgba(30,42,58,.18);
}
body.theme-light .galaxy-hub img { filter: brightness(0) invert(1); }

/* Planètes : on garde leurs couleurs vives, on renforce juste l'ombre portée */
body.theme-light .planet {
  box-shadow:
    inset 0 -10px 25px rgba(0,0,0,.25),
    inset 0 8px 18px rgba(255,255,255,.25),
    0 0 30px var(--planet-glow, rgba(255,75,57,.45)),
    0 18px 36px rgba(30,42,58,.22);
}
/* Le badge "Cliquez ici" sur les planètes : navy plein sur fond blanc */
body.theme-light .planet-cta {
  background: var(--navy);
  color: #fff;
  box-shadow: 0 2px 8px rgba(30,42,58,.35);
}
@keyframes planet-cta-pulse-light {
  0%, 100% { transform: scale(1); box-shadow: 0 2px 8px rgba(30,42,58,.35), 0 0 0 0 rgba(30,42,58,.45); }
  50%      { transform: scale(1.06); box-shadow: 0 2px 10px rgba(30,42,58,.4), 0 0 0 8px rgba(30,42,58,0); }
}
body.theme-light .planet-cta { animation-name: planet-cta-pulse-light; }

/* Tuiles formations : ombre adaptée au fond blanc */
body.theme-light .formation-tile {
  box-shadow:
    0 0 0 2px rgba(255,255,255,.9),
    0 6px 18px rgba(30,42,58,.25);
}
body.theme-light .formation-tile:hover,
body.theme-light .formation-tile:focus-visible {
  box-shadow:
    0 0 0 2px rgba(255,255,255,.95),
    0 0 24px var(--tile-ring),
    0 14px 28px rgba(30,42,58,.32);
}

/* Labels sous les tuiles : navy avec halo blanc pour lisibilité */
body.theme-light .formation-tile-label {
  color: var(--navy);
  text-shadow: 0 1px 0 #fff, 0 0 6px #fff, 0 0 10px rgba(255,255,255,.9);
}
body.theme-light .formation-tile:hover .formation-tile-label,
body.theme-light .formation-tile:focus-visible .formation-tile-label {
  color: var(--navy);
  text-shadow: 0 1px 0 #fff, 0 0 8px var(--tile-ring), 0 0 12px rgba(255,255,255,.9);
}

/* Indicateur "Cliquez ici" dans la bulle au hover : reste lisible */
body.theme-light .formation-tile-hint {
  background: rgba(30,42,58,.78);
  color: #fff;
}

/* Tooltip détaillé : carte blanche, bord navy, texte navy */
body.theme-light .tooltip {
  background: #fff;
  color: var(--navy);
  border: 1px solid rgba(30,42,58,.18);
  box-shadow: 0 24px 60px rgba(30,42,58,.22);
}
body.theme-light .tooltip h3 { color: var(--navy); }
body.theme-light .tooltip p, body.theme-light .tooltip-meta { color: rgba(30,42,58,.78); }

/* Légende des axes (bas-gauche) */
body.theme-light .legend {
  background: #fff;
  border: 1px solid rgba(30,42,58,.18);
  box-shadow: 0 12px 32px rgba(30,42,58,.18);
}
body.theme-light .legend-item { color: rgba(30,42,58,.7); }
body.theme-light .legend-item:hover { background: rgba(30,42,58,.06); color: var(--navy); }
body.theme-light .legend-item.is-active {
  background: rgba(30,42,58,.08);
  color: var(--navy);
}

/* Modale détaillée */
body.theme-light .modal-overlay { background: rgba(30,42,58,.45); }
body.theme-light .modal-card {
  background: #fff;
  color: var(--navy);
  border: 1px solid rgba(30,42,58,.18);
  box-shadow: 0 30px 80px rgba(30,42,58,.28);
}
body.theme-light .modal-card h2,
body.theme-light .modal-card h3 { color: var(--navy); }
body.theme-light .modal-card p,
body.theme-light .modal-meta,
body.theme-light .modal-card li { color: rgba(30,42,58,.8); }
body.theme-light .modal-close {
  background: rgba(30,42,58,.06);
  color: var(--navy);
}
body.theme-light .modal-close:hover { background: rgba(30,42,58,.12); }
body.theme-light .modal-cta {
  background: var(--corail);
  color: #fff;
}

/* Footer */
body.theme-light .galaxy-footer { color: rgba(30,42,58,.65); }
body.theme-light .galaxy-footer a { color: var(--navy); }

/* Mode mobile */
body.theme-light .mobile-planet {
  background: rgba(30,42,58,.04);
  border: 1px solid rgba(30,42,58,.14);
}
body.theme-light .mobile-planet-title { color: var(--navy); }
body.theme-light .mobile-planet-desc { color: rgba(30,42,58,.7); }
body.theme-light .mobile-tile-label {
  color: var(--navy);
  text-shadow: none;
}
body.theme-light .mobile-tile {
  background-color: rgba(30,42,58,.05);
}

/* Halo composition "Cette formation inclut" : on garde le corail (déjà visible sur blanc) */
body.theme-light .composition-bubble-label {
  text-shadow: 0 1px 0 #fff, 0 0 8px #fff;
}

/* Espacement supplémentaire entre l'intro et les planètes pour éviter le chevauchement */
body.theme-light .galaxy-intro { margin-bottom: 56px; }
body.theme-light .galaxy-stage { margin-top: 32px; }
@media (max-width: 760px) {
  body.theme-light .galaxy-intro { margin-bottom: 28px; }
  body.theme-light .galaxy-stage { margin-top: 16px; }
}
