/* ============================================
   OUZEFI PORTFOLIO V2 - ULTRA PRO DESIGN
   ============================================ */

/* CSS Variables */
:root {
  /* Colors - Brand */
  --brand-50: #f0f9ff;
  --brand-100: #e0f2fe;
  --brand-200: #bae6fd;
  --brand-300: #7dd3fc;
  --brand-400: #38bdf8;
  --brand-500: #0ea5e9;
  --brand-600: #0284c7;
  --brand-700: #0369a1;
  --brand-800: #075985;
  --brand-900: #0c4a6e;
  --brand-950: #082f49;
  
  /* Colors - Background */
  --bg-primary: #030712;
  --bg-secondary: #0f172a;
  --bg-tertiary: #1e293b;
  
  /* Colors - Accents */
  --purple-500: #8b5cf6;
  --purple-600: #7c3aed;
  --emerald-500: #10b981;
  --emerald-600: #059669;
  --orange-500: #f97316;
  
  /* Colors - Text */
  --text-primary: #ffffff;
  --text-secondary: #cbd5e1;
  --text-tertiary: #94a3b8;
  --text-muted: #64748b;
  
  /* Colors - Borders */
  --border-primary: rgba(255, 255, 255, 0.1);
  --border-secondary: rgba(255, 255, 255, 0.05);
  
  /* Spacing */
  --spacing-xs: 0.25rem;
  --spacing-sm: 0.5rem;
  --spacing-md: 1rem;
  --spacing-lg: 1.5rem;
  --spacing-xl: 2rem;
  --spacing-2xl: 3rem;
  --spacing-3xl: 4rem;
  --spacing-4xl: 6rem;
  
  /* Typography */
  --font-display: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'Fira Code', monospace;
  
  /* Sizes */
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 1.875rem;
  --text-4xl: 2.25rem;
  --text-5xl: 3rem;
  --text-6xl: 3.75rem;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  --shadow-glow: 0 0 40px rgba(14, 165, 233, 0.3);
  
  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 300ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 500ms cubic-bezier(0.4, 0, 0.2, 1);
  
  /* Border Radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-2xl: 1.5rem;
  --radius-full: 9999px;
  
  /* Container */
  --container-sm: 640px;
  --container-md: 768px;
  --container-lg: 1024px;
  --container-xl: 1280px;
  --container-2xl: 1536px;
}

/* ============================================
   RESET & BASE
   ============================================ */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--text-secondary);
  background-color: var(--bg-primary);
  overflow-x: hidden;
  position: relative;
}

/* Background Pattern */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: 
    radial-gradient(circle at 20% 30%, rgba(14, 165, 233, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(139, 92, 246, 0.1) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

/* ============================================
   TYPOGRAPHY
   ============================================ */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.025em;
  color: var(--text-primary);
  margin-bottom: var(--spacing-md);
}

h1 { font-size: clamp(2rem, 5vw, var(--text-6xl)); }
h2 { font-size: clamp(1.75rem, 4vw, var(--text-5xl)); }
h3 { font-size: clamp(1.5rem, 3vw, var(--text-4xl)); }
h4 { font-size: var(--text-2xl); }
h5 { font-size: var(--text-xl); }
h6 { font-size: var(--text-lg); }

p {
  margin-bottom: var(--spacing-md);
}

a {
  color: var(--brand-400);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--brand-300);
}

strong {
  font-weight: 600;
  color: var(--text-primary);
}

/* ============================================
   UTILITIES
   ============================================ */

.container {
  width: 100%;
  max-width: var(--container-xl);
  margin: 0 auto;
  padding: 0 var(--spacing-xl);
  position: relative;
  z-index: 1;
}

.section {
  padding: var(--spacing-4xl) 0;
  position: relative;
}

.section-sm {
  padding: var(--spacing-3xl) 0;
}

.section-lg {
  padding: calc(var(--spacing-4xl) * 1.5) 0;
}

