/* =======================================================
   Pépite Dimension — style V0
   Refonte UX/UI cristal + univers émotionnel
   ======================================================= */

:root {
  /* Backgrounds */
  --bg-deep: #0a0a0f;
  --bg-card: #13131a;
  --bg-elevated: #1c1c26;
  --border-soft: rgba(255, 255, 255, 0.05);
  --border-medium: rgba(255, 255, 255, 0.10);

  /* Texte */
  --text-primary: #f0e8e0;
  --text-secondary: #a0958c;
  --text-muted: #5a5550;
  --text-glow: rgba(240, 232, 224, 0.6);

  /* Accents */
  --accent-coral: #ff7a8a;
  --accent-coral-hover: #ff5a6e;
  --accent-coral-soft: rgba(255, 122, 138, 0.15);

  /* Mode Introspection : violet/magenta/orange (Q4 Tristan) */
  --mode-intro-1: #7e3aed;
  --mode-intro-2: #a855f7;
  --mode-intro-3: #c084fc;
  --mode-intro-4: #ec4899;
  --mode-intro-5: #fb923c;
  --mode-intro-glow: rgba(168, 85, 247, 0.4);

  /* Mode Extrospection : rose chaud + bleu nuit (Q4 Tristan) */
  --mode-extro-1: #1e3a8a;
  --mode-extro-2: #ec4899;
  --mode-extro-3: #f472b6;
  --mode-extro-glow: rgba(236, 72, 153, 0.4);

  /* Mode Découverte : ambre + sépia + or trésor (Q4 Tristan) */
  --mode-disco-1: #92400e;
  --mode-disco-2: #d97706;
  --mode-disco-3: #fbbf24;
  --mode-disco-4: #fcd34d;
  --mode-disco-glow: rgba(251, 191, 36, 0.4);

  /* Mode Paramètres : neutre désaturé */
  --mode-param-1: #6b7280;
  --mode-param-2: #9ca3af;
  --mode-param-3: #d1d5db;

  /* Typography — verrouillé 2026-05-25 (voir vault Decisions/2026-05-25-Typo-Finale-Bodoni-Moda-DM-Sans) */
  --font-display: 'Bodoni Moda', 'Didot', Georgia, serif;
  --font-body: 'DM Sans', system-ui, -apple-system, sans-serif;

  /* Motion */
  --ease-out-soft: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out-soft: cubic-bezier(0.65, 0, 0.35, 1);
  --duration-fast: 200ms;
  --duration-normal: 500ms;
  --duration-slow: 1000ms;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  background: var(--bg-deep);
  color: var(--text-primary);
  font-family: var(--font-body);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* none (était pan-y) : le JS capte le swipe dans les 4 directions. Avec pan-y,
     le navigateur gardait le scroll VERTICAL → le swipe haut/bas était avalé
     (gauche/droite marchait car rien ne scrolle en X). Demande Tristan 2026-05-30.
     Le scroll interne des overlays scrollables est préservé via touch-action:pan-y
     sur .modal / .dim-overlay-panel. */
  touch-action: none;
  /* Tue le pull-to-refresh Android + le chaînage d'overscroll. touch-action seul ne
     bloque PAS le pull-to-refresh de façon fiable (Chrome le pilote via
     overscroll-behavior). Combo déjà éprouvé dans dimension-2d/style.css. */
  overscroll-behavior: none;
}

body {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  overscroll-behavior: none; /* anti pull-to-refresh / bounce (en tandem avec html) */
}

/* =======================================================
   Fond étoilé (sous le canvas, 3 couches parallaxe)
   ======================================================= */

#stars-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(circle at 18% 18%, rgba(126, 58, 237, 0.14), transparent 28%),
    radial-gradient(circle at 78% 62%, rgba(255, 122, 138, 0.10), transparent 24%),
    linear-gradient(180deg, #04040a 0%, #090813 46%, #05050b 100%);
  pointer-events: none;
  overflow: hidden;
}

#stars-bg::before,
#stars-bg::after {
  content: '';
  position: absolute;
  inset: -12%;
  pointer-events: none;
}

#stars-bg::before {
  background:
    linear-gradient(
      118deg,
      transparent 18%,
      rgba(255, 255, 255, 0.015) 36%,
      rgba(187, 158, 255, 0.055) 47%,
      rgba(255, 199, 158, 0.032) 55%,
      transparent 72%
    );
  filter: blur(20px);
  opacity: 0.9;
  transform: rotate(-7deg) scale(1.08);
}

#stars-bg::after {
  background:
    radial-gradient(circle at 30% 36%, rgba(176, 142, 255, 0.13), transparent 30%),
    radial-gradient(circle at 70% 64%, rgba(255, 157, 136, 0.08), transparent 22%),
    radial-gradient(circle at 52% 49%, rgba(255, 255, 255, 0.035), transparent 16%);
  filter: blur(56px);
  opacity: 0.58;
  animation: milkyPulse 22s ease-in-out infinite;
}

.stars-layer {
  position: absolute;
  inset: 0;
  background-repeat: repeat;
  animation: starsDrift 120s linear infinite;
  mix-blend-mode: screen;
  will-change: transform;
}

/* En full/medium, on garde un voile cosmique CSS très léger derrière le starfield 3D. */
body:not([data-perf-mode="lite"]) .stars-layer {
  display: block;
  opacity: 0.26;
}

.stars-layer-far {
  background-image:
    radial-gradient(1px 1px at 7% 13%, rgba(255,255,255,0.22), transparent 55%),
    radial-gradient(1px 1px at 18% 71%, rgba(255,255,255,0.22), transparent 55%),
    radial-gradient(1px 1px at 24% 34%, rgba(255,255,255,0.18), transparent 55%),
    radial-gradient(1px 1px at 31% 59%, rgba(255,255,255,0.24), transparent 55%),
    radial-gradient(1px 1px at 43% 18%, rgba(255,255,255,0.18), transparent 55%),
    radial-gradient(1px 1px at 51% 83%, rgba(255,255,255,0.24), transparent 55%),
    radial-gradient(1px 1px at 64% 28%, rgba(255,255,255,0.2), transparent 55%),
    radial-gradient(1px 1px at 72% 74%, rgba(255,255,255,0.18), transparent 55%),
    radial-gradient(1px 1px at 81% 9%, rgba(255,255,255,0.22), transparent 55%),
    radial-gradient(1px 1px at 89% 47%, rgba(255,255,255,0.16), transparent 55%),
    radial-gradient(1px 1px at 94% 86%, rgba(255,255,255,0.22), transparent 55%);
  background-size: 340px 340px;
  opacity: 0.78;
}

.stars-layer-mid {
  background-image:
    radial-gradient(1.2px 1.2px at 9% 28%, rgba(192, 132, 252, 0.30), transparent 58%),
    radial-gradient(1.2px 1.2px at 17% 81%, rgba(255,255,255,0.26), transparent 58%),
    radial-gradient(1.5px 1.5px at 29% 43%, rgba(236, 72, 153, 0.24), transparent 58%),
    radial-gradient(1px 1px at 37% 66%, rgba(255,255,255,0.22), transparent 58%),
    radial-gradient(1.4px 1.4px at 48% 19%, rgba(168, 85, 247, 0.22), transparent 58%),
    radial-gradient(1.2px 1.2px at 58% 74%, rgba(255,255,255,0.24), transparent 58%),
    radial-gradient(1.4px 1.4px at 69% 37%, rgba(255, 122, 138, 0.18), transparent 58%),
    radial-gradient(1px 1px at 76% 85%, rgba(255,255,255,0.22), transparent 58%),
    radial-gradient(1.4px 1.4px at 87% 54%, rgba(192, 132, 252, 0.24), transparent 58%),
    radial-gradient(1px 1px at 94% 12%, rgba(255,255,255,0.24), transparent 58%);
  background-size: 440px 440px;
  animation-duration: 180s;
  opacity: 0.52;
}

