/* ============================================================
   PORTFOLIO PÉDAGOGIQUE — Alban Chabalier
   Fichier : main.css — Styles globaux & Système de design
   ============================================================ */

/* ── Importation des polices Google Fonts ── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Space+Grotesk:wght@300;400;500;600;700&family=Fira+Code:wght@300;400;500&display=swap');

/* ============================================================
   VARIABLES CSS — Modifier ici pour personnaliser le thème
   ============================================================ */
:root {
  /* --- Palette de couleurs principale --- */
  --color-bg-primary:    #0a0e1a;   /* Fond principal (Bleu nuit profond) */
  --color-bg-secondary:  #0f1629;   /* Fond secondaire (cartes, sections) */
  --color-bg-card:       #131b2e;   /* Fond des cartes */
  --color-bg-glass:      rgba(19, 27, 46, 0.7); /* Fond glassmorphism */

  --color-accent-cyan:   #00d4ff;   /* Accent primaire (Cyan électrique) */
  --color-accent-violet: #7c3aed;   /* Accent secondaire (Violet/Améthyste) */
  --color-accent-pink:   #f0abfc;   /* Accent tertiaire (Rose lavande) */
  --color-accent-green:  #10b981;   /* Accent succès (Émeraude) */
  --color-accent-amber:  #f59e0b;   /* Accent avertissement (Ambre) */

  /* --- Gradients --- */
  --gradient-primary:    linear-gradient(135deg, #00d4ff 0%, #7c3aed 100%);
  --gradient-hero:       linear-gradient(135deg, #0a0e1a 0%, #0f1629 50%, #1a1040 100%);
  --gradient-card-hover: linear-gradient(135deg, rgba(0, 212, 255, 0.08) 0%, rgba(124, 58, 237, 0.08) 100%);
  --gradient-text:       linear-gradient(135deg, #00d4ff, #7c3aed);
  --gradient-develop:    linear-gradient(135deg, #00d4ff, #0070f3);
  --gradient-concevoir:  linear-gradient(135deg, #f0abfc, #7c3aed);
  --gradient-entreprendre: linear-gradient(135deg, #f59e0b, #ef4444);
  --gradient-exprimer:   linear-gradient(135deg, #10b981, #00d4ff);
  --gradient-comprendre: linear-gradient(135deg, #f0abfc, #f59e0b);

  /* --- Couleurs de texte --- */
  --color-text-primary:  #e2e8f0;   /* Texte principal */
  --color-text-secondary:#94a3b8;   /* Texte secondaire */
  --color-text-muted:    #4a5568;   /* Texte atténué */
  --color-text-accent:   #00d4ff;   /* Texte accentué */

  /* --- Bordures --- */
  --color-border:        rgba(148, 163, 184, 0.1);
  --color-border-accent: rgba(0, 212, 255, 0.3);
  --color-border-hover:  rgba(0, 212, 255, 0.6);

  /* --- Ombres --- */
  --shadow-sm:     0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md:     0 8px 24px rgba(0, 0, 0, 0.4);
  --shadow-lg:     0 16px 48px rgba(0, 0, 0, 0.5);
  --shadow-cyan:   0 0 30px rgba(0, 212, 255, 0.2);
  --shadow-violet: 0 0 30px rgba(124, 58, 237, 0.2);
  --shadow-glow:   0 0 60px rgba(0, 212, 255, 0.15);

  /* --- Typographies --- */
  --font-body:    'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: 'Space Grotesk', sans-serif;
  --font-mono:    'Fira Code', 'Courier New', monospace;

  /* --- Tailles de police --- */
  --text-xs:   0.75rem;    /* 12px */
  --text-sm:   0.875rem;   /* 14px */
  --text-base: 1rem;       /* 16px */
  --text-lg:   1.125rem;   /* 18px */
  --text-xl:   1.25rem;    /* 20px */
  --text-2xl:  1.5rem;     /* 24px */
  --text-3xl:  1.875rem;   /* 30px */
  --text-4xl:  2.25rem;    /* 36px */
  --text-5xl:  3rem;       /* 48px */
  --text-6xl:  3.75rem;    /* 60px */

  /* --- Espacements --- */
  --space-1:  0.25rem;
  --space-2:  0.5rem;
  --space-3:  0.75rem;
  --space-4:  1rem;
  --space-5:  1.25rem;
  --space-6:  1.5rem;
  --space-8:  2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;

  /* --- Rayons de bordure --- */
  --radius-sm:  0.375rem;
  --radius-md:  0.75rem;
  --radius-lg:  1rem;
  --radius-xl:  1.5rem;
  --radius-full: 9999px;

  /* --- Transitions --- */
  --transition-fast:   150ms ease;
  --transition-base:   250ms ease;
  --transition-slow:   400ms ease;
  --transition-spring: 400ms cubic-bezier(0.175, 0.885, 0.32, 1.275);

  /* --- Layout --- */
  --container-max: 1200px;
  --nav-height: 70px;
}

/* ============================================================
   RESET & BASE STYLES
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  background-color: var(--color-bg-primary);
  color: var(--color-text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
}

/* Scrollbar personnalisée */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: var(--color-bg-primary);
}
::-webkit-scrollbar-thumb {
  background: linear-gradient(var(--color-accent-violet), var(--color-accent-cyan));
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--color-accent-cyan);
}

/* Sélection de texte */
::selection {
  background: rgba(0, 212, 255, 0.25);
  color: var(--color-text-primary);
}

/* ============================================================
   UTILITAIRES
   ============================================================ */

/* --- Conteneur centré --- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-6);
}

/* --- Texte dégradé --- */
.text-gradient {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* --- Badge label technique (style monospace) --- */
.badge-mono {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.05em;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

/* --- Séparateur section --- */
.section-divider {
  width: 60px;
  height: 3px;
  background: var(--gradient-primary);
  border-radius: var(--radius-full);
  margin: var(--space-4) 0;
}

/* --- Tag --- */
.tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-accent-cyan);
  background: rgba(0, 212, 255, 0.08);
  border: 1px solid rgba(0, 212, 255, 0.2);
  padding: 2px var(--space-3);
  border-radius: var(--radius-full);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ============================================================
   BARRE DE NAVIGATION
   ============================================================ */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  z-index: 1000;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  background: rgba(10, 14, 26, 0.85);
  border-bottom: 1px solid var(--color-border);
  transition: background var(--transition-base), box-shadow var(--transition-base);
}

.navbar.scrolled {
  background: rgba(10, 14, 26, 0.95);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
}

.navbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

/* Logo/Marque */
.navbar-brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  text-decoration: none;
}

.brand-avatar {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: var(--gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  box-shadow: var(--shadow-cyan);
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--color-text-primary);
  line-height: 1.2;
}

.brand-subtitle {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--color-accent-cyan);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Liens de navigation */
.navbar-links {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  list-style: none;
}

.navbar-links a {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-secondary);
  text-decoration: none;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-md);
  transition: color var(--transition-base), background var(--transition-base);
  position: relative;
}

.navbar-links a:hover,
.navbar-links a.active {
  color: var(--color-text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.navbar-links a.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 2px;
  background: var(--color-accent-cyan);
  border-radius: var(--radius-full);
}

.nav-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Bouton menu mobile */
.navbar-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: var(--space-2);
  background: none;
  border: none;
}

.navbar-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-text-primary);
  border-radius: var(--radius-full);
  transition: transform var(--transition-base), opacity var(--transition-base);
}

.navbar-toggle.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.navbar-toggle.open span:nth-child(2) {
  opacity: 0;
}
.navbar-toggle.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  margin-top: var(--space-24);
  padding: var(--space-12) 0 var(--space-8);
  border-top: 1px solid var(--color-border);
  position: relative;
  overflow: hidden;
}

