:root {
  --void: #040507;
  --surface: #0a0d12;

  --text: #eef2f8;
  --muted: #9fb0c2;

  --axis: #7be8ff;
  --violet: #7b6cff;
}

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

html {
  scroll-behavior: smooth;
}

body {
  width: 100%;
  min-height: 100%;

  background: var(--void);

  color: var(--text);

  font-family: "Space Grotesk", sans-serif;

  overflow-x: hidden;
}

canvas {
  position: fixed;

  inset: 0;

  width: 100%;
  height: 100%;

  z-index: 0;
}

main {
  position: relative;

  z-index: 2;
}

/* ==================================================
   HEADER
   FIX: était en flux normal (non positionné) donc
   peint AVANT le canvas fixed -> invisible à l'écran.
   Passage en fixed + z-index cohérent avec le reste.
================================================== */

header {
  position: fixed;

  top: 0;
  left: 0;
  right: 0;

  z-index: 20;

  display: flex;

  justify-content: space-between;

  align-items: center;

  padding: 2rem 3vw;

  pointer-events: none;
}

header .brand {
  font-family: "JetBrains Mono", monospace;

  font-size: 0.85rem;

  letter-spacing: 0.25em;

  color: var(--text);
}

header .brand span {
  color: var(--axis);
}

header .protocol {
  font-family: "JetBrains Mono", monospace;

  font-size: 0.7rem;

  letter-spacing: 0.3em;

  color: var(--muted);
}

@media (max-width: 700px) {
  header {
    padding: 1.5rem 6vw;

    font-size: 0.9em;
  }
}

.section {
  min-height: 100vh;

  display: flex;

  justify-content: center;

  align-items: center;

  padding: 10vh 10vw;

  position: relative;

  text-align: center;
}

.section > div {
  max-width: 900px;
}

/* ==================================================
   TYPOGRAPHY
================================================== */

.label {
  font-family: "JetBrains Mono", monospace;

  font-size: 0.75rem;

  letter-spacing: 0.55em;

  text-transform: uppercase;

  color: var(--axis);

  margin-bottom: 2.5rem;
}

h1 {
  font-size: clamp(4rem, 12vw, 10rem);

  line-height: 0.86;

  font-weight: 500;

  letter-spacing: -0.05em;
}

.title-slash {
  color: var(--axis);

  display: inline-block;

  vertical-align: -0.04em;
}

h2 {
  font-size: clamp(2.5rem, 8vw, 7rem);

  font-weight: 400;

  letter-spacing: 0.18em;

  text-transform: uppercase;
}

p {
  margin-top: 2rem;

  max-width: 520px;

  margin-left: auto;

  margin-right: auto;

  color: var(--muted);

  font-size: 1rem;

  line-height: 2;

  letter-spacing: 0.08em;
}

/* ==================================================
   GLYPH
   FIX: classe utilisée dans le HTML (signal, transmission,
   constellation, visual) mais jamais définie.
   Traitement typographique dédié + JetBrains Mono, qui
   était importée mais nulle part utilisée.
================================================== */

.glyph {
  margin-top: 3rem;

  font-family: "JetBrains Mono", monospace;

  font-size: 0.95rem;

  letter-spacing: 0.4em;

  color: var(--violet);

  opacity: 0.8;

  text-transform: uppercase;
}

/* ==================================================
   AXIS
================================================== */

.axis {
  position: fixed;

  left: 50%;

  top: 0;

  bottom: 0;

  width: 1px;

  background: linear-gradient(180deg, var(--axis), var(--violet));

  opacity: 0.35;

  box-shadow: 0 0 30px rgba(123, 232, 255, 0.5);

  z-index: 5;

  pointer-events: none;
}