.stars-layer-near {
  background-image:
    radial-gradient(1.6px 1.6px at 14% 19%, rgba(255, 122, 138, 0.24), transparent 62%),
    radial-gradient(2px 2px at 32% 71%, rgba(255,255,255,0.20), transparent 62%),
    radial-gradient(1.8px 1.8px at 47% 37%, rgba(192, 132, 252, 0.22), transparent 62%),
    radial-gradient(1.6px 1.6px at 62% 84%, rgba(255, 193, 148, 0.18), transparent 62%),
    radial-gradient(1.8px 1.8px at 81% 23%, rgba(255,255,255,0.18), transparent 62%),
    radial-gradient(1.6px 1.6px at 92% 66%, rgba(236, 72, 153, 0.18), transparent 62%);
  background-size: 520px 520px;
  animation-duration: 240s;
  opacity: 0.32;
}

@keyframes starsDrift {
  0%   { transform: translate(0, 0); }
  50%  { transform: translate(-30px, -20px); }
  100% { transform: translate(0, 0); }
}

@keyframes milkyPulse {
  0%, 100% { opacity: 0.46; transform: scale(1.02) rotate(-2deg); }
  50%      { opacity: 0.66; transform: scale(1.08) rotate(1deg); }
}

/* =======================================================
   Canvas Three.js
   ======================================================= */

#cristal-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  z-index: 1;
  pointer-events: none;
  touch-action: none;
}

#cristal-canvas.interactive {
  pointer-events: auto;
  cursor: pointer;
}

#cristal-fallback {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1;
  pointer-events: none;
}

.fallback-orb {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%,
    rgba(192, 132, 252, 0.8),
    rgba(168, 85, 247, 0.4) 40%,
    rgba(236, 72, 153, 0.2) 70%,
    transparent 100%);
  filter: blur(2px);
  animation: orbPulse 4s var(--ease-in-out-soft) infinite;
}

@keyframes orbPulse {
  0%, 100% { transform: scale(1) rotate(0deg); opacity: 0.8; }
  50%      { transform: scale(1.15) rotate(180deg); opacity: 1; }
}

body[data-perf-mode="lite"] #cristal-canvas { display: none; }
body[data-perf-mode="lite"] #cristal-fallback { display: block; }

/* =======================================================
   Top bar — UNE seule ligne haut-droite (demande Tristan 2026-05-30) :
   2D/3D · choisir un preset · EN/FR · son. Le preset est inséré par
   lab-bridge.js juste après le toggle 2D/3D.
   ======================================================= */

.top-controls {
  position: fixed;
  top: max(1rem, env(safe-area-inset-top));
  right: max(1rem, env(safe-area-inset-right));
  /* AU-DESSUS des .edge-zone (z-index 500, pointer-events:auto) : sinon la zone
     de survol invisible du bord haut avale les clics. Bug 2026-05-30. */
  z-index: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Pilule sombre commune à tous les contrôles (toggle 2D/3D, preset, EN/FR, son). */
.ctrl-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  padding: 0 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--border-soft);
  background: rgba(10, 10, 15, 0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  line-height: 1;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity var(--duration-fast) var(--ease-out-soft),
              border-color var(--duration-fast) var(--ease-out-soft),
              color var(--duration-fast) var(--ease-out-soft);
  user-select: none;
}
.ctrl-pill:hover { opacity: 1; border-color: var(--border-medium); color: var(--text-primary); }

/* Boutons (toggle 2D/3D, son) : reset du <button>. */
button.ctrl-pill { font: inherit; font-size: 0.72rem; letter-spacing: 0.04em; }

/* Listes déroulantes (preset, EN/FR) : flèche custom + place à droite. */
select.ctrl-pill {
  -webkit-appearance: none;
  appearance: none;
  padding: 0 1.6rem 0 0.7rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%23bbb' d='M0 0l5 6 5-6z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.6rem center;
}
select.ctrl-pill option { background: #14101f; color: #f5f3ff; font-style: normal; }

.dim-mode-btn { gap: 0.25rem; }
.dim-opt { padding: 0 0.12rem; transition: color var(--duration-fast) var(--ease-out-soft); }
.dim-opt.is-active { color: var(--text-primary); font-weight: 600; }
.dim-sep { color: var(--text-muted); opacity: 0.6; }

/* Lien « retour au site classique » : pilule .ctrl-pill à gauche du toggle 2D/3D
   (demande Tristan 2026-06-01). <a> → reset soulignement + couleur explicite pour
   neutraliser le bleu/violet UA des liens (link/visited), flèche atténuée. */
.classic-site-link { gap: 0.3rem; text-decoration: none; color: var(--text-secondary); }
.classic-site-link:hover,
.classic-site-link:visited { color: var(--text-secondary); }
.classic-site-link:hover { color: var(--text-primary); }
.classic-site-arrow { opacity: 0.75; }

.audio-toggle { font-size: 0.95rem; }
.audio-toggle .audio-toggle-icon { line-height: 1; }

/* PC : tout plus grand (demande Tristan « plus gros »). */
@media (min-width: 761px) {
  .top-controls { gap: 9px; }
  .ctrl-pill { height: 40px; font-size: 0.92rem; padding: 0 0.95rem; }
  button.ctrl-pill { font-size: 0.92rem; }
  select.ctrl-pill { padding: 0 2.1rem 0 0.95rem; background-position: right 0.8rem center; }
  .audio-toggle { font-size: 1.18rem; }
}

/* Roue crantée du dev-panel masquée sur /experience (demande Tristan 2026-05-30 :
   « enlève la roue crantée »). Le panneau reste dispo sur laboratory/dimension ;
   ici on garde l'écran épuré. Masquage seulement (non supprimé) → réversible. */
.pep-devpanel-btn,
.pep-devpanel,
.pep-devpanel-backdrop { display: none !important; }

/* =======================================================
   Timeline (sections phases)
   ======================================================= */

#timeline {
  position: relative;
  z-index: 10;
}

.phase {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5rem 1.5rem 5rem;
  position: relative;
}

.phase-content {
  width: 100%;
  max-width: 640px;
  text-align: center;
  position: relative;
  z-index: 2;
}

/* Phase 0 — Arrivée */
.phase-arrival {
  min-height: 100vh;
  min-height: 100dvh;
  padding: 3rem 1.5rem;
}

.phase-arrival-content {
  opacity: 0;
  animation: arrivalFadeIn 2.4s var(--ease-out-soft) 0.8s forwards;
}

@keyframes arrivalFadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.brand-signature {
  display: inline-flex;
  align-items: baseline;
  gap: 0.15em;
  margin-bottom: 3rem;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 300;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  opacity: 0.9;
}

.brand-pepite {
  font-style: italic;
}

.brand-plus {
  font-size: 0.8em;
  color: var(--mode-intro-2);
  opacity: 0.8;
}

.arrival-tagline {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 5vw, 2.4rem);
  font-weight: 300;
  font-style: italic;
  letter-spacing: -0.01em;
  line-height: 1.35;
  margin-bottom: 3.5rem;
  color: var(--text-primary);
  text-shadow: 0 0 30px rgba(192, 132, 252, 0.2);
}

.enter-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1rem 3.2rem;
  background: transparent;
  border: 1px solid rgba(192, 132, 252, 0.4);
  border-radius: 100px;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  cursor: pointer;
  overflow: hidden;
  transition: all var(--duration-normal) var(--ease-out-soft);
  isolation: isolate;
}

.enter-btn-label { position: relative; z-index: 2; }

