@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;600;700;900&family=Exo+2:wght@300;400;500;600&family=Share+Tech+Mono&display=swap');

:root {
  --bg-deep: #020b18;
  --bg-mid: #061525;
  --blue-primary: #0d6efd;
  --blue-bright: #00c2ff;
  --blue-glow: #38bdf8;
  --cyan: #06b6d4;
  --purple: #7c3aed;
  --accent: #00e5ff;
  --text-main: #e2f0ff;
  --text-dim: #94b8d4;
  --glass: rgba(6, 30, 60, 0.7);
  --glass-border: rgba(0, 194, 255, 0.2);
  --card-bg: rgba(4, 20, 45, 0.85);
  --nav-height: 70px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Exo 2', sans-serif;
  background-color: var(--bg-deep);
  color: var(--text-main);
  overflow-x: hidden;
  min-height: 100vh;
}

/* =============================================
   FOND : COUCHES SUPERPOSÉES ANIMÉES
   ============================================= */

/* Couche 1 – dégradés radiaux statiques (plus d'animation filter) */
.bg-animated {
  position: fixed; inset: 0; z-index: -3;
  background:
    radial-gradient(ellipse 70% 50% at 50% 0%,   rgba(0,100,255,0.2) 0%, transparent 60%),
    radial-gradient(ellipse 40% 35% at 95% 85%,  rgba(124,58,237,0.14) 0%, transparent 55%),
    radial-gradient(ellipse 50% 40% at 5%  75%,  rgba(0,194,255,0.1)  0%, transparent 55%),
    radial-gradient(ellipse 30% 25% at 80% 10%,  rgba(0,229,255,0.06)  0%, transparent 50%),
    linear-gradient(160deg, #010d1e 0%, #020f20 40%, #030e1c 70%, #010b17 100%);
  /* Pas d'animation — filter: brightness/saturate est très coûteux */
}

/* Couche 2 – grille perspective (lignes fines, fondue sur les bords) */
.grid-overlay {
  position: fixed; inset: 0; z-index: -2;
  background-image:
    linear-gradient(rgba(0,194,255,0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,194,255,0.06) 1px, transparent 1px),
    linear-gradient(rgba(0,194,255,0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,194,255,0.02) 1px, transparent 1px);
  background-size: 80px 80px, 80px 80px, 20px 20px, 20px 20px;
  animation: gridMove 30s linear infinite;
  mask-image: radial-gradient(ellipse 90% 80% at 50% 50%, black 30%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 90% 80% at 50% 50%, black 30%, transparent 100%);
}

@keyframes gridMove {
  0%   { background-position: 0 0, 0 0, 0 0, 0 0; }
  100% { background-position: 80px 80px, 80px 80px, 20px 20px, 20px 20px; }
}

/* Couche 3 – nébuleuse : blur réduit, will-change pour GPU */
.nebula {
  position: fixed; inset: 0; z-index: -2; pointer-events: none;
}
.nebula-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px); /* réduit de 80 → 60px */
  opacity: 0.1;       /* réduit de 0.12 → 0.10 */
  will-change: transform;
  animation: blobDrift linear infinite alternate;
}
.nb1 { width: 450px; height: 450px; top: -80px; left: -80px;
  background: radial-gradient(circle, #0d6efd, transparent 70%);
  animation-duration: 22s; } /* ralenti pour moins de repaints */
.nb2 { width: 350px; height: 350px; bottom: -60px; right: -60px;
  background: radial-gradient(circle, #7c3aed, transparent 70%);
  animation-duration: 28s; animation-delay: -9s; }
.nb3 { width: 300px; height: 300px; top: 40%; left: 30%;
  background: radial-gradient(circle, #00c2ff, transparent 70%);
  animation-duration: 19s; animation-delay: -5s; }

@keyframes blobDrift {
  0%   { transform: translate(0, 0) scale(1); }
  33%  { transform: translate(30px, -20px) scale(1.05); }
  66%  { transform: translate(-20px, 40px) scale(0.95); }
  100% { transform: translate(10px, 20px) scale(1.02); }
}

/* Couche 4 – particules canvas (injectées par nav.js) */
#particles-canvas {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
}



/* =============================================
   NAVBAR
   ============================================= */
nav {
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--nav-height);
  background: rgba(2,11,24,0.88);
  backdrop-filter: blur(24px);
  border-bottom: 1px solid var(--glass-border);
  display: flex; align-items: center;
  justify-content: space-between;
  padding: 0 2rem; z-index: 1000;
  box-shadow: 0 4px 40px rgba(0,194,255,0.1);
}

.nav-logo {
  font-family: 'Orbitron', monospace;
  font-size: 1.2rem; font-weight: 700;
  color: var(--accent); text-decoration: none;
  letter-spacing: 2px;
  text-shadow: 0 0 15px rgba(0,229,255,0.6);
  animation: logoGlow 3s ease-in-out infinite alternate;
}

@keyframes logoGlow {
  from { text-shadow: 0 0 10px rgba(0,229,255,0.4); }
  to   { text-shadow: 0 0 25px rgba(0,229,255,0.9), 0 0 50px rgba(0,194,255,0.4); }
}

.nav-links { display: flex; gap: 0.2rem; list-style: none; }

.nav-links a {
  font-family: 'Exo 2', sans-serif;
  font-size: 0.78rem; font-weight: 500;
  color: var(--text-dim); text-decoration: none;
  padding: 0.4rem 0.8rem; border-radius: 6px;
  letter-spacing: 1px; text-transform: uppercase;
  transition: all 0.3s ease; border: 1px solid transparent;
  position: relative; overflow: hidden;
}

.nav-links a::after {
  content: ''; position: absolute;
  bottom: 0; left: 50%; right: 50%; height: 1px;
  background: var(--accent);
  transition: left 0.3s ease, right 0.3s ease;
}

.nav-links a:hover::after, .nav-links a.active::after {
  left: 10%; right: 10%;
}

.nav-links a:hover, .nav-links a.active {
  color: var(--accent);
  background: rgba(0,229,255,0.08);
  border-color: rgba(0,229,255,0.25);
  text-shadow: 0 0 8px rgba(0,229,255,0.5);
}

/* =============================================
   MAIN / PAGE HEADER
   ============================================= */
main { padding-top: calc(var(--nav-height) + 2rem); min-height: 100vh; }

.page-header {
  text-align: center; padding: 3rem 2rem 2rem; position: relative;
}

.page-header h1 {
  font-family: 'Orbitron', monospace;
  font-size: clamp(1.8rem, 4vw, 3rem); font-weight: 700;
  color: var(--text-main);
  text-shadow: 0 0 30px rgba(0,194,255,0.5);
  margin-bottom: 0.5rem;
  animation: fadeInDown 0.8s ease both;
}

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

.page-header .subtitle {
  font-size: 1rem; color: var(--text-dim); font-weight: 300;
  letter-spacing: 2px; text-transform: uppercase;
  animation: fadeInDown 0.9s ease both;
}

.divider {
  width: 120px; height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  margin: 1rem auto;
  animation: dividerExpand 1s ease both 0.3s;
}

@keyframes dividerExpand {
  from { width: 0; opacity: 0; }
  to   { width: 120px; opacity: 1; }
}

/* =============================================
   GLASS CARDS – avec shimmer sur hover
   ============================================= */
.card {
  background: var(--card-bg);
  border: 1px solid var(--glass-border);
  border-radius: 16px; padding: 1.8rem;
  /* backdrop-filter supprimé — coûteux sur toutes les cards */
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  position: relative; overflow: hidden;
}

/* Ligne lumineuse supérieure */
.card::before {
  content: ''; position: absolute;
  top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--blue-bright), transparent);
  opacity: 0.5;
  transition: opacity 0.3s;
}

