/* ==========================================================================
   SOS Informatique 06 — Main CSS
   Futuristic Showroom Design System
   Variables, Reset, Base, Typography, Layout, Components, Utilities
   ========================================================================== */

/* ---------- Font Import ---------- */
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=Inter:wght@300;400;500;600;700&display=swap');

/* ---------- CSS Custom Properties ---------- */
:root {
  /* Global */
  --color-bg: #FFFFFF;
  --color-bg-alt: #F4F8FB;
  --color-text: #1A1A1A;
  --color-text-secondary: #5A6B7A;
  --color-white: #FFFFFF;
  --color-border: #E4EBF0;
  --color-footer: #0B1120;
  --color-footer-text: #8B9BB0;

  /* Volet Informatique — Cyan / Turquoise */
  --it-primary: #4AC1E0;
  --it-primary-dark: #2BA3C3;
  --it-primary-light: #7DD4EC;
  --it-bg: #F4F8FB;
  --it-accent: #2BA3C3;
  --it-accent-light: #E8F6FA;
  --it-gradient: linear-gradient(135deg, #4AC1E0, #2BA3C3);

  /* Volet Surete — Vert emeraude */
  --sr-primary: #06D6A0;
  --sr-primary-dark: #059669;
  --sr-primary-light: #D1FAE5;
  --sr-bg: #F0FDF8;
  --sr-accent: #059669;
  --sr-accent-amber: #F59E0B;
  --sr-gradient: linear-gradient(135deg, #06D6A0, #059669);

  /* Dynamic (changes per section via JS) */
  --section-primary: var(--it-primary);
  --section-gradient: var(--it-gradient);

  /* Typography */
  --font-heading: 'Space Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-size-base: 1rem;
  --font-size-sm: 0.875rem;
  --font-size-lg: 1.125rem;
  --font-size-xl: 1.25rem;
  --font-size-2xl: 1.5rem;
  --font-size-3xl: 1.875rem;
  --font-size-4xl: 2.5rem;
  --font-size-5xl: 3.25rem;
  --font-size-6xl: 4rem;
  --font-size-hero: clamp(2.75rem, 5.5vw, 5rem);
  --line-height-tight: 1.1;
  --line-height-normal: 1.65;
  --letter-spacing-tight: -0.03em;

  /* Spacing — generous for showroom feel */
  --space-xs: 0.5rem;
  --space-sm: 0.75rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2.5rem;
  --space-2xl: 3.5rem;
  --space-3xl: 5rem;
  --space-4xl: 7rem;
  --space-section: clamp(5rem, 10vw, 9rem);

  /* Layout */
  --container-max: 1200px;
  --container-narrow: 800px;
  --container-wide: 1400px;
  --nav-height: 90px;

  /* Borders & Shadows */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 16px rgba(74, 193, 224, 0.08);
  --shadow-lg: 0 12px 40px rgba(74, 193, 224, 0.1);
  --shadow-xl: 0 24px 60px rgba(11, 17, 32, 0.12);

  /* Glass */
  --glass-bg: rgba(255, 255, 255, 0.65);
  --glass-border: rgba(228, 235, 240, 0.5);
  --glass-blur: 16px;

  /* Transitions */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --duration-fast: 0.2s;
  --duration-normal: 0.35s;
  --duration-slow: 0.6s;
}

/* ---------- Reset (Modern) ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  line-height: var(--line-height-normal);
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img, picture, video, canvas, svg {
  display: block;
  max-width: 100%;
  height: auto;
}

input, button, textarea, select {
  font: inherit;
  color: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

ul, ol {
  list-style: none;
}

/* ---------- Typography ---------- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  overflow-wrap: break-word;
  line-height: var(--line-height-tight);
  letter-spacing: var(--letter-spacing-tight);
  font-weight: 700;
  color: var(--color-text);
}

h1 { font-size: var(--font-size-hero); }

h2 {
  font-size: var(--font-size-4xl);
  margin-bottom: var(--space-lg);
}

h3 {
  font-size: var(--font-size-2xl);
  margin-bottom: var(--space-md);
}

h4 {
  font-size: var(--font-size-xl);
  margin-bottom: var(--space-sm);
}

p {
  overflow-wrap: break-word;
  text-align: justify;
  hyphens: auto;
  text-align-last: left;
  color: var(--color-text-secondary);
  margin-bottom: var(--space-md);
}

p:last-child { margin-bottom: 0; }

strong {
  font-weight: 600;
  color: var(--color-text);
}

/* ---------- Hero Logo Aura Animation ---------- */
.hero-logo-aura {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-logo-aura__img {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 4;
  width: clamp(140px, 22vw, 260px);
  height: auto;
  filter: drop-shadow(0 0 30px rgba(74, 193, 224, 0.45));
  animation: logo-fade-in 1.5s var(--ease-out) both;
  pointer-events: none;
}

@keyframes logo-fade-in {
  from { opacity: 0; transform: translate(-50%, -50%) scale(0.85); }
  to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

@media (max-width: 767px) {
  .hero-logo-aura__img { width: clamp(120px, 35vw, 180px); }
}

/* ---------- Particle Background Layer ---------- */
#particles-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

#hero-particles canvas,
#hero-particles { cursor: grab; }
#hero-particles canvas:active,
#hero-particles:active { cursor: grabbing; }

.nav, .hero, .section, .footer, .mobile-cta {
  position: relative;
  z-index: 1;
}

/* Hero particles overlay must not block orbit controls */
.hero--image .hero__overlay { pointer-events: none; }
.hero--image .hero__bottom  { pointer-events: auto; }

/* ---------- Layout Utilities ---------- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--space-lg);
}

.container--narrow { max-width: var(--container-narrow); }
.container--wide   { max-width: var(--container-wide); }

.section {
  padding-block: var(--space-section);
}

.section--alt { background-color: var(--color-bg-alt); }
.section--it  { background-color: var(--it-bg); }
.section--sr  { background-color: var(--sr-bg); }

.section__header {
  text-align: center;
  max-width: 720px;
  margin-inline: auto;
  margin-bottom: var(--space-3xl);
}

.section__subtitle {
  display: inline-block;
  font-family: var(--font-heading);
  font-size: var(--font-size-sm);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--section-primary);
  margin-bottom: var(--space-sm);
}

/* ---------- Grid & Flex ---------- */
.grid {
  display: grid;
  gap: var(--space-xl);
}

.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }

.flex {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

/* ---------- Text Utilities ---------- */
.text-center { text-align: center; }
/* Contextes où justify est inapproprié (textes courts ou centrés) */
.text-center p,
.section__header p,
.hero p,
.hero__subtitle,
.cta-gradient p,
.review-card__text,
.footer p,
.footer__desc,
.contact-info p,
.contact-info__item p,
.footer__contact-item span,
.about-why__item span,
.trust-item__label,
.clients-marquee__item span,
.nav p,
label,
.btn,
.badge,
.section__subtitle {
  text-align: inherit;
  text-align-last: inherit;
  hyphens: none;
}

/* Éléments centrés : forcer center même en contexte justify */
[style*="text-align:center"] p,
[style*="text-align: center"] p {
  text-align: center;
  text-align-last: center;
}
.text-left { text-align: left; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: var(--nav-height);
  overflow: hidden;
  background: linear-gradient(160deg, var(--it-bg) 0%, var(--color-bg) 50%, #F0FDF8 100%);
}

/* Hero with background image — fullscreen immersive */
.hero--image {
  background: #040d1a;
  min-height: 100vh;
  padding: 0;
}

.hero__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  will-change: transform;
  transform-origin: center center;
}

.hero__bg-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 15%;
  opacity: 0.7;
}

.hero__overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    radial-gradient(ellipse at center, rgba(4,13,26,0.15) 0%, rgba(4,13,26,0.55) 70%, rgba(4,13,26,0.85) 100%),
    linear-gradient(0deg, rgba(4,13,26,0.7) 0%, transparent 50%);
}

.hero--image .hero__bottom {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: calc(var(--nav-height) + var(--space-xl)) var(--space-lg) var(--space-2xl);
}

.hero--image .hero__title {
  color: #FFFFFF;
  text-shadow: 0 2px 30px rgba(0, 0, 0, 0.4);
  font-size: clamp(1.8rem, 4vw, 3rem);
  letter-spacing: -0.02em;
  margin-bottom: var(--space-sm);
}

.hero--image .hero__subtitle {
  color: rgba(255, 255, 255, 0.8);
  font-size: var(--font-size-base);
  max-width: 600px;
  margin-inline: auto;
  margin-bottom: var(--space-xl);
}

.hero--image .hero__actions {
  justify-content: center;
  margin-bottom: var(--space-lg);
}

.hero--image .hero__badge {
  justify-content: center;
  margin-bottom: var(--space-md);
}

.hero--image .scroll-indicator {
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 0;
}

.hero--image .badge--it {
  background: rgba(74, 193, 224, 0.2);
  color: var(--it-primary-light);
  border: 1px solid rgba(74, 193, 224, 0.35);
  backdrop-filter: blur(8px);
}

.hero--image .badge--sr {
  background: rgba(6, 214, 160, 0.2);
  color: #6EE7B7;
  backdrop-filter: blur(8px);
  border: 1px solid rgba(6, 214, 160, 0.3);
}

.hero__content {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 850px;
}

.hero__badge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-xl);
}