.enter-btn-glow {
  position: absolute;
  inset: -2px;
  border-radius: 100px;
  background: radial-gradient(circle at center, rgba(192, 132, 252, 0.6), transparent 70%);
  opacity: 0.5;
  filter: blur(15px);
  z-index: 1;
  animation: glowPulse 3s var(--ease-in-out-soft) infinite;
}

@keyframes glowPulse {
  0%, 100% { opacity: 0.4; transform: scale(1); }
  50%      { opacity: 0.7; transform: scale(1.1); }
}

.enter-btn:hover {
  border-color: rgba(255, 122, 138, 0.7);
  color: var(--accent-coral);
  transform: translateY(-2px);
}

.enter-btn:hover .enter-btn-glow {
  background: radial-gradient(circle at center, rgba(255, 122, 138, 0.7), transparent 70%);
  opacity: 0.9;
}

.arrival-hint {
  margin-top: 4rem;
  font-size: 0.8rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-muted);
  opacity: 0.6;
  animation: hintBlink 2.5s ease-in-out infinite;
}

@keyframes hintBlink {
  0%, 100% { opacity: 0.4; }
  50%      { opacity: 0.8; }
}

/* Phases 1-5 — titres */
.phase-eyebrow {
  font-size: 0.75rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  opacity: 0;
  transform: translateY(20px);
  transition: all var(--duration-slow) var(--ease-out-soft);
}

.phase-title {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 6vw, 3.2rem);
  font-weight: 300;
  font-style: italic;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: 1.5rem;
  color: var(--text-primary);
  text-shadow: 0 0 40px rgba(192, 132, 252, 0.15);
  opacity: 0;
  transform: translateY(30px);
  transition: all var(--duration-slow) var(--ease-out-soft);
  transition-delay: 100ms;
}

.phase-title-large {
  font-size: clamp(2.4rem, 8vw, 4.5rem);
}

.phase-sub {
  font-size: 1.05rem;
  font-weight: 400;
  color: var(--text-secondary);
  margin-bottom: 2rem;
  opacity: 0;
  transform: translateY(20px);
  transition: all var(--duration-slow) var(--ease-out-soft);
  transition-delay: 200ms;
}

.phase.is-visible .phase-eyebrow,
.phase.is-visible .phase-title,
.phase.is-visible .phase-sub {
  opacity: 1;
  transform: translateY(0);
}

/* Phase 2 — Import icons */
.import-icons {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 2rem;
  opacity: 0;
  transform: translateY(20px);
  transition: all var(--duration-slow) var(--ease-out-soft);
  transition-delay: 300ms;
}

.phase.is-visible .import-icons { opacity: 1; transform: translateY(0); }

.import-icon {
  font-size: 1.8rem;
  filter: grayscale(20%);
  transition: all var(--duration-normal) var(--ease-out-soft);
  cursor: default;
}

.import-icon:hover {
  filter: grayscale(0%);
  transform: scale(1.15);
}

/* Phase 3 — Mood pills */
.mood-pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem;
  margin-top: 2rem;
  opacity: 0;
  transform: translateY(20px);
  transition: all var(--duration-slow) var(--ease-out-soft);
  transition-delay: 300ms;
}

.phase.is-visible .mood-pills { opacity: 1; transform: translateY(0); }

.mood-pill {
  padding: 0.6rem 1.2rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-soft);
  border-radius: 100px;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 400;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out-soft);
  backdrop-filter: blur(10px);
}

.mood-pill:hover {
  background: var(--accent-coral-soft);
  border-color: rgba(255, 122, 138, 0.4);
  transform: translateY(-2px);
}

.mood-pill.is-selected {
  background: linear-gradient(135deg, var(--mode-intro-2), var(--accent-coral));
  border-color: transparent;
  color: white;
  box-shadow: 0 0 20px rgba(168, 85, 247, 0.3);
}

/* =======================================================
   Hub central (4 directions)
   ======================================================= */

.hub {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5rem 1.5rem;
  position: relative;
}

.hub-content {
  width: 100%;
  max-width: 520px;
  text-align: center;
  opacity: 0;
  transform: translateY(40px);
  transition: all 1.2s var(--ease-out-soft);
}

.hub.is-visible .hub-content { opacity: 1; transform: translateY(0); }

/* =======================================================
   Cycle de Transformation — 6 états (ref screen 4)
   ======================================================= */

.phase-cycle {
  min-height: 100vh;
  min-height: 100dvh;
  padding: 6rem 1.5rem;
}

.cycle-content {
  width: 100%;
  max-width: 840px;
  text-align: center;
}

.cycle-title {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 3.5vw, 2.2rem);
  font-weight: 400;
  font-style: italic;
  letter-spacing: -0.01em;
  line-height: 1.3;
  margin-bottom: 3rem;
  color: var(--text-primary);
}

.cycle-states {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 0.6rem;
  margin-bottom: 2rem;
}

.cycle-state-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  padding: 1rem 0.6rem;
  background: rgba(19, 19, 26, 0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  cursor: pointer;
  font-family: var(--font-body);
  color: var(--text-primary);
  transition: all 0.35s var(--ease-out-soft);
}

.cycle-state-btn:hover {
  background: rgba(168, 85, 247, 0.10);
  border-color: rgba(168, 85, 247, 0.4);
  transform: translateY(-3px);
}

.cycle-state-btn[data-active="true"] {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.20), rgba(236, 72, 153, 0.20));
  border-color: rgba(192, 132, 252, 0.6);
  box-shadow: 0 0 24px rgba(192, 132, 252, 0.25);
}

.cycle-num {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-style: italic;
  color: var(--mode-intro-3);
  font-weight: 400;
}

.cycle-label {
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--text-primary);
}

.cycle-sub {
  font-size: 0.65rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.cycle-controls {
  display: flex;
  justify-content: center;
  margin-top: 1rem;
}

.cycle-auto-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.7rem 1.6rem;
  background: transparent;
  border: 1px solid var(--border-medium);
  border-radius: 100px;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.3s var(--ease-out-soft);
}

.cycle-auto-btn:hover {
  background: rgba(168, 85, 247, 0.10);
  border-color: rgba(192, 132, 252, 0.5);
}

.cycle-auto-btn[data-active="true"] {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.25), rgba(236, 72, 153, 0.20));
  border-color: rgba(192, 132, 252, 0.7);
  box-shadow: 0 0 28px rgba(192, 132, 252, 0.3);
}

.cycle-auto-icon {
  font-size: 0.7rem;
  color: var(--mode-intro-3);
}

/* =======================================================
   Explode button — phase 5 (cohérent .cycle-auto-btn)
   ======================================================= */

.explode-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  margin-top: 2rem;
  padding: 0.85rem 1.8rem;
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.12), rgba(236, 72, 153, 0.10));
  border: 1px solid var(--border-medium);
  border-radius: 100px;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all 0.35s var(--ease-out-soft);
  /* "clearcoat" : gloss subtil cohérent avec le matériau */
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 0 0 rgba(192, 132, 252, 0.0);
}

.explode-btn:hover {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.28), rgba(236, 72, 153, 0.22));
  border-color: rgba(192, 132, 252, 0.7);
  transform: translateY(-2px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.15),
    0 0 32px rgba(192, 132, 252, 0.35);
}

.explode-btn:active {
  transform: translateY(0) scale(0.98);
}

.explode-btn[data-exploding="true"] {
  pointer-events: none;
  opacity: 0.55;
}

body[data-explosion-phase="compression"] .explode-btn,
body[data-explosion-phase="detonation"] .explode-btn,
body[data-explosion-phase="resonance"] .explode-btn,
body[data-explosion-phase="reformation"] .explode-btn {
  border-color: rgba(255, 255, 255, 0.3);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 0 42px rgba(236, 72, 153, 0.24);
}

.explode-icon {
  font-size: 1.05rem;
  filter: drop-shadow(0 0 6px rgba(251, 146, 60, 0.6));
}

