/* ============================================================
   PALETTE
   ============================================================ */
:root {
  --jaune: #ffd93b;
  --vert: #3fa34d;
  --bleu: #2b7fd4;
  --rouge: #e85a2a;
  --rouge-vif: #ff6b35;
  --violet: #a259ff;
  --violet-fonce: #7b3fbf;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { min-height: 100%; }

body {
  font-family: 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
  color: #e8e8e8;
  padding-top: 90px;
  min-height: 100vh;
  overflow-x: hidden;
  background: #0a0a0a;
}

/* ============================================================
   GALAXIE
   ============================================================ */
.galaxie {
  position: fixed;
  inset: 0;
  z-index: -3;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 20% 30%, rgba(123, 63, 191, 0.18), transparent 55%),
    radial-gradient(ellipse at 80% 70%, rgba(43, 127, 212, 0.14), transparent 55%),
    radial-gradient(ellipse at 50% 50%, rgba(30, 15, 60, 0.45), transparent 75%),
    linear-gradient(180deg, #0a0a14 0%, #0a0a0a 50%, #0a0a14 100%);
  transition: opacity 0.6s ease;
}
body.theme-vert   .galaxie,
body.theme-rouge  .galaxie,
body.theme-bleu   .galaxie,
body.theme-violet .galaxie { opacity: 0; }

.etoiles {
  position: absolute;
  inset: -50%;
  width: 200%; height: 200%;
  background-repeat: repeat;
  opacity: 0.8;
  will-change: transform;
}
.etoiles-petites {
  background-image:
    radial-gradient(1px 1px at 20px 30px, #ffffff, transparent),
    radial-gradient(1px 1px at 200px 150px, #ffffff, transparent),
    radial-gradient(1px 1px at 400px 200px, #ffffff, transparent),
    radial-gradient(1px 1px at 600px 250px, #ffffff, transparent);
  background-size: 800px 300px;
  animation: derive 240s linear infinite;
}
.etoiles-moyennes {
  background-image:
    radial-gradient(2px 2px at 80px 60px, #fff8d6, transparent),
    radial-gradient(2px 2px at 450px 90px, #d6e8ff, transparent),
    radial-gradient(2px 2px at 850px 140px, #f0e0ff, transparent);
  background-size: 1000px 400px;
  opacity: 0.6;
  animation: derive 360s linear infinite reverse;
}
@keyframes derive {
  from { transform: translate3d(0, 0, 0); }
  to   { transform: translate3d(-400px, -200px, 0); }
}

/* ============================================================
   FONDS THÉMATIQUES
   ============================================================ */
.fond-theme {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  overflow: hidden;
}
.fond-vert, .fond-rouge, .fond-bleu, .fond-violet, .fond-jaune {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.6s ease;
  pointer-events: none;
  overflow: hidden;
}
body.theme-vert   .fond-vert   { opacity: 1; }
body.theme-rouge  .fond-rouge  { opacity: 1; }
body.theme-bleu   .fond-bleu   { opacity: 1; }
body.theme-violet .fond-violet { opacity: 1; }
body.theme-jaune  .fond-jaune  { opacity: 1; }

/* VERT */
.fond-vert {
  background:
    radial-gradient(circle at 20% 30%, rgba(63, 163, 77, 0.16), transparent 55%),
    radial-gradient(circle at 80% 70%, rgba(63, 163, 77, 0.1), transparent 55%),
    linear-gradient(180deg, #0a1c0e 0%, #051008 100%);
}
.feuille-fond {
  position: absolute;
  top: -40px;
  font-size: 1.6rem;
  opacity: 0.35;
  filter: hue-rotate(15deg) brightness(0.9);
  animation: tomber-feuille 18s linear infinite;
  will-change: transform;
}
.f1 { left: 10%; animation-delay: 0s; }
.f3 { left: 45%; animation-delay: 6s; }
.f5 { left: 85%; animation-delay: 10s; }
@keyframes tomber-feuille {
  0%   { transform: translate3d(0, 0, 0) rotate(0deg); opacity: 0; }
  10%  { opacity: 0.35; }
  90%  { opacity: 0.35; }
  100% { transform: translate3d(0, 110vh, 0) rotate(360deg); opacity: 0; }
}

/* ROUGE */
.fond-rouge {
  background:
    radial-gradient(circle at 25% 85%, rgba(232, 90, 42, 0.2), transparent 55%),
    radial-gradient(circle at 75% 20%, rgba(255, 107, 53, 0.14), transparent 55%),
    radial-gradient(circle at 50% 100%, rgba(180, 50, 15, 0.18), transparent 60%),
    linear-gradient(180deg, #140604 0%, #080201 100%);
}
.flamme-fond {
  position: absolute;
  bottom: -30px;
  font-size: 2.4rem;
  opacity: 0.22;
  filter: saturate(1.2) blur(1.2px);
  animation: crepiter 5s ease-in-out infinite;
  user-select: none;
  will-change: transform;
}
.fl1 { left: 15%; animation-delay: 0s; font-size: 2.6rem; }
.fl3 { left: 70%; animation-delay: 2.5s; font-size: 2.2rem; }
@keyframes crepiter {
  0%   { transform: translate3d(0, 0, 0) scale(1);       opacity: 0.18; }
  50%  { transform: translate3d(0, -6px, 0) scale(1.06); opacity: 0.3; }
  100% { transform: translate3d(0, 0, 0) scale(1);       opacity: 0.18; }
}

/* BLEU */
.fond-bleu {
  background:
    radial-gradient(ellipse at 50% 0%, rgba(43, 127, 212, 0.25), transparent 60%),
    radial-gradient(ellipse at 30% 100%, rgba(20, 70, 140, 0.18), transparent 60%),
    linear-gradient(180deg, #03101f 0%, #010710 100%);
}
.bulle-fond {
  position: absolute;
  bottom: -20px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(200, 230, 255, 0.7), rgba(43, 127, 212, 0.15));
  border: 1px solid rgba(180, 220, 255, 0.35);
  animation: monter-bulle 16s linear infinite;
  will-change: transform;
}
.b1 { left: 15%; width: 8px;  height: 8px;  animation-delay: 0s; }
.b3 { left: 50%; width: 6px;  height: 6px;  animation-delay: 5s; }
.b5 { left: 82%; width: 7px;  height: 7px;  animation-delay: 10s; }
@keyframes monter-bulle {
  0%   { transform: translate3d(0, 0, 0); opacity: 0; }
  10%  { opacity: 0.8; }
  90%  { opacity: 0.5; }
  100% { transform: translate3d(20px, -110vh, 0); opacity: 0; }
}

/* VIOLET */
.fond-violet {
  background:
    radial-gradient(circle at 50% 50%, rgba(162, 89, 255, 0.22), transparent 60%),
    radial-gradient(circle at 20% 80%, rgba(123, 63, 191, 0.16), transparent 55%),
    radial-gradient(circle at 80% 20%, rgba(123, 63, 191, 0.16), transparent 55%),
    linear-gradient(180deg, #0f0422 0%, #060114 100%);
  animation: respiration-violette 6s ease-in-out infinite;
}
@keyframes respiration-violette {
  0%   { filter: brightness(1); }
  50%  { filter: brightness(1.1); }
  100% { filter: brightness(1); }
}
.vie-fond {
  position: absolute;
  font-size: 1.3rem;
  opacity: 0.45;
  filter: drop-shadow(0 0 8px rgba(162, 89, 255, 0.8));
  animation: scintiller 5s ease-in-out infinite;
  will-change: transform;
}
.v1 { top: 15%; left: 12%; animation-delay: 0s; }
.v3 { bottom: 15%; left: 45%; animation-delay: 2.5s; }
@keyframes scintiller {
  0%   { transform: scale(0.85); opacity: 0.3; }
  50%  { transform: scale(1.15); opacity: 0.65; }
  100% { transform: scale(0.85); opacity: 0.3; }
}

/* JAUNE */
.fond-jaune {
  background:
    radial-gradient(circle at 20% 20%, rgba(255, 217, 59, 0.14), transparent 55%),
    radial-gradient(circle at 80% 80%, rgba(255, 217, 59, 0.14), transparent 55%),
    radial-gradient(circle at 50% 50%, rgba(255, 217, 59, 0.07), transparent 70%);
}

/* ============================================================
   MODE ÉCONOME
   ============================================================ */
.low-perf .etoiles,
.low-perf .feuille-fond,
.low-perf .flamme-fond,
.low-perf .bulle-fond,
.low-perf .vie-fond,
.low-perf .fond-violet {
  animation: none !important;
}
.low-perf .galaxie { display: none; }
.low-perf .cadre {
  background: rgba(18, 18, 18, 0.92);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.low-perf .navbar {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  background: rgba(10, 10, 10, 0.98);
}

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

/* ============ NAVBARRE ============ */
.navbar {
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  background: rgba(10, 10, 10, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 2px solid var(--jaune);
  box-shadow: 0 0 12px rgba(255, 217, 59, 0.2);
  z-index: 1000;
  padding: 15px 20px;
}
.nav-list {
  display: flex;
  justify-content: center;
  align-items: center;
  list-style: none;
  gap: 25px;
  flex-wrap: wrap;
}
.nav-link {
  text-decoration: none;
  color: #e8e8e8;
  font-size: 1.05rem;
  font-weight: 600;
  padding: 8px 18px;
  border-radius: 6px;
  border: 1px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
  position: relative;
  letter-spacing: 0.5px;
  cursor: pointer;
}
.nav-link[data-couleur="jaune"]:hover   { color: var(--jaune); border-color: var(--jaune); }
.nav-link[data-couleur="vert"]:hover    { color: var(--vert); border-color: var(--vert); }
.nav-link[data-couleur="bleu"]:hover    { color: var(--bleu); border-color: var(--bleu); }
.nav-link[data-couleur="rouge"]:hover   { color: var(--rouge-vif); border-color: var(--rouge); }
.nav-link[data-couleur="violet"]:hover  { color: var(--violet); border-color: var(--violet); }

.nav-link.active[data-couleur="jaune"]  { color: var(--jaune); border-color: var(--jaune); background: rgba(255, 217, 59, 0.08); }
.nav-link.active[data-couleur="vert"]   { color: var(--vert);  border-color: var(--vert);  background: rgba(63, 163, 77, 0.08); }
.nav-link.active[data-couleur="bleu"]   { color: var(--bleu);  border-color: var(--bleu);  background: rgba(43, 127, 212, 0.08); }
.nav-link.active[data-couleur="rouge"]  { color: var(--rouge-vif); border-color: var(--rouge); background: rgba(232, 90, 42, 0.1); }
.nav-link.active[data-couleur="violet"] { color: var(--violet); border-color: var(--violet); background: rgba(162, 89, 255, 0.1); }

/* ===== BOUTON BLOG (à la suite de CV, jaune) ===== */
.nav-link-blog {
  color: var(--jaune) !important;
  border: 1px solid var(--jaune);
  background: rgba(255, 217, 59, 0.06);
  font-weight: 700;
  margin-left: 10px;
}
.nav-link-blog:hover {
  color: #0a0a0a !important;
  background: var(--jaune);
  border-color: var(--jaune);
  box-shadow: 0 0 12px rgba(255, 217, 59, 0.6);
}

/* ============ CADRE ============ */
.cadre {
  max-width: 900px;
  margin: 30px auto;
  padding: 40px;
  background: rgba(18, 18, 18, 0.55);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 2px solid var(--jaune);
  border-radius: 12px;
  box-shadow: 0 0 20px rgba(255, 217, 59, 0.15);
  position: relative;
}

/* ============ OREILLES ============ */
.oreille {
  position: absolute;
  top: -14px;
  width: 0; height: 0;
  z-index: 3;
  pointer-events: none;
}
.oreille::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 0; height: 0;
  border-left: 14px solid transparent;
  border-right: 14px solid transparent;
  border-bottom: 18px solid var(--jaune);
  border-radius: 4px 4px 0 0;
}
.oreille::after {
  content: '';
  position: absolute;
  top: 6px; left: 7px;
  width: 0; height: 0;
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-bottom: 9px solid #121212;
  border-radius: 2px 2px 0 0;
}
.oreille-gauche { left: 30px; transform: rotate(-8deg); }
.oreille-droite { right: 30px; transform: rotate(8deg); }

/* ============ SECTIONS ============ */
.section {
  display: none;
  padding: 25px;
  border-left: 4px solid var(--jaune);
  background: rgba(255, 255, 255, 0.015);
  border-radius: 0 8px 8px 0;
  position: relative;
  overflow: hidden;
  min-height: 180px;
}
.section.active {
  display: block;
  animation: fadeIn 0.3s ease;
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.section-jaune { border-left-color: var(--jaune); background: rgba(255, 217, 59, 0.03); }
.section-jaune h2 { color: var(--jaune); border-bottom-color: rgba(255, 217, 59, 0.25); }
.section-vert { border-left-color: var(--vert); background: rgba(63, 163, 77, 0.05); }
.section-vert h2 { color: var(--vert); border-bottom-color: rgba(63, 163, 77, 0.35); }
.section-rouge { border-left-color: var(--rouge); background: rgba(232, 90, 42, 0.06); }
.section-rouge h2 { color: var(--rouge-vif); border-bottom-color: rgba(255, 107, 53, 0.4); }
.section-bleu { border-left-color: var(--bleu); background: rgba(43, 127, 212, 0.06); }
.section-bleu h2 { color: var(--bleu); border-bottom-color: rgba(43, 127, 212, 0.35); }
.section-violet { border-left-color: var(--violet-fonce); background: rgba(123, 63, 191, 0.07); }
.section-violet h2 { color: var(--violet); border-bottom-color: rgba(162, 89, 255, 0.4); }

/* ============ TITRES ============ */
.section h2 {
  font-size: 1.6rem;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid;
  letter-spacing: 1px;
  position: relative;
  z-index: 2;
}
.section p {
  font-size: 1.05rem;
  line-height: 1.7;
  color: #d8d8d8;
  position: relative;
  z-index: 2;
}

/* ============ PATTES ============ */
.patte {
  position: absolute;
  font-size: 0.9rem;
  opacity: 0.35;
  pointer-events: none;
  user-select: none;
  z-index: 1;
  filter: hue-rotate(50deg) brightness(1.3);
}
.patte-hg { top: 8px; left: 8px; transform: rotate(-20deg); }
.patte-bd { bottom: 8px; right: 8px; transform: rotate(160deg); }
.patte-bg { bottom: 8px; left: 8px; transform: rotate(-60deg); opacity: 0.25; }

/* ============================================================
   BULLES COMPÉTENCES FLOTTANTES (survol = rouge)
   ============================================================ */
.bulles-container {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  margin-top: 15px;
  position: relative;
  z-index: 2;
}
.bulle {
  background: rgba(232, 90, 42, 0.12);
  border: 2px solid var(--rouge);
  border-radius: 30px;
  padding: 10px 22px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--rouge-vif);
  box-shadow: 0 0 8px rgba(232, 90, 42, 0.35);
  animation: flotter 3s ease-in-out infinite;
  position: relative;
  letter-spacing: 0.5px;
  transition: transform 0.25s ease, background 0.25s ease, border-color 0.25s ease, color 0.25s ease, box-shadow 0.25s ease;
}
.bulle:hover {
  background: rgba(232, 90, 42, 0.25);
  border-color: var(--rouge-vif);
  color: #ffb199;
  box-shadow: 0 0 18px rgba(232, 90, 42, 0.9),
              0 0 30px rgba(255, 107, 53, 0.6);
  transform: scale(1.08);
  animation-play-state: paused;
}
@keyframes flotter {
  0%   { transform: translateY(0px); }
  50%  { transform: translateY(-7px); }
  100% { transform: translateY(0px); }
}
.bulle:nth-child(1) { animation-delay: 0s; }
.bulle:nth-child(2) { animation-delay: 0.4s; }
.bulle:nth-child(3) { animation-delay: 0.8s; }
.bulle:nth-child(4) { animation-delay: 1.2s; }
.bulle:nth-child(5) { animation-delay: 1.6s; }
.bulle:nth-child(6) { animation-delay: 2s; }

/* ============================================================
   FEU D'ARTIFICE
   ============================================================ */
.etincelle {
  position: fixed;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 2000;
  animation: explosion 0.6s ease-out forwards;
}
@keyframes explosion {
  0%   { transform: translate(0, 0) scale(1); opacity: 1; }
  100% { transform: translate(var(--dx), var(--dy)) scale(0.2); opacity: 0; }
}

/* ============ RESPONSIVE ============ */
@media (max-width: 600px) {
  .nav-list { gap: 8px; }
  .nav-link { font-size: 0.85rem; padding: 6px 10px; }
  .cadre { margin: 15px; padding: 20px; }
  .section h2 { font-size: 1.3rem; }
  .section p { font-size: 0.95rem; }
  .bulle { font-size: 0.85rem; padding: 8px 16px; }
}
