/* ================================================================
   SAHIM DEVOPS — Landing Page
   Design : Dark Mode Premium / Terminal / Hacker Élégant
   Accents : Violet #7c3aed → #a855f7 | Vert #22c55e
   ================================================================ */

/* ================================================================
   1. CSS VARIABLES & RESET
   ================================================================ */
:root {
  /* Palette */
  --bg:          #080b10;
  --bg-card:     #0d1117;
  --bg-card-alt: #111827;
  --border:      rgba(139, 92, 246, 0.18);
  --border-hover:rgba(139, 92, 246, 0.5);

  --purple:      #8b5cf6;
  --purple-light:#a78bfa;
  --purple-glow: rgba(139, 92, 246, 0.25);
  --green:       #22c55e;
  --green-glow:  rgba(34, 197, 94, 0.2);
  --red:         #ef4444;
  --yellow:      #eab308;

  --text-primary:   #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted:     #475569;

  /* Typographie */
  --font-display: 'Syne', sans-serif;
  --font-body:    'DM Sans', sans-serif;
  --font-mono:    'JetBrains Mono', monospace;

  /* Espacements */
  --section-pad: clamp(5rem, 10vw, 9rem);
  --container:   1200px;
  --radius:      12px;

  /* Transitions */
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html { scroll-behavior: smooth; font-size: 16px; }

body {
  background-color: var(--bg);
  color: var(--text-primary);
  font-family: var(--font-body);
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
ul { list-style: none; }
img, svg { display: block; }

/* ================================================================
   2. CANVAS DE FOND (grille animée)
   ================================================================ */
#grid-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.35;
}

/* ================================================================
   3. LAYOUT UTILITAIRES
   ================================================================ */
.container {
  width: min(var(--container), 100% - 2.5rem);
  margin-inline: auto;
  position: relative;
  z-index: 1;
}

.section-label {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--purple-light);
  letter-spacing: 0.06em;
  margin-bottom: 0.75rem;
  opacity: 0.85;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3.5vw, 2.6rem);
  font-weight: 800;
  line-height: 1.2;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

/* Couleurs utilitaires */
.highlight-green  { color: var(--green); }
.highlight-purple { color: var(--purple-light); }
.green            { color: var(--green); }

/* ================================================================
   4. NAVIGATION
   ================================================================ */
.nav-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  border-bottom: 1px solid transparent;
  transition: background 0.4s var(--ease), border-color 0.4s var(--ease), backdrop-filter 0.4s;
}

/* Ajouté via JS au scroll */
.nav-wrapper.scrolled {
  background: rgba(8, 11, 16, 0.85);
  border-color: var(--border);
  backdrop-filter: blur(16px);
}

.nav {
  display: flex;
  align-items: center;
  gap: 2rem;
  padding-block: 1.1rem;
}

/* Logo */
.nav-logo {
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 0.15em;
  transition: opacity 0.2s;
}
.nav-logo:hover { opacity: 0.8; }
.logo-bracket   { color: var(--purple); }
.logo-accent    { color: var(--purple-light); }

/* Liens */
.nav-links {
  display: flex;
  gap: 2rem;
  margin-left: auto;
}

.nav-link {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-secondary);
  letter-spacing: 0.04em;
  position: relative;
  transition: color 0.2s;
}
.nav-link::after {
  content: '';
  position: absolute;
  bottom: -3px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--purple-light);
  transition: width 0.3s var(--ease);
}
.nav-link:hover { color: var(--text-primary); }
.nav-link:hover::after { width: 100%; }

/* Badge SIRET */
.nav-badge {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(34, 197, 94, 0.07);
  border: 1px solid rgba(34, 197, 94, 0.25);
  border-radius: 100px;
  padding: 0.3rem 0.8rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--green);
  white-space: nowrap;
}

.badge-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
  animation: pulse-dot 2s ease infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.6; transform: scale(0.85); }
}

/* Burger */
.burger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  margin-left: auto;
}
.burger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: transform 0.3s var(--ease), opacity 0.3s;
}