.explode-label {
  font-family: var(--font-body);
}

.explode-status {
  width: min(100%, 360px);
  margin: 1.1rem auto 0;
  padding: 0.95rem 1rem 0.85rem;
  display: grid;
  gap: 0.45rem;
  background:
    linear-gradient(135deg, rgba(16, 14, 28, 0.62), rgba(27, 16, 38, 0.42)),
    radial-gradient(circle at top, rgba(255, 255, 255, 0.08), transparent 70%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 18px 50px rgba(6, 4, 15, 0.28);
}

.explode-status-kicker {
  font-size: 0.68rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: rgba(240, 232, 224, 0.55);
}

.explode-status-label {
  font-family: var(--font-display);
  font-size: 1rem;
  font-style: italic;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  text-shadow: 0 0 18px rgba(192, 132, 252, 0.15);
}

.explode-status-meter {
  position: relative;
  display: block;
  height: 0.34rem;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.explode-status-fill {
  display: block;
  width: 100%;
  height: 100%;
  transform: scaleX(0.18);
  transform-origin: left center;
  border-radius: inherit;
  background:
    linear-gradient(90deg, var(--mode-intro-3), var(--mode-intro-4), var(--mode-intro-5));
  box-shadow: 0 0 20px rgba(236, 72, 153, 0.28);
  transition: transform 280ms var(--ease-out-soft), box-shadow 280ms var(--ease-out-soft);
}

body[data-explosion-phase="compression"] .explode-status {
  border-color: rgba(251, 191, 36, 0.28);
  box-shadow: 0 18px 50px rgba(251, 146, 60, 0.14);
}

body[data-explosion-phase="detonation"] .explode-status {
  border-color: rgba(255, 122, 138, 0.34);
  box-shadow: 0 18px 60px rgba(236, 72, 153, 0.22);
}

body[data-explosion-phase="resonance"] .explode-status {
  border-color: rgba(192, 132, 252, 0.34);
  box-shadow: 0 18px 60px rgba(168, 85, 247, 0.22);
}

body[data-explosion-phase="reformation"] .explode-status {
  border-color: rgba(253, 224, 214, 0.30);
  box-shadow: 0 18px 60px rgba(251, 146, 60, 0.18);
}

.hub-eyebrow {
  font-size: 0.75rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.hub-title {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 6vw, 2.8rem);
  font-weight: 300;
  font-style: italic;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: 3rem;
  color: var(--text-primary);
}

/* Grid 3x3 — directions en croix */
.hub-grid {
  display: grid;
  grid-template-areas:
    ".      up     ."
    "left   center right"
    ".      down   .";
  gap: 0.8rem;
  margin-bottom: 2.5rem;
  align-items: center;
  justify-items: stretch;
}

.hub-direction-up    { grid-area: up; }
.hub-direction-left  { grid-area: left; }
.hub-direction-right { grid-area: right; }
.hub-direction-down  { grid-area: down; }
.hub-center          { grid-area: center; }

.hub-direction {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 0.8rem;
  background: rgba(19, 19, 26, 0.4);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-soft);
  border-radius: 18px;
  color: var(--text-primary);
  text-decoration: none;
  transition: all var(--duration-normal) var(--ease-out-soft);
  cursor: pointer;
  min-height: 90px;
  justify-content: center;
}

.hub-direction:hover {
  background: rgba(19, 19, 26, 0.7);
  border-color: rgba(192, 132, 252, 0.3);
  transform: scale(1.04);
  box-shadow: 0 8px 32px rgba(168, 85, 247, 0.15);
}

.hub-direction-left:hover  { border-color: rgba(192, 132, 252, 0.5); }
.hub-direction-right:hover { border-color: rgba(236, 72, 153, 0.5); }
.hub-direction-down:hover  { border-color: rgba(251, 191, 36, 0.5); }
.hub-direction-up:hover    { border-color: rgba(156, 163, 175, 0.5); }

.hub-arrow {
  font-size: 1.4rem;
  line-height: 1;
  font-weight: 300;
  color: var(--text-secondary);
  transition: all var(--duration-normal) var(--ease-out-soft);
}

.hub-direction-left:hover  .hub-arrow { color: var(--mode-intro-3); transform: translateX(-3px); }
.hub-direction-right:hover .hub-arrow { color: var(--mode-extro-3); transform: translateX(3px); }
.hub-direction-up:hover    .hub-arrow { color: var(--mode-param-3); transform: translateY(-3px); }
.hub-direction-down:hover  .hub-arrow { color: var(--mode-disco-3); transform: translateY(3px); }

.hub-label-block {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.hub-label {
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--text-primary);
}

.hub-sub {
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.hub-direction-soon {
  opacity: 0.5;
  cursor: not-allowed;
}

.hub-direction-soon .hub-sub {
  color: var(--accent-coral);
  opacity: 0.7;
}

.hub-center {
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.hub-center-pulse {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, var(--mode-intro-3), var(--mode-intro-2));
  box-shadow:
    0 0 20px var(--mode-intro-glow),
    0 0 40px var(--mode-intro-glow);
  animation: centerPulse 4s var(--ease-in-out-soft) infinite;
}

@keyframes centerPulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 20px var(--mode-intro-glow), 0 0 40px var(--mode-intro-glow); }
  50%      { transform: scale(1.2); box-shadow: 0 0 30px var(--mode-intro-glow), 0 0 60px var(--mode-intro-glow); }
}

.hub-hint {
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 2rem;
}

.hub-back {
  margin-top: 1.5rem;
}

.hub-back-link {
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  text-decoration: none;
  border-bottom: 1px dotted transparent;
  transition: all var(--duration-fast) ease;
}

.hub-back-link:hover {
  color: var(--text-secondary);
  border-bottom-color: var(--text-muted);
}

/* =======================================================
   Modal Paramètres
   ======================================================= */

/* === Modal Paramètres : même style minimaliste que .dim-overlay === */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6vh 1.5rem;
  background: radial-gradient(ellipse at center, transparent 30%, rgba(10, 10, 15, 0.55) 100%);
  animation: modalFadeIn 0.4s ease-out;
}

.modal-backdrop[hidden] { display: none; }

@keyframes modalFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.modal {
  position: relative;
  width: 100%;
  max-width: 640px;
  max-height: 88vh;
  overflow-y: auto;
  touch-action: pan-y; /* garde le scroll interne malgré touch-action:none global */
  overscroll-behavior: contain; /* scroller jusqu'au bout ne chaîne pas vers la page (anti-bounce) */
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  text-align: center;
  animation: modalSlide 0.52s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes modalSlide {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.modal-close {
  position: absolute;
  top: 1.4rem;
  right: 1.4rem;
  width: 2rem; height: 2rem;
  display: flex; align-items: center; justify-content: center;
  background: none;
  border: none;
  border-radius: 0;
  color: var(--text-secondary);
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 300;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.2s ease;
}

.modal-close:hover {
  background: none;
  opacity: 1;
  color: var(--text-secondary);
}

.modal h2 {
  font-family: var(--font-display);
  font-size: clamp(40px, 7vw, 64px);
  font-weight: 400;
  font-style: normal;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--text-primary);
  margin: 0 0 2rem;
}

/* Titre « Menu » : Bodoni GRAS, noir, sans contour ni lumière portée (retour Tristan).
   ID > la règle `.modal h2` verrouillée plus bas (qui force un contour noir) + écrase
   l'ombre héritée de `.modal-backdrop`. Le titre Contact garde le style overlay clair. */
#paramTitle {
  color: #000;
  font-weight: 700;
  text-shadow: none;
}

.param-section {
  margin-bottom: 2.4rem;
  text-align: center;
}