/* Effet shimmer diagonal sur hover */
.card::after {
  content: ''; position: absolute;
  top: -50%; left: -75%; width: 50%; height: 200%;
  background: linear-gradient(105deg, transparent 40%, rgba(0,229,255,0.06) 50%, transparent 60%);
  transition: left 0.6s ease;
}

.card:hover::after { left: 125%; }
.card:hover::before { opacity: 1; }

.card:hover {
  border-color: rgba(0,194,255,0.45);
  transform: translateY(-4px);
  box-shadow: 0 12px 50px rgba(0,194,255,0.15), 0 0 0 1px rgba(0,229,255,0.05);
}

.card h2, .card h3 {
  font-family: 'Orbitron', monospace;
  color: var(--blue-bright); margin-bottom: 1rem;
}

/* =============================================
   LIGHTBOX – ZOOM IMAGE AU CLIC
   ============================================= */
#lightbox-overlay {
  position: fixed; inset: 0; z-index: 99998;
  background: rgba(2,11,24,0.92);
  backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity 0.3s ease;
}
#lightbox-overlay.open { opacity: 1; pointer-events: all; }
#lightbox-img {
  max-width: 90vw; max-height: 88vh;
  border-radius: 10px;
  border: 1px solid rgba(0,194,255,0.4);
  box-shadow: 0 30px 80px rgba(0,0,0,0.8), 0 0 40px rgba(0,194,255,0.15);
  transform: scale(0.92);
  transition: transform 0.35s cubic-bezier(0.175,0.885,0.32,1.275);
  cursor: zoom-out; display: block;
}
#lightbox-overlay.open #lightbox-img { transform: scale(1); }
#lightbox-close {
  position: fixed; top: 1.2rem; right: 1.4rem;
  width: 38px; height: 38px; border-radius: 10px;
  background: rgba(0,194,255,0.1); border: 1px solid rgba(0,194,255,0.35);
  color: var(--accent); font-size: 1.1rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s; z-index: 99999;
}
#lightbox-close:hover { background: rgba(0,194,255,0.25); transform: scale(1.1); }
#lightbox-caption {
  position: fixed; bottom: 1.2rem; left: 50%; transform: translateX(-50%);
  font-family: 'Share Tech Mono', monospace; font-size: 0.75rem;
  color: var(--text-dim); background: rgba(2,11,24,0.85);
  padding: 0.4rem 1rem; border-radius: 20px;
  border: 1px solid rgba(0,194,255,0.15);
  z-index: 99999; white-space: nowrap;
}
.zoomable { cursor: zoom-in !important; transition: opacity 0.2s; }
.zoomable:hover { opacity: 0.88; }