.hero__title {
  margin-bottom: var(--space-lg);
  color: var(--color-text);
}

.hero__subtitle {
  font-size: var(--font-size-lg);
  color: var(--color-text-secondary);
  max-width: 600px;
  margin-inline: auto;
  margin-bottom: var(--space-2xl);
}

.hero__actions {
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: var(--space-3xl);
}

/* ---------- Split Screen Volets ---------- */
.split-screen .card {
  padding: var(--space-2xl);
  border: 1px solid var(--color-border);
  background: var(--color-white);
  border-radius: var(--radius-lg);
  transition: transform var(--duration-normal) var(--ease-out),
              box-shadow var(--duration-normal) var(--ease-out);
}

.split-screen .card:hover {
  transform: translateY(-4px);
}

.split-screen .card[data-volet="it"] {
  border-top: 3px solid var(--it-primary);
  background: linear-gradient(180deg, var(--it-bg) 0%, var(--color-white) 30%);
}

.split-screen .card[data-volet="it"]:hover {
  border-color: var(--it-primary);
  box-shadow: 0 16px 48px rgba(74, 193, 224, 0.15);
}

.split-screen .card[data-volet="sr"] {
  border-top: 3px solid var(--sr-primary);
  background: linear-gradient(180deg, var(--sr-bg) 0%, var(--color-white) 30%);
}