.param-label {
  display: block;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-secondary);
  opacity: 0.7;
  margin-bottom: 0.8rem;
}

#cristal-name {
  width: min(380px, 100%);
  padding: 0.55rem 0;
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 0;
  color: var(--text-primary);
  font-family: var(--font-display);
  font-size: clamp(17px, 2vw, 20px);
  font-style: italic;
  text-align: center;
  transition: border-color 0.25s ease;
}
#cristal-name::placeholder { color: var(--text-secondary); font-style: italic; opacity: 0.6; }
#cristal-name:focus {
  outline: none;
  border-bottom-color: rgba(255, 255, 255, 0.55);
}

.param-radio-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.4rem;
  justify-content: center;
}

.param-radio {
  display: inline-flex;
  align-items: baseline;
  gap: 0.4rem;
  padding: 0.1rem 0.2rem;
  background: none;
  border-radius: 0;
  cursor: pointer;
  color: var(--text-secondary);
  font-family: var(--font-display);
  font-size: clamp(16px, 1.8vw, 19px);
  font-style: italic;
  transition: color 0.2s ease;
}

.param-radio:hover { background: none; color: var(--text-primary); }
.param-radio input { accent-color: currentColor; }
.param-radio:has(input:checked) {
  color: var(--text-primary);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 5px;
}

.param-danger {
  padding-top: 2rem;
  border-top: none;
  margin-top: 1.5rem;
}

.param-btn-danger {
  width: auto;
  padding: 0.1rem 0.2rem;
  background: none;
  border: none;
  border-radius: 0;
  color: var(--text-secondary);
  font-family: var(--font-display);
  font-size: clamp(17px, 2vw, 21px);
  font-weight: 400;
  font-style: italic;
  cursor: pointer;
  transition: color 0.2s ease;
}

.param-btn-danger:hover {
  background: none;
  border: none;
  color: #fca5a5;
}

.param-hint {
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--text-secondary);
  opacity: 0.7;
  margin-top: 0.8rem;
  line-height: 1.5;
}

/* =======================================================
   Menu de navigation (modal Paramètres → reprend le header
   du site classique). Typo pure Bodoni, pas de pill ; item
   primaire « Revenir » souligné. Cf. feedback_overlays_typo_pure.
   ======================================================= */
.param-menu {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
  text-align: center;
}

.param-menu-item {
  display: inline-block;
  padding: 0.5rem 0.2rem;
  background: none;
  border: none;
  /* Texte NOIR, sans contour blanc ni lumière portée (retour Tristan).
     Police = DM Sans (corps), pas Bodoni. `text-shadow:none` écrase aussi le
     contour noir hérité de `.modal-backdrop` (système overlay verrouillé). */
  color: #000;
  -webkit-text-stroke: 0;
  text-shadow: none;
  font-family: var(--font-body);
  font-size: clamp(19px, 4.4vw, 24px);
  font-weight: 500;
  font-style: normal;
  text-decoration: none;
  cursor: pointer;
  transition: opacity 0.18s ease;
}
.param-menu-item:hover,
.param-menu-item:focus-visible {
  opacity: 0.8;
  outline: none;
}

/* Item primaire : DM Sans, gras + souligné (chip actif), un cran plus gros */
.param-menu-primary {
  font-weight: 700;
  font-size: clamp(23px, 5.2vw, 29px);
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 5px;
  margin-bottom: 0.2rem;
}
.param-menu-primary:hover,
.param-menu-primary:focus-visible { opacity: 1; text-decoration-thickness: 2.5px; }

.param-menu-sep {
  width: 36px;
  height: 1px;
  margin: 0.5rem 0 0.7rem;
  border: none;
  background: rgba(255, 255, 255, 0.16);
}

/* =======================================================
   Modal Contact (#contactModal) — formulaire en place, typo pure
   ======================================================= */
.contact-intro {
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--text-secondary);
  text-align: center;
  margin: 0 0 1.3rem;
  line-height: 1.5;
}
.contact-form { display: flex; flex-direction: column; gap: 0.9rem; }
.contact-types { display: flex; justify-content: center; gap: 1.4rem; }
.contact-type {
  display: inline-flex; align-items: baseline; gap: 0.35rem;
  cursor: pointer; color: var(--text-secondary);
  font-family: var(--font-display); font-style: italic; font-size: clamp(15px, 1.8vw, 18px);
  transition: color 0.2s ease;
}
.contact-type:hover { color: var(--text-primary); }
.contact-type input { accent-color: currentColor; }
.contact-type:has(input:checked) { color: var(--text-primary); text-decoration: underline; text-underline-offset: 4px; }
#contactMessage, #contactEmail {
  width: 100%; box-sizing: border-box;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  color: var(--text-primary);
  font-family: var(--font-body); font-size: 15px;
  padding: 0.7rem 0.8rem;
  transition: border-color 0.25s ease;
}
#contactMessage { resize: vertical; min-height: 96px; }
#contactMessage::placeholder, #contactEmail::placeholder { color: var(--text-secondary); opacity: 0.6; }
#contactMessage:focus, #contactEmail:focus { outline: none; border-color: rgba(255, 255, 255, 0.5); }
.contact-send {
  align-self: center; margin-top: 0.3rem;
  background: none; border: none; cursor: pointer;
  color: var(--text-primary);
  font-family: var(--font-display); font-style: italic; font-size: clamp(18px, 2.2vw, 22px);
  text-decoration: underline; text-underline-offset: 5px; text-decoration-thickness: 1px;
  transition: text-decoration-thickness 0.2s ease, opacity 0.2s ease;
}
.contact-send:hover { text-decoration-thickness: 2px; }
.contact-send[disabled] { opacity: 0.5; cursor: default; }
.contact-error {
  color: #fca5a5; font-family: var(--font-body); font-size: 13px; text-align: center; margin-top: 0.2rem;
}
.contact-fallback {
  font-family: var(--font-body); font-size: 13px; color: var(--text-secondary);
  text-align: center; margin: 1.1rem 0 0; opacity: 0.85;
}
.contact-fallback a { color: var(--text-secondary); text-decoration: underline; }
.contact-success { text-align: center; }
.contact-success-icon { font-size: 34px; color: var(--text-primary); margin-bottom: 0.5rem; }
.contact-success p {
  font-family: var(--font-display); font-style: italic;
  font-size: clamp(20px, 2.4vw, 26px); color: var(--text-primary); margin: 0 0 1.2rem;
}
.contact-new-msg { font-size: clamp(15px, 1.8vw, 18px); }

/* =======================================================
   Mode color overrides (data-current-mode sur body)
   Le cristal réagit via JS, mais les UI s'adaptent en CSS
   ======================================================= */

body[data-current-mode="introspection"] .hub-center-pulse {
  background: radial-gradient(circle at 30% 30%, var(--mode-intro-3), var(--mode-intro-2));
  box-shadow: 0 0 20px var(--mode-intro-glow), 0 0 40px var(--mode-intro-glow);
}

body[data-current-mode="extrospection"] .hub-center-pulse {
  background: radial-gradient(circle at 30% 30%, var(--mode-extro-3), var(--mode-extro-2));
  box-shadow: 0 0 20px var(--mode-extro-glow), 0 0 40px var(--mode-extro-glow);
}

body[data-current-mode="decouverte"] .hub-center-pulse {
  background: radial-gradient(circle at 30% 30%, var(--mode-disco-3), var(--mode-disco-2));
  box-shadow: 0 0 20px var(--mode-disco-glow), 0 0 40px var(--mode-disco-glow);
}

/* =======================================================
   Responsive — mobile-first donc ajustements desktop
   ======================================================= */

@media (min-width: 768px) {
  .phase {
    padding: 6rem 2rem;
  }
  .hub-grid {
    gap: 1.2rem;
  }
  .hub-direction {
    padding: 1.4rem 1.2rem;
    min-height: 110px;
  }
}