/* =============================================
   SECTION TITLE / TAGS / BUTTON / LISTS
   ============================================= */
.section-title {
  font-family: 'Orbitron', monospace;
  font-size: 1.4rem; font-weight: 600;
  color: var(--blue-bright);
  margin-bottom: 1.5rem; padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--glass-border);
  display: flex; align-items: center; gap: 0.8rem;
}

.section-title::before {
  content: ''; width: 4px; height: 1.4rem;
  background: var(--accent); border-radius: 2px;
  box-shadow: 0 0 10px var(--accent), 0 0 20px rgba(0,229,255,0.3);
  animation: barPulse 2s ease-in-out infinite alternate;
}

@keyframes barPulse {
  from { box-shadow: 0 0 8px var(--accent); }
  to   { box-shadow: 0 0 18px var(--accent), 0 0 35px rgba(0,229,255,0.4); }
}

.tag {
  display: inline-block; padding: 0.25rem 0.7rem;
  background: rgba(0,194,255,0.1); border: 1px solid rgba(0,194,255,0.3);
  border-radius: 20px; font-size: 0.75rem; color: var(--blue-bright);
  font-family: 'Share Tech Mono', monospace; margin: 0.2rem;
  transition: all 0.25s ease;
}

.tag:hover {
  background: rgba(0,194,255,0.2); border-color: var(--accent);
  color: var(--accent); box-shadow: 0 0 10px rgba(0,229,255,0.25);
  transform: scale(1.05);
}

.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.7rem 1.5rem;
  background: linear-gradient(135deg, rgba(13,110,253,0.3), rgba(0,194,255,0.2));
  border: 1px solid rgba(0,194,255,0.4);
  border-radius: 8px; color: var(--accent);
  text-decoration: none; font-family: 'Exo 2', sans-serif;
  font-size: 0.85rem; font-weight: 600; letter-spacing: 1px;
  text-transform: uppercase; transition: all 0.3s ease; cursor: pointer;
  position: relative; overflow: hidden;
}

.btn::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(135deg, transparent 30%, rgba(0,229,255,0.12) 50%, transparent 70%);
  transform: translateX(-100%); transition: transform 0.5s ease;
}

.btn:hover::before { transform: translateX(100%); }

.btn:hover {
  background: linear-gradient(135deg, rgba(13,110,253,0.5), rgba(0,194,255,0.35));
  box-shadow: 0 0 25px rgba(0,229,255,0.35), 0 0 50px rgba(0,194,255,0.1);
  transform: translateY(-2px);
}

ul.styled-list { list-style: none; padding: 0; }

ul.styled-list li {
  padding: 0.4rem 0; padding-left: 1.2rem; position: relative;
  color: var(--text-main); font-size: 0.9rem; line-height: 1.6;
  transition: color 0.2s;
}

ul.styled-list li::before {
  content: '▹'; position: absolute; left: 0; color: var(--accent);
  transition: transform 0.2s;
}

ul.styled-list li:hover { color: var(--accent); }
ul.styled-list li:hover::before { transform: translateX(3px); }

.glow { text-shadow: 0 0 20px rgba(0,229,255,0.6), 0 0 40px rgba(0,194,255,0.3); }

/* =============================================
   GRIDS / CONTAINER / FOOTER
   ============================================= */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.5rem; }