.split-screen .card[data-volet="sr"]:hover {
  border-color: var(--sr-primary);
  box-shadow: 0 16px 48px rgba(6, 214, 160, 0.15);
}

.split-screen .card h3 {
  color: var(--color-text);
  font-size: var(--font-size-2xl);
}

.split-screen .card p {
  color: var(--color-text-secondary);
  font-size: var(--font-size-base);
  line-height: 1.7;
}

.split-screen .card .badge { font-size: var(--font-size-sm); padding: 6px 14px; }
.split-screen .card .flex span { color: var(--color-text); font-weight: 500; }

/* ---------- Trust Numbers ---------- */
.trust-item__number {
  display: block;
  font-family: var(--font-heading);
  font-size: var(--font-size-4xl);
  font-weight: 700;
  color: var(--color-text);
  line-height: 1;
  margin-bottom: var(--space-xs);
}

.trust-item__label {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
}

/* ---------- Glassmorphism Panel ---------- */
.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 32px rgba(11, 17, 32, 0.06);
}

/* ---------- Scroll Reveal ---------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity var(--duration-slow) var(--ease-out),
              transform var(--duration-slow) var(--ease-out);
  will-change: opacity, transform;
}

[data-reveal].revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger children if needed — add delay via inline style or classes */
[data-reveal="left"]  { transform: translateX(-32px); }
[data-reveal="right"] { transform: translateX(32px); }
[data-reveal="scale"] { transform: scale(0.92); }

[data-reveal="left"].revealed,
[data-reveal="right"].revealed,
[data-reveal="scale"].revealed {
  transform: translate(0) scale(1);
}

/* ---------- Magnetic Button Effect ---------- */
.magnetic {
  transition: transform var(--duration-fast) var(--ease-out);
  will-change: transform;
  /* JS sets transform: translate(Xpx, Ypx) on hover via mousemove */
}

/* ---------- Gridlines Background ---------- */
.gridlines {
  position: relative;
}

.gridlines::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image:
    linear-gradient(rgba(74, 193, 224, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(74, 193, 224, 0.05) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 75%);
  pointer-events: none;
}

.gridlines > * { position: relative; z-index: 1; }

/* ---------- Selection ---------- */
::selection {
  background-color: var(--it-primary);
  color: var(--color-white);
}

/* ---------- Focus Visible (Accessibility) ---------- */
:focus-visible {
  outline: 2px solid var(--section-primary);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* ---------- Screen Reader Only ---------- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* ---------- Reduced Motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  [data-reveal] {
    opacity: 1 !important;
    transform: none !important;
  }
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .grid--4 { grid-template-columns: repeat(2, 1fr); }
  .grid--3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 767px) {
  .grid--2,
  .grid--3,
  .grid--4 { grid-template-columns: 1fr; }

  .hero { min-height: 90vh; }

  h2 { font-size: var(--font-size-3xl); }

  .section__header { margin-bottom: var(--space-2xl); }

  .gridlines::before { background-size: 40px 40px; }
}

@media (max-width: 480px) {
  .container { padding-inline: var(--space-md); }
  h2 { font-size: var(--font-size-2xl); }
}
