
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  font-weight: var(--fw-regular);
  color: var(--text);
  background-color: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  position: relative;
  overflow-x: hidden;
}

/* ── Grille 1px animée — fond global fixe ───────────────── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(26,79,255,0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(26,79,255,0.055) 1px, transparent 1px);
  background-size: 72px 72px;
  animation: grid-drift 40s linear infinite;
}

@keyframes grid-drift {
  0%   { background-position: 0 0; }
  100% { background-position: 72px 72px; }
}

/* Contenu toujours au-dessus de la grille */
header, main, footer, section,
.container, nav, .site-header,
.site-footer, [class*="section"],
.hero, .cta-banner, .stats-dark,
.diff-dark, .apps-section {
  position: relative;
  z-index: 1;
}

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }

h1 {
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: var(--text);
}

h2 {
  font-weight: 400;
  letter-spacing: -0.025em;
  line-height: 1.15;
  color: var(--text);
}

h3 {
  font-weight: 300;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--text);
}

h4, h5, h6 {
  font-weight: var(--fw-semi);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

p { font-weight: var(--fw-light); }

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

/* ── Reveal on scroll ───────────────────────────────────────── */
[data-reveal] {
  opacity: 0;
  transform: translateY(44px);
  transition: opacity 0.72s cubic-bezier(0.22,1,0.36,1),
              transform 0.72s cubic-bezier(0.22,1,0.36,1);
}
[data-reveal].revealed {
  opacity: 1;
  transform: translateY(0);
}
@media (prefers-reduced-motion: reduce) {
  [data-reveal] { transform: none; }
  [data-reveal].revealed { transition-duration: 0.15s; }
}

/* ── Back to top ────────────────────────────────────────────── */
#back-to-top {
  position: fixed !important;
  bottom: 32px;
  right: 32px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0d1526 0%, #111d35 100%);
  border: 1px solid rgba(91,143,255,0.35);
  box-shadow: 0 0 18px rgba(26,79,255,0.15), inset 0 1px 0 rgba(91,143,255,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--blue);
  opacity: 0;
  visibility: hidden;
  transition: opacity .3s ease, visibility .3s ease, border-color .2s, box-shadow .2s, transform .2s;
  z-index: 9999 !important;
}
#back-to-top.visible {
  opacity: 1;
  visibility: visible;
}
#back-to-top:hover {
  border-color: rgba(91,143,255,0.7);
  box-shadow: 0 0 28px rgba(26,79,255,0.3), 0 0 8px rgba(91,143,255,0.2), inset 0 1px 0 rgba(91,143,255,0.15);
  transform: translateY(-2px);
  color: #fff;
}
