:root {
  /* Palette de couleurs professionnelle */
  --bg-primary: #0f1419;
  --bg-secondary: #1a1f2e;
  --bg-card: #1e2533;
  --bg-elevated: #252d3d;

  /* Accents modernes */
  --accent-primary: #3b82f6;
  --accent-secondary: #8b5cf6;
  --accent-success: #10b981;
  --accent-warning: #f59e0b;
  --accent-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  
  /* Texte */
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-tertiary: #64748b;

  /* Bordures */
  --border-subtle: rgba(148, 163, 184, 0.1);
  --border-medium: rgba(148, 163, 184, 0.2);
  
  /* Ombres */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.4), 0 10px 10px -5px rgba(0, 0, 0, 0.2);
  
  /* Fonts */
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
  --font-mono: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Code', 'Consolas', monospace;
  
  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);
}

* { 
  margin: 0; 
  padding: 0; 
  box-sizing: border-box; 
}

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-sans);
  overflow-x: hidden;
  min-height: 100vh;
  line-height: 1.7;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ===== Background animé subtil ===== */
#matrix-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  opacity: 0.03;
  pointer-events: none;
}

/* ===== Navigation professionnelle ===== */
nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 3rem;
  background: rgba(15, 20, 25, 0.8);
  backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: 1000;
  transition: all var(--transition-base);
}

nav.scrolled {
  padding: 1rem 3rem;
  background: rgba(15, 20, 25, 0.95);
  box-shadow: var(--shadow-lg);
}

.logo {
  font-size: 1.25rem;
  font-weight: 700;
  font-family: var(--font-mono);
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.5px;
}

.nav-links {
  display: flex;
  gap: 2rem;
  align-items: center;
}

.nav-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  transition: all var(--transition-base);
  position: relative;
  padding: 0.5rem 0;
  letter-spacing: -0.2px;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent-gradient);
  transition: width var(--transition-base);
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text-primary);
}

.nav-links a.active::after,
.nav-links a:hover::after {
  width: 100%;
}

/* ===== Container ===== */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 3rem 2rem;
  min-height: 80vh;
}

/* ===== Typographie professionnelle ===== */
h1 {
  color: var(--text-primary);
  margin-bottom: 1.5rem;
  font-size: 3rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -1.5px;
}

h2 {
  color: var(--text-primary);
  margin-bottom: 2rem;
  margin-top: 4rem;
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -1px;
  position: relative;
  display: inline-block;
}

h2::after {
  content: '';
  position: absolute;
  bottom: -0.5rem;
  left: 0;
  width: 60px;
  height: 4px;
  background: var(--accent-gradient);
  border-radius: 2px;
}

/* Titre dans la section compétences */
section h2 {
  color: #f8fafc !important;
}

h3 {
  color: #f8fafc !important;
  margin-bottom: 1rem;
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.5px;
}

/* Titres spécifiques dans les cards */
.card h3 {
  color: #f8fafc !important;
}

p {
  color: #94a3b8 !important;
  margin-bottom: 1rem;
  line-height: 1.8;
}

/* Paragraphes dans les cards */
.card p {
  color: #94a3b8 !important;
  line-height: 1.7;
  margin-bottom: 1.5rem;
}

/* ===== Hero Section moderne ===== */
.hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 75vh;
  gap: 4rem;
  padding: 2rem 0;
}

.hero-text {
  flex: 1;
  min-width: 300px;
}