.axis::after {
  content: "";

  position: absolute;

  left: 50%;

  transform: translateX(-50%);

  width: 5px;

  height: 120px;

  background: linear-gradient(transparent, #fff, transparent);

  filter: blur(4px);

  animation: axisTravel 7s linear infinite;
}

@keyframes axisTravel {
  from {
    top: -120px;
  }

  to {
    top: 100vh;
  }
}

/* ==================================================
   GLOW
================================================== */

.glow {
  position: fixed;

  width: 520px;

  height: 520px;

  border-radius: 50%;

  background: radial-gradient(
    circle,
    rgba(123, 232, 255, 0.13),
    transparent 70%
  );

  transform: translate(-50%, -50%);

  pointer-events: none;

  z-index: 1;
}

/* ==================================================
   WAVE
================================================== */

.wave {
  font-size: 6rem;

  color: var(--axis);

  opacity: 0.75;

  animation: pulse 5s ease-in-out infinite;
}

@keyframes pulse {
  50% {
    opacity: 0.25;

    transform: scale(1.08);
  }
}

/* ==================================================
   CONSTELLATION (dots)
   FIX: définis mais jamais posés dans le HTML.
   Conservés ici et branchables au besoin ; le rendu
   actuel de la section "constellation" repose sur
   .glyph, donc ce bloc reste disponible sans casser
   l'existant si tu ajoutes des <div class="dots"> plus tard.
================================================== */

.dots {
  display: flex;

  justify-content: center;

  gap: 40px;

  margin-top: 50px;
}

.dot {
  width: 8px;

  height: 8px;

  border-radius: 50%;

  background: var(--axis);

  box-shadow: 0 0 20px var(--axis);
}

/* ==================================================
   SCENE IMAGE
   Conteneur injecté par content.js. Vide par défaut
   (:empty), donc invisible tant qu'aucune image n'est
   ajoutée depuis l'éditeur — pas d'impact sur les
   sections qui n'en ont pas.
================================================== */

.scene-image:empty {
  display: none;
}

.scene-image {
  margin-top: 3rem;
  margin-bottom: 3rem;
  display: flex;

  justify-content: center;
}

.scene-image img {
  max-width: 100%;

  max-height: 52vh;

  width: auto;

  border-radius: 6px;

  box-shadow: 0 0 60px rgba(123, 232, 255, 0.12);

  border: 1px solid rgba(123, 232, 255, 0.15);
}

/* ==================================================
   ARCHIVES
================================================== */

.archive {
  display: flex;

  flex-wrap: wrap;

  justify-content: center;

  gap: 3rem;

  margin-top: 3rem;

  font-family: "JetBrains Mono", monospace;

  font-size: 0.85rem;

  letter-spacing: 0.15em;

  color: var(--muted);
}

.archive div {
  color: var(--text);
}

/* ==================================================
   SCANNER
================================================== */

#scanner {
  position: fixed;

  width: 180px;

  height: 180px;

  border-radius: 50%;

  border: 1px solid rgba(123, 232, 255, 0.18);

  transform: translate(-50%, -50%);

  opacity: 0;

  z-index: 6;

  pointer-events: none;
}

/* ==================================================
   HUD
================================================== */

#hud {
  position: fixed;

  right: 30px;

  bottom: 30px;

  z-index: 10;

  font-family: "JetBrains Mono", monospace;

  font-size: 11px;

  letter-spacing: 0.35em;

  line-height: 2;

  color: rgba(220, 240, 255, 0.35);
}

/* ==================================================
   ACCESSIBILITÉ
   FIX: pas de prise en compte de prefers-reduced-motion.
   On coupe les animations décoratives pour les utilisateurs
   qui ont demandé une réduction de mouvement.
================================================== */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .axis::after {
    animation: none;

    display: none;
  }

  .wave {
    animation: none;
  }
}

/* ==================================================
   MOBILE
================================================== */

@media (max-width: 700px) {
  h1 {
    letter-spacing: -0.03em;
  }

  h2 {
    letter-spacing: 0.1em;
  }

  .axis {
    opacity: 0.5;
  }

  .section {
    padding: 8vh 8vw;
  }

  .glyph {
    letter-spacing: 0.25em;

    font-size: 0.8rem;
  }
}