/* Menu mobile */
.mobile-menu {
  display: none;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1.2rem 1.5rem 1.5rem;
  background: rgba(8, 11, 16, 0.97);
  border-top: 1px solid var(--border);
}
.mobile-menu.open { display: flex; }
.mobile-link {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--text-secondary);
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
  transition: color 0.2s;
}
.mobile-link:hover { color: var(--text-primary); }
.mobile-badge { margin-top: 0.5rem; align-self: flex-start; }

/* ================================================================
   5. HERO SECTION
   ================================================================ */
.hero {
  padding-top: calc(var(--section-pad) + 5rem);
  padding-bottom: var(--section-pad);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

/* Tag terminal */
.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-secondary);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 0.4rem 1rem;
  animation: fade-up 0.8s var(--ease) both;
}
.tag-cursor { color: var(--purple); animation: blink 1.1s step-end infinite; }
.tag-text   { color: var(--text-primary); }
.tag-code   { color: var(--purple-light); }

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

/* Titre */
.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 6vw, 4.5rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  max-width: 18ch;
  animation: fade-up 0.9s 0.1s var(--ease) both;
}

/* Sous-titre */
.hero-sub {
  font-size: clamp(1rem, 1.6vw, 1.15rem);
  color: var(--text-secondary);
  max-width: 52ch;
  animation: fade-up 0.9s 0.2s var(--ease) both;
}

/* Bouton CTA */
.btn-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--purple);
  color: #fff;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  padding: 0.85rem 2rem;
  border-radius: var(--radius);
  position: relative;
  overflow: hidden;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
  animation: fade-up 0.9s 0.3s var(--ease) both;
}
.btn-cta::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.15), transparent);
  opacity: 0;
  transition: opacity 0.3s;
}
.btn-cta:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 40px var(--purple-glow), 0 0 0 1px var(--purple);
}
.btn-cta:hover::before { opacity: 1; }
.btn-arrow { transition: transform 0.3s var(--ease); }
.btn-cta:hover .btn-arrow { transform: translateX(4px); }

/* Stats */
.hero-stats {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-top: 0.5rem;
  animation: fade-up 0.9s 0.45s var(--ease) both;
}
.stat        { display: flex; flex-direction: column; align-items: center; }
.stat-num    { font-family: var(--font-display); font-size: 1.6rem; font-weight: 800; color: var(--green); }
.stat-label  { font-size: 0.75rem; color: var(--text-muted); font-family: var(--font-mono); }
.stat-sep    { color: var(--border); font-size: 1.4rem; }

@keyframes fade-up {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ================================================================
   6. SERVICES GRID
   ================================================================ */
.services {
  padding-block: var(--section-pad);
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-top: 2.5rem;
}

/* Carte de service */
.card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  overflow: hidden;
  transition: border-color 0.3s, transform 0.3s var(--ease), box-shadow 0.3s;
  cursor: default;
}
.card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--purple), transparent);
  opacity: 0;
  transition: opacity 0.3s;
}
.card:hover {
  border-color: var(--border-hover);
  transform: translateY(-6px);
  box-shadow: 0 24px 60px rgba(0,0,0,0.4), 0 0 0 1px var(--border-hover);
}
.card:hover::before { opacity: 1; }

/* Card featured */
.card--featured {
  border-color: rgba(139, 92, 246, 0.35);
  background: linear-gradient(135deg, #0d1117 0%, #130d2a 100%);
}
.card--featured::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 20% 0%, var(--purple-glow) 0%, transparent 60%);
  pointer-events: none;
}

.card-badge-featured {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--purple-light);
  background: rgba(139, 92, 246, 0.12);
  border: 1px solid rgba(139, 92, 246, 0.3);
  border-radius: 100px;
  padding: 0.2rem 0.65rem;
  margin-bottom: 0.6rem;
}

/* Icône */
.card-icon {
  width: 48px;
  height: 48px;
  color: var(--purple-light);
  margin-bottom: 1rem;
  transition: color 0.3s, transform 0.3s var(--ease);
}
.card:hover .card-icon { color: var(--green); transform: scale(1.1); }

/* Index discret */
.card-index {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  opacity: 0.5;
}

.card-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.6rem;
}
.card-desc {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.65;
  margin-bottom: 1.2rem;
}

