html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, sans-serif;
  background: rgb(3 7 18);
  color: rgb(243 244 246);
}

#tsparticles {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
}

#tsparticles canvas {
  background: linear-gradient(
    135deg,
    rgba(31, 41, 55, 0.9),
    rgba(17, 24, 39, 0.95)
  ) !important;
}

#hero {
  position: relative;
}

#hero::before {
  content: "";
  position: fixed;
  inset: 0;
  background: radial-gradient(
    ellipse at center,
    rgba(99, 102, 241, 0.1),
    transparent 70%
  );
  pointer-events: none;
  z-index: -1;
}

.nav-link {
  position: relative;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #d1d5db;
  transition: color 0.3s ease;
}

.nav-link::before {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, #6366f1, #818cf8);
  transform: translateX(-50%);
  transition: width 0.3s ease;
}

.nav-link:hover {
  color: #6366f1;
}

.nav-link:hover::before {
  width: 100%;
}

.btn-primary,
.btn-secondary {
  position: relative;
  display: inline-block;
  overflow: hidden;
  font-weight: 500;
  letter-spacing: 0.5px;
  border-radius: 0.5rem;
  transition: all 0.3s ease;
}

.btn-primary {
  background: linear-gradient(135deg, #6366f1, #818cf8);
  color: white;
  padding: 0.75rem 1.5rem;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
  z-index: 0;
}

.btn-primary::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #818cf8, #a5b4fc);
  transform: translateX(-100%);
  transition: transform 0.3s ease;
  z-index: -1;
}

.btn-primary:hover::before {
  transform: translateX(0);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

.btn-secondary {
  padding: 0.65rem 1.5rem;
  color: #e5e7eb;
  border: 2px solid rgba(99, 102, 241, 0.5);
  background: transparent;
}

.btn-secondary::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    rgba(99, 102, 241, 0.25),
    transparent
  );
  transform: translateX(-100%);
  transition: transform 0.4s ease;
}

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

.btn-secondary:hover {
  color: #6366f1;
  border-color: #6366f1;
  transform: translateY(-2px);
  box-shadow: 0 0 20px rgba(99, 102, 241, 0.2);
}

.skill-card {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(99, 102, 241, 0.2);
  background: rgba(99, 102, 241, 0.05);
  padding: 1rem;
  border-radius: 0.5rem;
  transition: all 0.3s ease;
}

.skill-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(99, 102, 241, 0.2),
    transparent
  );
  transform: translateX(-100%);
  transition: transform 0.5s ease;
}

.skill-card:hover::before {
  transform: translateX(100%);
}

.skill-card:hover {
  transform: translateY(-4px);
  border-color: #6366f1;
  background: rgba(99, 102, 241, 0.1);
  box-shadow: 0 10px 30px rgba(99, 102, 241, 0.2);
}

.project-card {
  position: relative;
  overflow: hidden;
  padding: 1.5rem;
  border-radius: 0.75rem;
  border: 1px solid rgba(99, 102, 241, 0.2);
  background: rgba(99, 102, 241, 0.02);
  transition: all 0.3s ease;
}

.project-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, transparent, #6366f1, transparent);
  transition: transform 0.5s ease;
}

.project-card:hover::before {
  transform: translateX(200%);
}

.project-card:hover {
  transform: translateY(-6px);
  border-color: #6366f1;
  background: rgba(99, 102, 241, 0.05);
  box-shadow: 0 15px 40px rgba(99, 102, 241, 0.15);
}

.project-link {
  position: relative;
  font-weight: 500;
  color: #6366f1;
}

.project-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, #6366f1, #818cf8);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.3s ease;
}

.project-link:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

.email-link {
  position: relative;
  font-size: 1.125rem;
  font-weight: 600;
  color: #818cf8;
}

.email-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, #6366f1, #818cf8);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.3s ease;
}

.email-link:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

/* Tooltip custom – style app dark moderne */
.tippy-box[data-theme~='custom-dark'] {
  background-color: rgba(17, 24, 39, 0.95); /* gray-900 */
  color: #e5e7eb; /* gray-200 */
  border-radius: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(8px);
  box-shadow:
    0 10px 25px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.03);
  font-size: 0.75rem;
  padding: 0.5rem 0.75rem;
}

/* Flèche */
.tippy-box[data-theme~='custom-dark'] > .tippy-arrow::before {
  color: rgba(17, 24, 39, 0.95);
}

/* Animation plus douce */
.tippy-box[data-theme~='custom-dark'][data-state='visible'] {
  animation: tooltipFadeIn 0.15s ease-out;
}

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