:root {
  --ease-organic: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-elastic: cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* Optimisation des performances pour éviter les saccades */
.glass-card,
.glass-card-notilt,
.bento-item,
#logo,
.cursor-ring {
  will-change: transform, opacity;
  backface-visibility: hidden;
}

/* Styles globaux */
body {
  background-color: #0f172a;
  color: #f8fafc;
  overflow-x: hidden;
  margin: 0;
  font-family: 'Outfit', sans-serif;
  cursor: none;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

/* Canvas Three.js */
#canvas-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow-x: hidden;
  z-index: -1;
}

/* Glassmorphism (Le style des cartes) */
.glass-card,
.glass-card-notilt {
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  position: relative;
  overflow: hidden;
  transition: transform 0.8s var(--ease-organic),
    box-shadow 0.8s var(--ease-organic),
    border-color 0.4s ease;
}

.glass-card:hover,
.glass-card-notilt:hover {
  box-shadow: 0 12px 8px 0 rgba(0, 0, 0, 0.37);
  transform: translateY(-5px) scale(1.01);
}

.glass-card::before,
.glass-card-notilt::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  /* Derrière le contenu texte */
  opacity: 0.07;
  /* Un peu plus fort sur les cartes */
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}

.fix-bg {
  background: rgba(11, 17, 32, 0.9) !important;

}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #0f172a;
}

::-webkit-scrollbar-thumb {
  background: #2e9bb0;
  border-radius: 4px;
}

/* --- Styles du Loader --- */
#loading-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #0f172a;
  /* Fond sombre */
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: opacity 1.2s var(--ease-organic), visibility 1.2s;
  opacity: 1;
  visibility: visible;
  /* 
     Couche 1 : Grille horizontale (Teal très transparent)
     Couche 2 : Grille verticale (Teal très transparent)
     Couche 3 : Lumière centrale (Glow vert/teal) pour focus sur le logo
  */
  background-image:
    linear-gradient(rgba(46, 155, 176, 0.57) 1px, transparent 1px),
    linear-gradient(90deg, rgba(46, 155, 176, 0.57) 1px, transparent 1px),
    radial-gradient(circle at center, rgba(12, 211, 155, 0.30) 0%, rgba(15, 23, 42, 1) 80%);

  /* Taille de la grille (40px par carreau) */
  background-size: 40px 40px, 40px 40px, 100% 100%;

  /* Animation du fond pour un effet "flux de données" lent */
  animation: backgroundScroll 10s linear infinite;
}

/* Animation pour faire bouger doucement la grille */
@keyframes backgroundScroll {
  0% {
    background-position: 0 0, 0 0, center center;
  }

  100% {
    background-position: 40px 40px, 40px 40px, center center;
  }
}

/* Classe pour cacher l'écran avec un fondu */
#loading-screen.fade-out {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  /* Permet de cliquer au travers une fois caché */
}

#logo-container {
  position: relative;
  z-index: 10;
  width: 80%;
  max-width: 500px;
  text-align: center;
  backdrop-filter: blur(1px);
}

/* Animation SVG du Loader */
.w {
  fill: transparent;
  stroke: #ebebeb;
  stroke-width: 1;
}

.k {
  fill: transparent;
  stroke: #0cd39b;
  stroke-width: 1;
}

.j {
  fill: transparent;
  stroke: #2e9bb0;
  stroke-width: 1;
}

.i {
  fill: transparent;
  stroke: #5062c4;
  stroke-width: 1;
}

/* Classes pour l'animation de remplissage */
.filled .w {
  fill: #ebebeb;
  stroke: none;
  transition: fill 0.5s;
}

.filled .k {
  fill: #0cd39b;
  stroke: none;
  transition: fill 0.5s;
}

.filled .j {
  fill: #2e9bb0;
  stroke: none;
  transition: fill 0.5s;
}

.filled .i {
  fill: #5062c4;
  stroke: none;
  transition: fill 0.5s;
}

/* Navigation Swiper Custom */
.swiper-button-prev-custom,
.swiper-button-next-custom {
  color: white;
}



/* Le contenu principal doit avoir une transition aussi */
#main-content {
  transition: opacity 1s ease-in;
}