/* Tags */
.card-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.tag {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--purple-light);
  background: rgba(139, 92, 246, 0.08);
  border: 1px solid rgba(139, 92, 246, 0.2);
  border-radius: 100px;
  padding: 0.2rem 0.6rem;
}

/* Ligne décorative bas */
.card-line {
  position: absolute;
  bottom: 0;
  left: 2rem;
  right: 2rem;
  height: 1px;
  background: linear-gradient(90deg, var(--purple), transparent);
  opacity: 0;
  transition: opacity 0.3s;
}
.card:hover .card-line { opacity: 0.4; }

/* ================================================================
   7. ÉTUDES DE CAS
   ================================================================ */
.cases {
  padding-block: var(--section-pad);
}

.cases-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  margin-top: 2.5rem;
}

.case-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.6rem;
  transition: border-color 0.3s, transform 0.3s var(--ease);
}
.case-card:hover {
  border-color: rgba(34, 197, 94, 0.3);
  transform: translateY(-4px);
}

.case-num {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--green);
  margin-bottom: 0.7rem;
  opacity: 0.75;
}
.case-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}
.case-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ================================================================
   8. SECTION DIAGNOSTIC
   ================================================================ */
.diagnostic {
  padding-block: var(--section-pad);
}

.diagnostic-inner {
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  background: var(--bg-card);
  box-shadow: 0 0 80px rgba(139, 92, 246, 0.08);
}

/* Header terminal */
.diagnostic-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1.2rem;
  background: var(--bg-card-alt);
  border-bottom: 1px solid var(--border);
}

.terminal-dots { display: flex; gap: 0.4rem; }
.dot {
  width: 10px; height: 10px;
  border-radius: 50%;
}
.dot--red    { background: var(--red); }
.dot--yellow { background: var(--yellow); }
.dot--green  { background: var(--green); }

.terminal-title {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-secondary);
}

/* Corps du diagnostic */
.diagnostic-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  padding: 3rem;
}

.diagnostic-desc {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
  max-width: 42ch;
}

.diagnostic-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.diagnostic-list li {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
}
.li-icon {
  color: var(--green);
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.85rem;
}

/* Placeholder embed Fillout */
.fillout-placeholder {
  background: var(--bg-card-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.placeholder-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--purple-light);
  padding: 0.6rem 1rem;
  border-bottom: 1px solid var(--border);
  background: rgba(139, 92, 246, 0.05);
}
.placeholder-content {
  padding: 0;
  min-height: 480px;
  display: flex;
  align-items: stretch;
}
.placeholder-content iframe {
  width: 100%;
  border: none;
}

/* ================================================================
   9. FOOTER
   ================================================================ */
.footer {
  border-top: 1px solid var(--border);
  padding-block: 2.5rem;
  position: relative;
  z-index: 1;
  background: rgba(8, 11, 16, 0.9);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.footer-legal {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.8;
  max-width: 60ch;
}

.footer-links {
  display: flex;
  gap: 1.5rem;
  flex-shrink: 0;
}
.footer-links a {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  transition: color 0.2s;
}
.footer-links a:hover { color: var(--purple-light); }

/* ================================================================
   10. SCROLL REVEAL (classes ajoutées en JS)
   ================================================================ */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ================================================================
   11. RESPONSIVE
   ================================================================ */
@media (max-width: 1024px) {
  .services-grid,
  .cases-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  /* Nav */
  .nav-links,
  .nav-badge { display: none; }
  .burger    { display: flex; }

  /* Hero */
  .hero-stats {
    flex-direction: column;
    gap: 0.8rem;
  }
  .stat-sep { display: none; }

  /* Grilles → 1 colonne */
  .services-grid,
  .cases-grid {
    grid-template-columns: 1fr;
  }

  /* Diagnostic */
  .diagnostic-body {
    grid-template-columns: 1fr;
    gap: 2rem;
    padding: 1.8rem;
  }

  /* Footer */
  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
}

@media (max-width: 480px) {
  .hero-title { font-size: 2rem; }
  .btn-cta    { width: 100%; justify-content: center; }
}