@media (min-width: 1024px) {
  .hub-content {
    max-width: 720px;
  }
  .hub-direction {
    padding: 1.6rem 1.4rem;
    min-height: 130px;
  }
  .hub-label { font-size: 1rem; }
}

/* =======================================================
   Accessibilité
   ======================================================= */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .stars-layer { animation: none; }
}

/* Focus visible */
button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 2px solid var(--mode-intro-3);
  outline-offset: 3px;
  border-radius: 4px;
}

/* =======================================================
   === 4 onglets cardinaux (refonte 2026-05-27) ===
   Chips cachés par défaut, révélés par hover sur edge-zone
   ou par swipe (handled in main.js).
   ======================================================= */

.tab-cardinaux {
  position: fixed;
  inset: 0;
  z-index: 600;
  pointer-events: none;
}
.tab-cardinaux[hidden] { display: none; }

.tab-chip {
  position: absolute;
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1.1rem;
  background: rgba(20, 18, 30, 0.65);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  cursor: pointer;
  opacity: 0;
  transition:
    opacity 250ms var(--ease-out-soft),
    transform 250ms var(--ease-out-soft),
    background 200ms ease,
    border-color 200ms ease;
}

.tab-chip-icon {
  font-size: 1rem;
  opacity: 0.8;
}

.tab-chip-label { white-space: nowrap; }

.tab-chip-label-block {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.05;
}
.tab-chip-sub {
  font-size: 0.6rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 2px;
}

.tab-chip:hover {
  background: rgba(40, 30, 50, 0.78);
  border-color: rgba(168, 85, 247, 0.4);
}

/* Position bord + offset entrée (translate du côté caché) */
.tab-top {
  top: 1.2rem;
  left: 50%;
  transform: translate(-50%, -16px);
}
.tab-bottom {
  bottom: 1.2rem;
  left: 50%;
  transform: translate(-50%, 16px);
}
.tab-left {
  left: 1.2rem;
  top: 50%;
  transform: translate(-16px, -50%);
}
.tab-right {
  right: 1.2rem;
  top: 50%;
  transform: translate(16px, -50%);
}

/* État révélé : opacity 1 + recentrage */
.tab-chip.is-revealed { opacity: 1; }
.tab-top.is-revealed    { transform: translate(-50%, 0); }
.tab-bottom.is-revealed { transform: translate(-50%, 0); }
.tab-left.is-revealed   { transform: translate(0, -50%); }
.tab-right.is-revealed  { transform: translate(0, -50%); }

/* Variante "bientôt" pour chip extrospection */
.tab-chip.tab-soon {
  background: rgba(20, 18, 30, 0.55);
  border-style: dashed;
}
.tab-chip.tab-soon .tab-chip-sub {
  color: var(--accent-coral);
  opacity: 0.85;
}

/* Edge zones (80px bord, invisibles) */
.edge-zone {
  position: fixed;
  z-index: 500;
  pointer-events: auto;
  background: transparent;
}
.edge-zone-top    { top: 0;    left: 0;  right: 0; height: 80px; }
.edge-zone-bottom { bottom: 0; left: 0;  right: 0; height: 80px; }
.edge-zone-left   { top: 0;    bottom: 0; left: 0; width: 80px; }
.edge-zone-right  { top: 0;    bottom: 0; right: 0; width: 80px; }

/* Désactive l'edge-zone sous une top-pill pour éviter conflict de hover */
@media (max-width: 720px) {
  .edge-zone-top { height: 60px; }
  .edge-zone-bottom { height: 60px; }
  .edge-zone-left,
  .edge-zone-right { width: 60px; }
}

/* Sas de transition (T2 ~400ms gradient palette) */
.transition-sas {
  position: fixed;
  inset: 0;
  z-index: 800;
  opacity: 0;
  pointer-events: none;
  transition: opacity 400ms var(--ease-in-out-soft, ease-in-out);
}
.transition-sas.is-active { opacity: 0.55; }

.transition-sas.sas-grey {
  background: linear-gradient(135deg, rgba(55, 65, 81, 0.0), rgba(156, 163, 175, 0.6), rgba(55, 65, 81, 0.0));
  animation: sasFlow 1.2s var(--ease-in-out-soft) both;
}
.transition-sas.sas-amber {
  background: linear-gradient(135deg, rgba(120, 53, 15, 0.0), rgba(251, 191, 36, 0.55), rgba(217, 119, 6, 0.0));
  animation: sasFlow 1.2s var(--ease-in-out-soft) both;
}
.transition-sas.sas-violet {
  background: linear-gradient(135deg, rgba(76, 29, 149, 0.0), rgba(168, 85, 247, 0.55), rgba(76, 29, 149, 0.0));
  animation: sasFlow 1.2s var(--ease-in-out-soft) both;
}
.transition-sas.sas-bluegold {
  background: linear-gradient(135deg, rgba(30, 58, 138, 0.0), rgba(251, 191, 36, 0.5), rgba(30, 58, 138, 0.0));
  animation: sasFlow 1.6s var(--ease-in-out-soft) both;
}

@keyframes sasFlow {
  0%   { background-position: 0% 50%;   filter: blur(0px); }
  50%  { background-position: 100% 50%; filter: blur(2px); }
  100% { background-position: 0% 50%;   filter: blur(0px); }
}

/* =======================================================
   === Overlays directionnels (Découverte / Introspection) ===
   Style cohérent avec #parametresModal (.modal-backdrop)
   ======================================================= */
/* === Overlays minimalistes : pure typo Bodoni, pas de panneau ===
   Style verrouillé 2026-05-28 — Tristan : "moins invasif, pas de fond,
   juste du texte, même pas de boutons, Bodoni comme page d'accueil". */

/* Variable shared : contour noir pour lisibilité du texte sur le cristal. */
:root {
  --txt-outline: 0 0 1px rgba(0,0,0,0.95), 0 0 3px rgba(0,0,0,0.8), 0 0 8px rgba(0,0,0,0.65), 0 2px 4px rgba(0,0,0,0.5);
}
/* Tous les textes des overlays héritent du contour. Le titre porte un contour plus marqué. */
.dim-overlay,
.modal-backdrop {
  text-shadow: var(--txt-outline);
}
.dim-overlay-title,
.modal h2 {
  text-shadow: 0 0 1px rgba(0,0,0,0.98), 0 0 4px rgba(0,0,0,0.85), 0 0 12px rgba(0,0,0,0.7), 0 3px 8px rgba(0,0,0,0.55);
}
/* Pride / Gay : texte transparent (background-clip), text-shadow ne s'applique pas
   correctement → on utilise drop-shadow sur le wrapper inline-flex. */
.overlay-btn-pride,
.overlay-btn-gay {
  filter: drop-shadow(0 0 2px rgba(0,0,0,0.85)) drop-shadow(0 0 6px rgba(0,0,0,0.65));
  text-shadow: none;
}
/* Le seuil "Entrer" et les chips reçoivent aussi le contour pour cohérence. */
.brand-pepite,
.brand-plus,
.arrival-tagline,
.enter-btn-label,
.arrival-hint,
.tab-chip-label,
.tab-chip-sub,
.tab-chip-icon,
.toast-soon-text {
  text-shadow: var(--txt-outline);
}
.dim-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6vh 1.5rem;
  /* Légère vignette pour la lisibilité sans masquer le cristal */
  background: radial-gradient(ellipse at center, transparent 30%, rgba(10, 10, 15, 0.55) 100%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease-out;
}
.dim-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}
.dim-overlay[hidden] { display: none; }