/* Text Utilities */
.text-gradient {
  background: linear-gradient(135deg, var(--brand-400), var(--purple-500));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

/* ============================================
   NAVIGATION - ULTRA PRO
   ============================================ */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  backdrop-filter: blur(30px) saturate(180%);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
  background: rgba(3, 7, 18, 0.6);
  border-bottom: 1px solid rgba(14, 165, 233, 0.1);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  transition: all var(--transition-base);
}

.nav::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, 
    transparent,
    rgba(14, 165, 233, 0.3) 20%,
    rgba(139, 92, 246, 0.3) 50%,
    rgba(14, 165, 233, 0.3) 80%,
    transparent
  );
}

.nav.scrolled {
  background: rgba(3, 7, 18, 0.85);
  backdrop-filter: blur(40px) saturate(200%);
  -webkit-backdrop-filter: blur(40px) saturate(200%);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), 0 0 80px rgba(14, 165, 233, 0.1);
  border-bottom: 1px solid rgba(14, 165, 233, 0.2);
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
  max-width: var(--container-xl);
  margin: 0 auto;
  padding: 0 var(--spacing-xl);
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--text-primary);
  text-decoration: none;
  transition: transform var(--transition-fast);
}

.nav-logo:hover {
  transform: translateY(-2px);
}

.nav-logo-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--brand-500);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.nav-logo-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  list-style: none;
}

.nav-link {
  position: relative;
  padding: 0.625rem 1.25rem;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all var(--transition-base);
  border-radius: var(--radius-lg);
  letter-spacing: 0.02em;
}

.nav-link::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius-lg);
  padding: 1px;
  background: linear-gradient(135deg, transparent, rgba(14, 165, 233, 0.3), transparent);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity var(--transition-base);
}

.nav-link:hover {
  color: var(--text-primary);
  background: rgba(14, 165, 233, 0.1);
  box-shadow: 0 0 20px rgba(14, 165, 233, 0.2);
}

.nav-link:hover::before {
  opacity: 1;
}

.nav-link.active {
  color: var(--brand-400) !important;
  background: rgba(14, 165, 233, 0.15) !important;
  box-shadow: inset 0 0 20px rgba(14, 165, 233, 0.2), 0 0 20px rgba(14, 165, 233, 0.3) !important;
  text-shadow: 0 0 10px rgba(14, 165, 233, 0.5) !important;
  font-weight: 700 !important;
}

.nav-link.active::before {
  opacity: 1 !important;
}

.nav-link.active::after {
  content: '' !important;
  position: absolute !important;
  bottom: 0 !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  width: 30px !important;
  height: 2px !important;
  background: linear-gradient(90deg, transparent, var(--brand-400), transparent) !important;
  border-radius: var(--radius-full) !important;
  box-shadow: 0 0 10px var(--brand-400) !important;
}

.nav-cta {
  margin-left: var(--spacing-md);
}

/* Mobile Menu Toggle */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: var(--spacing-sm);
}

.nav-toggle span {
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  border-radius: var(--radius-full);
  transition: all var(--transition-fast);
}

/* ============================================
   BUTTONS
   ============================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-sm);
  padding: 0.75rem 1.5rem;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  border: none;
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition-base);
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--brand-500), var(--brand-600));
  color: var(--text-primary);
  box-shadow: 0 0 20px rgba(14, 165, 233, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 30px rgba(14, 165, 233, 0.5);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  border: 1px solid var(--border-primary);
  backdrop-filter: blur(10px);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--brand-400);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}

.btn-ghost:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: var(--text-xs);
}

.btn-lg {
  padding: 1rem 2rem;
  font-size: var(--text-base);
}

/* ============================================
   CARDS - GLASSMORPHISM
   ============================================ */

.card {
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-2xl);
  padding: var(--spacing-xl);
  transition: all var(--transition-base);
}