.hero-text h1 {
  font-size: 3.5rem;
  margin-bottom: 0.5rem;
  background: linear-gradient(135deg, var(--text-primary) 0%, var(--text-secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-text .glitch {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-size: 3.5rem;
  font-weight: 700;
  animation: gradient-shift 3s ease infinite;
}

@keyframes gradient-shift {
  0%, 100% { 
    background-position: 0% 50%; 
    filter: hue-rotate(0deg);
  }
  50% { 
    background-position: 100% 50%; 
    filter: hue-rotate(10deg);
  }
}

.hero-text p {
  font-size: 1.15rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin-bottom: 2rem;
  line-height: 1.8;
}

/* ===== Terminal moderne ===== */
.terminal-window {
  width: 550px;
  height: 350px;
  background: var(--bg-secondary);
  border-radius: 12px;
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--border-subtle);
  overflow: hidden;
  font-family: var(--font-mono);
  transition: transform var(--transition-base);
}

.terminal-window:hover {
  transform: translateY(-5px);
  box-shadow: 0 25px 35px -5px rgba(0, 0, 0, 0.5), 0 15px 15px -5px rgba(0, 0, 0, 0.3);
}

.terminal-header {
  background: var(--bg-elevated);
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-bottom: 1px solid var(--border-subtle);
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  transition: all var(--transition-fast);
}

.dot.red { background: #ff5f57; }
.dot.yellow { background: #febc2e; }
.dot.green { background: #28c840; }

.terminal-window:hover .dot {
  box-shadow: 0 0 8px currentColor;
}

.terminal-body {
  padding: 1.5rem;
  color: #10b981;
  font-size: 0.9rem;
  line-height: 1.6;
  height: calc(100% - 50px);
  overflow-y: auto;
}

.cursor {
  display: inline-block;
  width: 8px;
  height: 16px;
  background-color: #10b981;
  animation: blink 1s infinite;
  vertical-align: text-bottom;
  margin-left: 2px;
}

@keyframes blink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

/* ===== Grid Container ===== */
.grid-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

/* ===== Cards professionnelles ===== */
.card {
  background: var(--bg-card);
  padding: 2rem;
  border-radius: 16px;
  border: 1px solid var(--border-subtle);
  transition: all var(--transition-slow);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--accent-gradient);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--transition-slow);
}

.card:hover::before {
  transform: scaleX(1);
}

.card:hover {
  transform: translateY(-8px);
  border-color: var(--border-medium);
  box-shadow: var(--shadow-xl);
  background: var(--bg-elevated);
}

.card-hover {
  cursor: pointer;
}

.card-icon {
  font-size: 2.5rem;
  color: #60a5fa !important;
  margin-bottom: 1.5rem;
  display: inline-block;
  transition: all var(--transition-base);
}

.card:hover .card-icon {
  transform: scale(1.1);
  color: #3b82f6 !important;
}

.card h3 {
  margin-bottom: 1rem;
  font-size: 1.35rem;
}

.card p {
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 1.5rem;
}

.card ul {
  margin: 1rem 0 1rem 1.5rem;
  font-size: 0.95rem;
  color: var(--text-secondary);
  list-style: none;
}

.card li {
  margin-bottom: 0.75rem;
  position: relative;
  padding-left: 1.5rem;
}

.card li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: var(--accent-primary);
  font-weight: 600;
}

/* ===== Badges modernes ===== */
.badge {
  display: inline-block;
  padding: 0.4rem 0.9rem;
  margin: 0.25rem 0.25rem 0 0;
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.4);
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  transition: all var(--transition-base);
  letter-spacing: 0.3px;
}

.badge:hover {
  background: rgba(59, 130, 246, 0.25);
  transform: translateY(-2px);
}

.badge-blue {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border-color: rgba(59, 130, 246, 0.4);
}

.badge-green {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.4);
}

.badge-orange {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.4);
}

/* ===== Project Badges ===== */
.project-badge {
  position: absolute;
  top: 1rem;
  right: 1rem;
  padding: 0.4rem 0.9rem;
  background: rgba(59, 130, 246, 0.15);
  color: var(--accent-primary);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.project-badge.dev {
  background: rgba(139, 92, 246, 0.15);
  color: var(--accent-secondary);
  border-color: rgba(139, 92, 246, 0.3);
}

.project-badge.ops {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-success);
  border-color: rgba(16, 185, 129, 0.3);
}

.status-badge {
  display: inline-block;
  padding: 0.6rem 1rem;
  margin-bottom: 1rem;
  background: rgba(245, 158, 11, 0.15);
  color: var(--accent-warning);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.3px;
}