.dim-overlay-panel {
  position: relative;
  width: 100%;
  max-width: 640px;
  max-height: 88vh;
  overflow-y: auto;
  touch-action: pan-y; /* garde le scroll interne malgré touch-action:none global */
  overscroll-behavior: contain; /* scroller jusqu'au bout ne chaîne pas vers la page (anti-bounce) */
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  text-align: center;
  opacity: 0;
  transform: translate(0, 0);
  transition: opacity 0.52s ease-out, transform 0.52s cubic-bezier(0.22, 1, 0.36, 1);
}
.dim-overlay-left  .dim-overlay-panel { transform: translateX(-6%); }
.dim-overlay-right .dim-overlay-panel { transform: translateX(6%); }
.dim-overlay-down  .dim-overlay-panel { transform: translateY(6%); }
.dim-overlay-up    .dim-overlay-panel { transform: translateY(-6%); }
.dim-overlay.is-open .dim-overlay-panel {
  opacity: 1;
  transform: translate(0, 0);
}

.dim-overlay-title {
  font-family: var(--font-display);
  font-size: clamp(40px, 7vw, 64px);
  font-weight: 400;
  font-style: normal;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--text-primary);
  margin: 0 0 1.1rem;
}
.dim-overlay-sub {
  font-family: var(--font-body);
  color: var(--text-secondary);
  font-size: clamp(15px, 1.6vw, 18px);
  line-height: 1.55;
  margin: 0 0 2.6rem;
}

.dim-overlay-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.1rem;
}

/* Boutons → liens texte. Pas de fond, pas de bordure. */
.overlay-btn,
.overlay-btn-primary,
.overlay-btn-ghost,
.overlay-btn-large,
.overlay-btn-pride,
.overlay-btn-gay {
  display: inline-flex;
  align-items: baseline;
  gap: 0.55rem;
  padding: 0.2rem 0.4rem;
  background: none;
  border: none;
  border-radius: 0;
  box-shadow: none;
  color: var(--text-primary);
  font-family: var(--font-display);
  font-size: clamp(20px, 2.6vw, 26px);
  font-weight: 400;
  font-style: italic;
  letter-spacing: -0.01em;
  line-height: 1.2;
  cursor: pointer;
  text-decoration: none;
  position: relative;
  transition: opacity var(--duration-fast) ease, color var(--duration-fast) ease;
  filter: none;
}
.overlay-btn:hover,
.overlay-btn:focus-visible {
  background: none;
  transform: none;
  color: var(--text-primary);
  opacity: 0.7;
  outline: none;
}
.overlay-btn-icon { font-size: 0.85em; opacity: 0.65; }
.overlay-btn-label { font-weight: 400; letter-spacing: -0.01em; }

/* Variantes Pride/Gay : gradient appliqué au TEXTE (background-clip), pas de pill */
.overlay-btn-pride,
.overlay-btn-gay {
  font-size: clamp(28px, 4vw, 40px);
  -webkit-background-clip: text;
          background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}
.overlay-btn-pride {
  background-image: linear-gradient(90deg, #ff0018, #ffa52c, #ffff41, #008018, #0000f9, #86007d);
}
.overlay-btn-gay {
  background-image: linear-gradient(135deg, #ff7a8a, #c084fc, #60a5fa);
}
.overlay-btn-pride .overlay-btn-icon,
.overlay-btn-gay .overlay-btn-icon {
  -webkit-text-fill-color: initial;
  color: initial;
}
.overlay-btn-shimmer { display: none; }

.intro-actions { gap: 1.6rem; }

.dim-overlay-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
  width: 80px;
  margin: 2.4rem auto;
}

.dim-overlay-scratch {
  margin-top: 1.6rem;
}
.dim-overlay-scratch[hidden] { display: none; }

.dim-overlay-input {
  width: min(380px, 100%);
  margin: 0.7rem auto 0;
  padding: 0.55rem 0;
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 0;
  color: var(--text-primary);
  font-family: var(--font-display);
  font-size: clamp(17px, 2vw, 20px);
  font-style: italic;
  text-align: center;
  transition: border-color 0.25s ease;
  display: block;
}
.dim-overlay-input::placeholder { color: var(--text-secondary); font-style: italic; opacity: 0.6; }
.dim-overlay-input:focus {
  outline: none;
  border-bottom-color: rgba(255, 255, 255, 0.55);
}

.dim-overlay-artists-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.2rem;
  justify-content: center;
  margin-top: 1.2rem;
}
.artist-card {
  padding: 0.1rem 0.2rem;
  background: none;
  border: none;
  border-radius: 0;
  color: var(--text-secondary);
  font-family: var(--font-display);
  font-size: clamp(16px, 1.8vw, 19px);
  font-style: italic;
  font-weight: 400;
  cursor: pointer;
  text-align: center;
  transition: color 0.2s ease, opacity 0.2s ease;
}
.artist-card:hover { color: var(--text-primary); opacity: 1; }
.artist-card.is-selected {
  background: none;
  color: var(--text-primary);
  border: none;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

/* Eyebrow / label (CHERCHE UN ARTISTE, COMMENT TE SENS-TU) : minimal small-caps DM Sans */
.dim-overlay .param-label {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-secondary);
  opacity: 0.7;
  display: block;
  margin: 0 0 0.5rem;
}

/* Mood pills inline → text chips, pas de pill */
.mood-pills-inline {
  margin-top: 0.8rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.4rem;
  justify-content: center;
  opacity: 1;
  transform: none;
}
.dim-overlay .mood-pill {
  padding: 0.1rem 0.2rem;
  background: none;
  border: none;
  border-radius: 0;
  color: var(--text-secondary);
  font-family: var(--font-display);
  font-size: clamp(17px, 2vw, 21px);
  font-style: italic;
  font-weight: 400;
  cursor: pointer;
  transition: color 0.2s ease;
  box-shadow: none;
}
.dim-overlay .mood-pill:hover { color: var(--text-primary); }
.dim-overlay .mood-pill.is-selected,
.dim-overlay .mood-pill[aria-pressed="true"] {
  background: none;
  color: var(--text-primary);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 5px;
}

/* Close × discret en haut-droite du viewport */
.dim-overlay .modal-close {
  position: absolute;
  top: 1.4rem;
  right: 1.4rem;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.6rem;
  font-family: var(--font-display);
  font-weight: 300;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.2s ease;
  width: 2rem; height: 2rem;
  display: flex; align-items: center; justify-content: center;
}
.dim-overlay .modal-close:hover { opacity: 1; }

/* =======================================================
   === Toast Extrospection (Bientôt) ===
   ======================================================= */
.toast-soon {
  position: fixed;
  left: 50%;
  bottom: 6rem;
  transform: translate(-50%, 20px);
  z-index: 1100;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.85rem 1.4rem;
  background: linear-gradient(135deg, rgba(30, 58, 138, 0.9), rgba(251, 191, 36, 0.85));
  color: white;
  font-family: var(--font-body);
  font-size: 0.95rem;
  border-radius: 999px;
  box-shadow: 0 12px 40px rgba(30, 58, 138, 0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 500ms var(--ease-out-soft), transform 500ms var(--ease-out-soft);
}
.toast-soon[hidden] { display: none; }
.toast-soon.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}
.toast-soon-icon { font-size: 1.15rem; }

/* =======================================================
   === Seuil d'arrivée — dismiss après clic Entrer ===
   ======================================================= */
.phase-arrival.is-dismissed {
  opacity: 0;
  transform: scale(0.98);
  transition: opacity 600ms var(--ease-out-soft), transform 600ms var(--ease-out-soft);
  pointer-events: none;
}
body[data-arrived="true"] .phase-arrival { display: none; }
body.has-overlay .phase-arrival { display: none; }