.site-footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 1px;
  background: var(--gradient-primary);
  opacity: 0.4;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-6);
  text-align: center;
}

.footer-logo {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.footer-logo span {
  color: var(--color-accent-cyan);
}

.footer-links {
  display: flex;
  gap: var(--space-8);
  list-style: none;
}

.footer-links a {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  text-decoration: none;
  transition: color var(--transition-base);
}

.footer-links a:hover {
  color: var(--color-accent-cyan);
}

.footer-copy {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  font-family: var(--font-mono);
}

/* ============================================================
   ANIMATIONS GLOBALES
   ============================================================ */

/* Fade In Up */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Fade In */
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Slide In Left */
@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Slide In Right */
@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Pulse lumineux */
@keyframes pulse-glow {
  0%, 100% { opacity: 0.6; }
  50%       { opacity: 1; }
}

/* Flottement */
@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50%       { transform: translateY(-8px); }
}

/* Rotation lente */
@keyframes spin-slow {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* Shimmer (effet de brillance sur les cartes) */
@keyframes shimmer {
  0%   { background-position: -200% center; }
  100% { background-position: 200% center; }
}

/* Entrée au scroll (via JS) */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-left {
  opacity: 0;
  transform: translateX(-30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal-left.visible {
  opacity: 1;
  transform: translateX(0);
}

.reveal-right {
  opacity: 0;
  transform: translateX(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal-right.visible {
  opacity: 1;
  transform: translateX(0);
}

/* Délais pour animation en cascade */
.delay-1 { transition-delay: 0.1s; }
.delay-2 { transition-delay: 0.2s; }
.delay-3 { transition-delay: 0.3s; }
.delay-4 { transition-delay: 0.4s; }
.delay-5 { transition-delay: 0.5s; }

/* ============================================================
   PARTICULES DE FOND
   ============================================================ */
.bg-particles {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.particle {
  position: absolute;
  border-radius: 50%;
  background: var(--gradient-primary);
  opacity: 0;
  animation: particle-float linear infinite;
}

@keyframes particle-float {
  0% {
    opacity: 0;
    transform: translateY(100vh) scale(0);
  }
  10% { opacity: 0.3; }
  90% { opacity: 0.1; }
  100% {
    opacity: 0;
    transform: translateY(-20px) scale(1);
  }
}

/* ============================================================
   RESPONSIVE — Breakpoints
   ============================================================ */

/* Tablette */
@media (max-width: 1024px) {
  :root {
    --text-5xl: 2.5rem;
    --text-6xl: 3rem;
  }
}

/* Mobile large */
@media (max-width: 768px) {
  :root {
    --text-4xl: 1.875rem;
    --text-5xl: 2rem;
    --text-6xl: 2.5rem;
  }

  .container {
    padding: 0 var(--space-4);
  }

  .navbar-links {
    display: none;
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: rgba(10, 14, 26, 0.98);
    backdrop-filter: blur(20px);
    flex-direction: column;
    padding: var(--space-6);
    gap: var(--space-2);
    border-bottom: 1px solid var(--color-border);
  }

  .navbar-links.open {
    display: flex;
  }

  .navbar-links a {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    font-size: var(--text-base);
  }

  .navbar-toggle {
    display: flex;
  }

  .footer-links {
    flex-direction: column;
    align-items: center;
    gap: var(--space-4);
  }
}

/* Mobile petit */
@media (max-width: 480px) {
  :root {
    --text-3xl: 1.5rem;
    --text-4xl: 1.75rem;
  }

  .brand-text {
    display: none;
  }
}