/* ===== Buttons modernes ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.875rem 1.5rem;
  background: transparent;
  color: var(--accent-primary);
  border: 2px solid var(--accent-primary);
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all var(--transition-base);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 100%;
  background: var(--accent-primary);
  transition: width var(--transition-base);
  z-index: -1;
}

.btn:hover::before {
  width: 100%;
}

.btn:hover {
  color: var(--bg-primary);
  border-color: var(--accent-primary);
  box-shadow: 0 0 25px rgba(59, 130, 246, 0.4);
  transform: translateY(-2px);
}

.btn-secondary {
  border-color: var(--accent-secondary);
  color: var(--accent-secondary);
}

.btn-secondary::before {
  background: var(--accent-secondary);
}

.btn-secondary:hover {
  border-color: var(--accent-secondary);
  box-shadow: 0 0 25px rgba(139, 92, 246, 0.4);
}

.btn-outline {
  border-color: var(--border-medium);
  color: var(--text-secondary);
}

.btn-outline::before {
  background: var(--bg-elevated);
}

.btn-outline:hover {
  color: var(--text-primary);
  border-color: var(--border-medium);
  box-shadow: var(--shadow-lg);
}

.btn-link {
  color: var(--accent-primary);
  text-decoration: none;
  font-weight: 600;
  transition: all var(--transition-base);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1rem;
  font-size: 0.95rem;
}

.btn-link:hover {
  color: var(--accent-secondary);
  gap: 0.75rem;
}

/* ===== Competence Details ===== */
.competence-detail {
  background: var(--bg-card);
  padding: 2.5rem;
  border-radius: 16px;
  border-left: 4px solid var(--accent-primary);
  margin-bottom: 2.5rem;
  box-shadow: var(--shadow-md);
}

.competence-detail h3 {
  color: var(--accent-secondary);
  margin-bottom: 1.5rem;
}

.competence-list {
  list-style: none;
  margin: 1.5rem 0;
}

.competence-list li {
  padding: 0.875rem 0;
  padding-left: 2rem;
  position: relative;
  color: var(--text-secondary);
  transition: all var(--transition-base);
}

.competence-list li::before {
  content: '▸';
  position: absolute;
  left: 0;
  color: var(--accent-primary);
  font-weight: bold;
  font-size: 1.1rem;
}

.competence-list li:hover {
  color: var(--text-primary);
  padding-left: 2.5rem;
}

/* ===== Contact Form ===== */
.contact-wrapper {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  margin-top: 2.5rem;
}

.contact-info p {
  margin: 0.75rem 0;
  color: var(--text-secondary);
}

.contact-info a {
  color: var(--accent-primary);
  text-decoration: none;
  transition: color var(--transition-base);
}

.contact-info a:hover {
  color: var(--accent-secondary);
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  background: var(--bg-secondary);
  border: 2px solid var(--border-subtle);
  border-radius: 8px;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  transition: all var(--transition-base);
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
  background: var(--bg-elevated);
}

.contact-form label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.3px;
}

.contact-form textarea {
  min-height: 150px;
  resize: vertical;
}

/* ===== Footer professionnel ===== */
footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-subtle);
  padding: 2.5rem 3rem;
  text-align: center;
  color: var(--text-secondary);
  margin-top: 5rem;
}

footer p {
  margin: 0;
  font-size: 0.9rem;
}

footer a {
  color: var(--accent-primary);
  text-decoration: none;
  margin-left: 1rem;
  transition: color var(--transition-base);
}

footer a:hover {
  color: var(--accent-secondary);
}

/* ===== Section CTA ===== */
section[style*="text-align: center"] {
  background: var(--bg-card) !important;
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-lg);
}

/* ===== Scrollbar personnalisée ===== */
::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: var(--bg-elevated);
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--border-medium);
}

/* ===== Responsive Design ===== */
@media (max-width: 968px) {
  nav {
    padding: 1.25rem 1.5rem;
  }

  .container {
    padding: 2rem 1.5rem;
  }

  .hero {
    flex-direction: column;
    text-align: center;
    gap: 3rem;
  }

  .hero-text h1,
  .hero-text .glitch {
    font-size: 2.5rem;
  }

  .terminal-window {
    width: 100%;
    max-width: 500px;
  }

  .contact-wrapper {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .grid-container {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 2.25rem;
  }

  h2 {
    font-size: 1.75rem;
  }
}

@media (max-width: 640px) {
  nav {
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
  }

  .nav-links {
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
  }

  .hero-text h1,
  .hero-text .glitch {
    font-size: 2rem;
  }

  .hero-text p {
    font-size: 1rem;
  }

  .container {
    padding: 1.5rem 1rem;
  }

  .card {
    padding: 1.5rem;
  }

  h1 {
    font-size: 1.875rem;
  }

  h2 {
    font-size: 1.5rem;
  }

  .btn {
    padding: 0.75rem 1.25rem;
    font-size: 0.9rem;
  }
}

/* ===== Animations subtiles ===== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.card,
.competence-detail {
  animation: fadeInUp 0.6s ease-out;
}

/* ===== Selection text ===== */
::selection {
  background: rgba(59, 130, 246, 0.3);
  color: var(--text-primary);
}

::-moz-selection {
  background: rgba(59, 130, 246, 0.3);
  color: var(--text-primary);
}