/* =======================================================
   Viewer musique (sticky player du finder) — ANCRÉ EN HAUT sur mobile.
   `viewer.css` (partagé, chargé après dans le <body>) le met en BAS en mobile
   (top:auto; bottom:0; column-reverse). Ici, scopé à /experience uniquement
   (ce fichier ne charge que là) + spécificité `body[data-current-mode]` pour
   battre viewer.css. Le site classique garde son player en bas (header en haut).
   ======================================================= */
@media (max-width: 720px) {
  body[data-current-mode] #pep-sticky-player {
    top: 0;
    bottom: auto;
    border-top: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    flex-direction: column; /* barre en haut, file d'attente déployée en dessous */
  }
  /* Player plus en bas → pas de réserve d'espace en bas du body. */
  body[data-current-mode].pep-has-sticky-player { padding-top: 0; padding-bottom: 0; }
  body[data-current-mode].pep-sticky-player-expanded { padding-top: 0; padding-bottom: 0; }
}

/* =======================================================
   IMPORT DE MUSIQUE (demande Tristan 2026-06-01, Q1=B)
   « Importer ma musique » = zone cliquable du menu Paramètres qui DÉPLOIE les
   options EN TEXTE (pas de gros boutons colorés). Chaque option ouvre son modal,
   calqué sur #contactModal (typo pure, translucide, lisible sur le cristal).
   Wiring : imports-experience.js. Modals : spotify/deezer/json/artistPicker.
   ======================================================= */

/* --- Déploiement « Importer » dans le menu Paramètres (texte, cohérent .param-menu) --- */
.param-imports { width: 100%; text-align: center; }
.param-imports > summary {
  list-style: none;
  cursor: pointer;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
  padding: 0.5rem 0.2rem;
  /* Même traitement que .param-menu-item (texte noir, sans contour) pour rester
     cohérent avec les items voisins du menu. */
  color: #000;
  -webkit-text-stroke: 0;
  text-shadow: none;
  font-family: var(--font-body);
  font-size: clamp(19px, 4.4vw, 24px);
  font-weight: 500;
  transition: opacity 0.18s ease;
}
.param-imports > summary::-webkit-details-marker { display: none; }
.param-imports > summary::marker { content: ''; }
.param-imports > summary:hover,
.param-imports > summary:focus-visible { opacity: 0.8; outline: none; }
.param-imports[open] > summary { opacity: 0.9; }
.param-imports-hint {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  opacity: 0.85;
}
.param-imports-options {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  margin: 0.35rem 0 0.2rem;
}
.param-imports-opt {
  background: none; border: none; cursor: pointer;
  padding: 0.25rem 0.2rem;
  color: #000;
  text-shadow: none;
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(16px, 3.6vw, 20px);
  text-decoration: none;
  transition: opacity 0.18s ease, text-decoration-thickness 0.2s ease;
}
.param-imports-opt:hover,
.param-imports-opt:focus-visible {
  outline: none;
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* --- Contenu des modals d'import (calqué sur #contactModal) --- */
.import-content {
  display: flex; flex-direction: column; gap: 0.9rem;
  max-width: 460px; margin: 0 auto; text-align: left;
}
.import-hint {
  font-family: var(--font-body); font-size: 14px;
  color: var(--text-secondary); line-height: 1.5; margin: 0; text-align: center;
}
.import-steps {
  margin: 0; padding-left: 1.2rem;
  font-family: var(--font-body); font-size: 13.5px;
  color: var(--text-secondary); line-height: 1.6; text-align: left;
}
.import-steps li { margin: 0.2rem 0; }
.import-steps a { color: var(--text-primary); text-decoration: underline; }
.import-content input[type="text"],
.import-content input[type="search"],
.import-content input[type="file"],
.import-content textarea {
  width: 100%; box-sizing: border-box;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  color: var(--text-primary);
  font-family: var(--font-body); font-size: 15px;
  padding: 0.7rem 0.8rem;
  transition: border-color 0.25s ease;
}
.import-content textarea {
  resize: vertical; min-height: 110px;
  font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px;
}
.import-content input::placeholder,
.import-content textarea::placeholder { color: var(--text-secondary); opacity: 0.6; }
.import-content input:focus,
.import-content textarea:focus { outline: none; border-color: rgba(255, 255, 255, 0.5); }
.import-btn {
  align-self: center; margin-top: 0.1rem;
  background: none; border: none; cursor: pointer;
  color: var(--text-primary);
  font-family: var(--font-display); font-style: italic; font-size: clamp(18px, 2.2vw, 22px);
  text-decoration: underline; text-underline-offset: 5px; text-decoration-thickness: 1px;
  transition: text-decoration-thickness 0.2s ease, opacity 0.2s ease;
}
.import-btn:hover { text-decoration-thickness: 2px; }
.import-btn[disabled] { opacity: 0.5; cursor: default; }
.import-status {
  font-family: var(--font-body); font-size: 13px; text-align: center;
  color: var(--text-secondary); margin: 0.2rem 0 0; line-height: 1.4;
}
.import-status.ok { color: #8be9b0; }
.import-status.error { color: #fca5a5; }

/* --- Picker d'artistes Last.fm (artist-picker.js → .artist-picker-row / .artist-card) --- */
.artist-picker-modal .import-hint { margin-bottom: 0.4rem; }
.artist-picker-search-wrap { max-width: 360px; margin: 0 auto 0.6rem; }
.artist-picker-search {
  width: 100%; box-sizing: border-box;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  color: var(--text-primary);
  font-family: var(--font-body); font-size: 15px;
  padding: 0.55rem 1rem; text-align: center;
}
.artist-picker-search::placeholder { color: var(--text-secondary); opacity: 0.6; }
.artist-picker-search:focus { outline: none; border-color: rgba(255, 255, 255, 0.5); }
.artist-picker-grid {
  display: flex; flex-direction: column; align-items: center; gap: 0.5rem;
  min-height: 170px; justify-content: center; margin: 0.4rem 0;
}
.artist-picker-row { display: flex; justify-content: center; gap: 0.5rem; flex-wrap: wrap; }
.artist-card {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  color: var(--text-primary);
  font-family: var(--font-display); font-style: italic; font-size: clamp(14px, 1.8vw, 17px);
  padding: 0.4rem 0.95rem; cursor: pointer;
  max-width: 46vw; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: opacity 0.4s ease, transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}
.artist-card:hover { border-color: rgba(255, 255, 255, 0.5); background: rgba(255, 255, 255, 0.12); transform: translateY(-1px); }
.artist-card-entering { opacity: 0; }
.artist-card-leaving { opacity: 0; transform: scale(0.9); pointer-events: none; }
.artist-picker-more-btn {
  display: block; margin: 0.2rem auto 0;
  background: none; border: none; cursor: pointer;
  color: var(--text-secondary);
  font-family: var(--font-display); font-style: italic; font-size: 15px;
  text-decoration: underline; text-underline-offset: 4px;
}
.artist-picker-more-btn:hover { color: var(--text-primary); }
.artist-picker-footer {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  margin-top: 0.8rem; flex-wrap: wrap;
}
.artist-picker-count { font-family: var(--font-body); font-size: 13px; color: var(--text-secondary); }
.artist-picker-confirm-btn {
  background: none; border: none; cursor: pointer;
  color: var(--text-primary);
  font-family: var(--font-display); font-style: italic; font-size: clamp(17px, 2.1vw, 21px);
  text-decoration: underline; text-underline-offset: 5px; text-decoration-thickness: 1px;
  transition: text-decoration-thickness 0.2s ease, opacity 0.2s ease;
}
.artist-picker-confirm-btn:hover { text-decoration-thickness: 2px; }
.artist-picker-confirm-btn[disabled] { opacity: 0.45; cursor: default; }
.artist-picker-loading, .artist-picker-empty, .artist-picker-searching {
  font-family: var(--font-body); font-size: 14px; color: var(--text-secondary); text-align: center;
}