.logo-path {
  fill-opacity: 0;
  /* Transparent au début */
  stroke-dasharray: 1000;
  /* Valeur arbitraire grande pour cacher le trait */
  stroke-dashoffset: 1000;
  stroke-width: 1.5px;
  /* Trait un peu plus épais */
}


path.w {
  fill: #ebebeb;
  stroke: #ebebeb;
}

path.k {
  fill: #0cd39b;
  stroke: #0cd39b;
}

path.j {
  fill: #2e9bb0;
  stroke: #2e9bb0;
}

path.i {
  fill: #5062c4;
  stroke: #5062c4;
}

#loading-text {
  opacity: 0;
  transform: translateY(20px);
}

/* --- BENTO ANIMATION STYLES --- */

/* État initial des éléments animés */
.bento-item {
  opacity: 0;
  transform: scale(0.9) translateY(30px);
  /* Plus petit et décalé vers le bas */
  filter: blur(10px);
  /* Effet de flou moderne */
  will-change: transform, opacity, filter;
}

/* Le conteneur principal est visible, mais ses enfants sont cachés au début */
#main-content {
  opacity: 1 !important;
  /* On force la visibilité du conteneur */
}

/* Pour éviter le flash de contenu non stylisé (FOUC) */
body:not(.loaded) .bento-item {
  visibility: hidden;
}

/* =========================================
   CUSTOM CURSOR ANIMATION STYLES
   ========================================= */

/* 1. Le Point Central (rapide) */
.cursor-dot {
  position: fixed;
  top: 0;
  left: 0;
  width: 14px;
  height: 14px;
  background-color: #0cd39b;
  border-radius: 50%;
  pointer-events: none;
  /* Important pour pouvoir cliquer au travers */
  z-index: 99999;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 10px rgba(12, 211, 155, 0.5);
}

/* 2. Le Cercle (fluide) */
.cursor-ring {
  position: fixed;
  top: 0;
  left: 0;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  pointer-events: none;
  z-index: 99998;
  transform: translate(-50%, -50%);
  transition: width 0.3s, height 0.3s, background-color 0.3s, border-color 0.3s;
}

/* 3. État "Hover" (quand on survole un lien/bouton) */
body.hovering .cursor-ring {
  width: 70px;
  height: 70px;
  background-color: rgba(46, 155, 176, 0.2);
  border-color: #2e9bb0;
  backdrop-filter: blur(2px);
  animation: hover-breath 1.5s infinite alternate;

}

.cursor-dot,
.cursor-ring {
  transition: width 0.3s, height 0.3s, background-color 0.3s, border-color 0.3s, opacity 0.3s ease;
  opacity: 1;
}

body.mouse-out .cursor-dot,
body.mouse-out .cursor-ring {
  opacity: 0;
}

/* Désactiver le curseur custom sur mobile (tactile) */
@media (hover: none) and (pointer: coarse) {

  .cursor-dot,
  .cursor-ring {
    display: none;
  }

  body,
  a,
  button,
  input {
    cursor: auto !important;
  }
}

/* --- EFFET PULSATION (RADAR) SUR LE POINT CENTRAL --- */
.cursor-dot::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background-color: transparent;
  border: 1px solid #0cd39b;
  animation: radar-pulse 2s infinite cubic-bezier(0.215, 0.61, 0.355, 1);
}



@keyframes radar-pulse {
  0% {
    width: 100%;
    height: 100%;
    opacity: 0.8;
    border-width: 2px;
  }

  100% {
    width: 400%;
    /* L'onde s'agrandit à 4x la taille du point */
    height: 400%;
    opacity: 0;
    border-width: 0px;
  }

}

/* --- EFFET DE CLIC SUR LE CERCLE --- */
/* Quand on clique, le cercle se contracte légèrement */
.cursor-ring.clicking {
  width: 25px !important;
  /* Plus petit */
  height: 25px !important;
  background-color: rgba(12, 211, 155, 0.3) !important;
  /* Flash vert */
  border-color: #0cd39b !important;
  transition: width 0.1s, height 0.1s, background-color 0.1s;
}