.card:hover {
  background: rgba(15, 23, 42, 0.7);
  border-color: rgba(14, 165, 233, 0.3);
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.card-header {
  margin-bottom: var(--spacing-lg);
}

.card-title {
  font-size: var(--text-2xl);
  margin-bottom: var(--spacing-sm);
}

.card-description {
  color: var(--text-tertiary);
  font-size: var(--text-sm);
}

.card-content {
  margin-bottom: var(--spacing-lg);
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: var(--spacing-lg);
  border-top: 1px solid var(--border-secondary);
}

/* ============================================
   GRID SYSTEM
   ============================================ */

.grid {
  display: grid;
  gap: var(--spacing-xl);
}

.grid-cols-1 { grid-template-columns: repeat(1, 1fr); }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid-cols-4 { grid-template-columns: repeat(4, 1fr); }

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

/* Tablet */
@media (max-width: 1024px) {
  .container {
    padding: 0 var(--spacing-lg);
  }
  
  .nav-container {
    padding: 0 var(--spacing-lg);
  }
  
  .grid-cols-4 {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .grid-cols-3 {
    grid-template-columns: repeat(2, 1fr);
  }

  /* grid-cols-2 passe en 1 colonne sur tablette pour éviter cards trop compressées */
  .grid-cols-2 {
    grid-template-columns: 1fr;
  }
}

/* Mobile */
@media (max-width: 768px) {
  :root {
    --spacing-4xl: 3rem;
    --spacing-3xl: 2rem;
  }
  
  .container {
    padding: 0 var(--spacing-md);
  }
  
  .nav-container {
    padding: 0 var(--spacing-md);
    height: 64px;
  }
  
  .nav-menu {
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    flex-direction: column;
    background: rgba(3, 7, 18, 0.98);
    backdrop-filter: blur(20px);
    padding: var(--spacing-xl);
    gap: var(--spacing-md);
    border-top: 1px solid var(--border-primary);
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-base);
  }
  
  .nav-menu.active {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }
  
  .nav-toggle {
    display: flex;
  }
  
  .nav-cta {
    margin-left: 0;
    width: 100%;
  }
  
  .nav-cta .btn {
    width: 100%;
  }
  
  .grid-cols-2,
  .grid-cols-3,
  .grid-cols-4 {
    grid-template-columns: 1fr;
  }
  
  .section {
    padding: var(--spacing-3xl) 0;
  }
}

/* ============================================
   ANIMATIONS
   ============================================ */

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

.animate-fade-in-up {
  animation: fadeInUp 0.8s ease-out forwards;
}

.animate-fade-in {
  animation: fadeIn 0.6s ease-out forwards;
}

.animate-slide-in-right {
  animation: slideInRight 0.8s ease-out forwards;
}

/* ============================================
   SCROLLBAR
   ============================================ */

::-webkit-scrollbar {
  width: 12px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: var(--brand-600);
  border-radius: var(--radius-full);
  border: 3px solid var(--bg-primary);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--brand-500);
}

/* ============================================
   SELECTION
   ============================================ */

::selection {
  background: var(--brand-500);
  color: var(--text-primary);
}

/* ============================================
   TEXT VISIBILITY + GLOW EFFECTS
   ============================================ */

/* Titres plus lumineux */
h1, h2, h3, h4 {
  color: #f8fafc;
  text-shadow: 0 0 40px rgba(248, 250, 252, 0.05);
}

/* Texte body plus clair que slate-400 */
p, li, span, div {
  color: #cbd5e1;
}

/* Glow sur les headings au hover des cards */
.card:hover h3,
.card:hover h2 {
  text-shadow: 0 0 20px rgba(14, 165, 233, 0.3);
}

/* Hero text glow */
.stitch-text-gradient {
  text-shadow: 0 0 60px rgba(14, 165, 233, 0.2);
}

/* Links glow */
a:hover {
  text-shadow: 0 0 10px rgba(14, 165, 233, 0.2);
}

/* ============================================
   ACCESSIBILITY - Focus states
   ============================================ */

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
    outline: 2px solid var(--brand-400);
    outline-offset: 2px;
}

.btn:focus-visible {
    outline: 2px solid var(--brand-400);
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.15);
}

.card:focus-visible,
.card:focus-within {
    outline: 2px solid var(--brand-400);
    outline-offset: 2px;
}

/* Skip to content link */
.skip-link {
    position: absolute;
    top: -100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.75rem 1.5rem;
    background: var(--brand-500);
    color: white;
    border-radius: var(--radius-lg);
    z-index: 10000;
    font-weight: 600;
}
.skip-link:focus {
    top: 1rem;
}