.container { max-width: 1100px; margin: 0 auto; padding: 0 2rem 4rem; }

footer {
  text-align: center; padding: 2rem;
  border-top: 1px solid var(--glass-border);
  color: var(--text-dim); font-size: 0.8rem;
  font-family: 'Share Tech Mono', monospace; letter-spacing: 1px;
  margin-top: 3rem; position: relative;
}

footer::before {
  content: ''; position: absolute;
  top: 0; left: 20%; right: 20%; height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0.4;
}

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 900px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .nav-links { gap: 0; }
  .nav-links a { padding: 0.4rem 0.5rem; font-size: 0.7rem; }
}

@media (max-width: 600px) {
  nav { padding: 0.8rem 1rem; flex-wrap: wrap; height: auto; }
  .nav-links { flex-wrap: wrap; justify-content: center; }
  main { padding-top: 5rem; }
}

/* =============================================
   EFFETS DE SCROLL
   ============================================= */

/* Barre de progression en haut de page */
#scroll-progress {
  position: fixed;
  top: var(--nav-height);
  left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), #7c3aed, var(--blue-bright));
  transform: scaleX(0);
  transform-origin: left;
  z-index: 999;
  box-shadow: 0 0 10px rgba(0,229,255,0.6), 0 0 25px rgba(0,194,255,0.3);
  transition: transform 0.05s linear;
}

/* Bouton retour en haut */
#back-top {
  position: fixed;
  bottom: 2rem; right: 2rem;
  width: 44px; height: 44px;
  background: var(--card-bg);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  color: var(--accent);
  font-size: 1.2rem;
  cursor: pointer;
  z-index: 900;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transform: translateY(12px);
  transition: opacity 0.35s ease, transform 0.35s ease, box-shadow 0.3s ease, border-color 0.3s ease;
  backdrop-filter: blur(10px);
}

#back-top.visible {
  opacity: 1; pointer-events: all; transform: translateY(0);
}

#back-top:hover {
  box-shadow: 0 0 20px rgba(0,229,255,0.4);
  border-color: var(--accent);
  background: rgba(0,229,255,0.1);
}

/* Glitch sur le h1 de page au début du scroll */
.page-header h1 { position: relative; }

.page-header h1.glitch-active {
  animation: glitchFlash 0.4s steps(1) forwards;
}

.page-header h1.glitch-active::before,
.page-header h1.glitch-active::after {
  content: attr(data-text);
  position: absolute; inset: 0;
  font-family: inherit; font-size: inherit; font-weight: inherit;
  color: inherit;
}

.page-header h1.glitch-active::before {
  left: 2px;
  color: var(--accent);
  clip-path: polygon(0 20%, 100% 20%, 100% 40%, 0 40%);
  animation: glitchSlice1 0.4s steps(1) forwards;
}

.page-header h1.glitch-active::after {
  left: -2px;
  color: #7c3aed;
  clip-path: polygon(0 60%, 100% 60%, 100% 75%, 0 75%);
  animation: glitchSlice2 0.4s steps(1) forwards;
}

@keyframes glitchFlash {
  0%   { filter: brightness(1); }
  20%  { filter: brightness(1.4) hue-rotate(20deg); }
  40%  { filter: brightness(1); }
  60%  { filter: brightness(1.3) hue-rotate(-15deg); }
  80%  { filter: brightness(1); }
  100% { filter: brightness(1); }
}

@keyframes glitchSlice1 {
  0%   { transform: translateX(0); opacity: 1; }
  25%  { transform: translateX(-5px); opacity: 0.8; }
  50%  { transform: translateX(3px); opacity: 1; }
  75%  { transform: translateX(-2px); opacity: 0.6; }
  100% { transform: translateX(0); opacity: 0; }
}

@keyframes glitchSlice2 {
  0%   { transform: translateX(0); opacity: 1; }
  25%  { transform: translateX(5px); opacity: 0.8; }
  50%  { transform: translateX(-3px); opacity: 1; }
  75%  { transform: translateX(2px); opacity: 0.6; }
  100% { transform: translateX(0); opacity: 0; }
}


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

@keyframes fadeInLeft {
  from { opacity: 0; transform: translateX(-30px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 10px rgba(0,194,255,0.3); }
  50%       { box-shadow: 0 0 30px rgba(0,194,255,0.7), 0 0 60px rgba(0,194,255,0.2); }
}

/* Scroll-reveal : éléments .anim-in déclenchés par JS (IntersectionObserver) */
.anim-in {
  opacity: 0;
  transform: translateY(35px);
  transition: opacity 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              transform 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.anim-in.visible {
  opacity: 1;
  transform: translateY(0);
}
