/* Innerving Data — design tokens */
:root {
  color-scheme: dark;

  --bg: #06070c;
  --bg-elev: #0d0f18;
  --surface: rgba(255, 255, 255, 0.04);
  --surface-hover: rgba(255, 255, 255, 0.07);
  /* Fonds quasi opaques : isolent le contenu du fond animé */
  --surface-solid: rgba(14, 16, 26, 0.9);
  --surface-solid-hover: rgba(23, 26, 40, 0.95);
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.16);

  --text: #eef0f7;
  --text-dim: #a8adc0;
  --text-faint: #6c7186;

  --accent: #7c8bff;
  --accent-2: #35e6c4;
  --accent-soft: rgba(124, 139, 255, 0.14);
  --pulse: #ffd23f;
  --pulse-core: #fff2a8;

  --radius: 16px;
  --radius-sm: 10px;
  --container: 72rem;

  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}

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

.wrap {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 1.5rem;
}

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

h1, h2, h3 {
  font-weight: 650;
  letter-spacing: -0.02em;
  margin: 0;
}

p { color: var(--text-dim); margin: 0; }

/* ---------- background decoration ---------- */

.bg-grid {
  position: fixed;
  inset: 0;
  z-index: -2;
  background-image:
    linear-gradient(to right, rgba(255,255,255,0.045) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,0.045) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, black 40%, transparent 100%);
}

.bg-nerves {
  position: fixed;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  pointer-events: none;
  mask-image: radial-gradient(ellipse 92% 96% at 50% 26%, black 55%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 92% 96% at 50% 26%, black 55%, transparent 100%);
}

.nerve-node {
  fill: var(--accent);
  opacity: 0.4;
  animation: nerve-node-pulse 3.6s ease-in-out infinite;
}

.nerve-link {
  stroke: var(--accent);
  stroke-width: 0.6;
  fill: none;
  opacity: 0.3;
}

/* Icônes au trait posées sur la structure. Deux familles : « data » en bleu sur
   la trame du haut, « nerf » en turquoise sur le cordon et ses terminaisons. */
.icon-bg {
  fill: var(--bg);
  stroke: none;
  opacity: 0.9;
}

.icon-shape {
  fill: none;
  stroke-width: 1.1;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.data-icon {
  opacity: 0.6;
  animation: data-icon-pulse 4.8s ease-in-out infinite;
}

/* Trait affiné : le groupe est agrandi, un 1.1 brut deviendrait très épais. */
.data-icon .icon-shape {
  stroke: var(--accent);
  stroke-width: 0.6;
}

/* Opacité et position pilotées par le scroll : pas d'animation CSS ici. */
.nerve-icon .icon-shape { stroke: var(--accent-2); }

/* Halo diffus, comme celui qui entoure le cœur des impulsions. */
.icon-halo {
  fill: var(--pulse);
  stroke: none;
  opacity: 0.17;
}

/* Le cerveau brille comme les influx : palette jaune et diffusion lumineuse.
   Le trait est affiné car le groupe est fortement agrandi. */
/* Épaisseur exprimée dans la grille 24 d'origine, avant la remise à l'échelle. */
.nerve-icon.is-brain .icon-shape {
  stroke: var(--pulse-core);
  stroke-width: 1.6;
}

.nerve-icon.is-brain .icon-lines {
  filter: drop-shadow(0 0 1.1px var(--pulse)) drop-shadow(0 0 2.6px var(--pulse));
}

@keyframes data-icon-pulse {
  0%, 100% { opacity: 0.45; }
  50% { opacity: 0.85; }
}

.nerve-cord,
.nerve-branch {
  fill: none;
  stroke: var(--accent);
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Impulsions électriques circulant sur les nerfs formés */
.nerve-pulse .pulse-halo {
  fill: var(--pulse);
  opacity: 0.16;
}

.nerve-pulse .pulse-core {
  fill: var(--pulse-core);
  opacity: 0.95;
}

@keyframes nerve-node-pulse {
  0%, 100% { opacity: 0.25; }
  50% { opacity: 0.7; }
}

@media (max-width: 640px) {
  .bg-nerves { opacity: 0.6; }
}

@media (prefers-reduced-motion: reduce) {
  .nerve-node { animation: none; opacity: 0.45; }
  .data-icon { animation: none; opacity: 0.55; }
}

.bg-glow {
  position: fixed;
  top: -20%;
  left: 50%;
  translate: -50% 0;
  width: 90vw;
  height: 60vw;
  max-width: 1100px;
  max-height: 750px;
  z-index: -1;
  background:
    radial-gradient(circle at 30% 30%, rgba(124, 139, 255, 0.28), transparent 55%),
    radial-gradient(circle at 70% 60%, rgba(53, 230, 196, 0.16), transparent 50%);
  filter: blur(40px);
  pointer-events: none;
}

/* ---------- header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(14px);
  background: rgba(6, 7, 12, 0.7);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 4.25rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}

.logo-mark {
  color: var(--accent);
  font-size: 1rem;
}

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

.nav a {
  font-size: 0.92rem;
  color: var(--text-dim);
  transition: color 0.15s ease;
}

.nav a:hover { color: var(--text); }

.nav-cta {
  padding: 0.5rem 1.1rem;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  color: var(--text) !important;
}

.nav-cta:hover { background: var(--surface-hover); }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 2.25rem;
  height: 2.25rem;
  background: none;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  width: 1.1rem;
  height: 1.5px;
  margin-inline: auto;
  background: var(--text);
  transition: transform 0.2s ease, opacity 0.2s ease;
}

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), #5a63d8);
  color: #07080f;
  box-shadow: 0 8px 24px -8px rgba(124, 139, 255, 0.55);
}

.btn-primary:hover { transform: translateY(-2px); }

.btn-ghost {
  background: var(--surface);
  border-color: var(--border-strong);
  color: var(--text);
}

.btn-ghost:hover { background: var(--surface-hover); }

.btn-lg { padding: 0.9rem 1.9rem; font-size: 1rem; }

/* ---------- hero ---------- */

.hero {
  padding-top: clamp(4rem, 10vw, 7rem);
  padding-bottom: clamp(3rem, 8vw, 5rem);
  text-align: center;
}

.eyebrow {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.9rem;
}

/* Le nom porte le hero : il domine la baseline qui le suit. */
.hero-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-size: clamp(2.5rem, 6.4vw, 4.2rem);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.05;
  color: var(--text);
  margin: 0 0 1rem;
}

.hero-brand-mark {
  color: var(--accent);
  font-size: 0.58em;
}

.hero-tagline {
  font-size: clamp(1.15rem, 2.5vw, 1.7rem);
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.012em;
  color: var(--text);
  max-width: 34rem;
  margin: 0 auto;
}

.grad-text {
  background: linear-gradient(100deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-sub {
  max-width: 38rem;
  margin: 1.4rem auto 0;
  font-size: 1.05rem;
}

.hero-actions {
  display: flex;
  justify-content: center;
  gap: 0.9rem;
  margin-top: 2.1rem;
  flex-wrap: wrap;
}

.hero-stats {
  list-style: none;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0;
  margin: 3.5rem auto 0;
  padding: 0;
  max-width: 44rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}

.hero-stats li {
  flex: 1 1 auto;
  min-width: 7.5rem;
  padding: 1.1rem 0.5rem;
  text-align: center;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.hero-stats li:last-child { border-right: none; }

.hero-stats strong {
  font-size: 1rem;
  color: var(--text);
}

.hero-stats span {
  font-size: 0.78rem;
  color: var(--text-faint);
}

/* ---------- section heads ---------- */

.section-head {
  text-align: center;
  max-width: 38rem;
  margin: 0 auto 3rem;
}

.section-head h2 {
  font-size: clamp(1.6rem, 3.5vw, 2.2rem);
  margin-top: 0.5rem;
}

.section-sub { margin-top: 0.75rem; }

section { padding-block: clamp(3rem, 7vw, 5.5rem); }

/* ---------- services cards ---------- */

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

/* Nombre de cartes non multiple de 3 : la dernière resterait seule en bord de
   rangée. On la recentre plutôt que de la laisser flotter à gauche. */
.cards > :last-child:nth-child(3n + 1) {
  grid-column: 2;
}

.card {
  padding: 1.9rem 1.7rem;
  border-radius: var(--radius);
  background: var(--surface-solid);
  border: 1px solid var(--border);
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.card:hover {
  transform: translateY(-4px);
  border-color: var(--border-strong);
  background: var(--surface-solid-hover);
}

.card-icon {
  width: 2.75rem;
  height: 2.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  font-size: 1.3rem;
  margin-bottom: 1.1rem;
}

.card h3 {
  font-size: 1.08rem;
  margin-bottom: 0.6rem;
}

.card p { font-size: 0.92rem; }

/* ---------- about ---------- */

.about-card {
  max-width: 42rem;
  margin: 0 auto;
  text-align: center;
  padding: 2.5rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: linear-gradient(180deg, var(--surface-solid-hover), var(--surface-solid));
}

.about-card h2 { margin: 0.5rem 0 1rem; font-size: clamp(1.5rem, 3vw, 2rem); }

/* ---------- contact ---------- */

.contact-card {
  text-align: center;
  max-width: 34rem;
  margin: 0 auto;
  padding: 3rem 2rem;
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 50% 0%, rgba(124, 139, 255, 0.18), transparent 60%),
    var(--bg-elev);
  border: 1px solid var(--border);
}

.contact-card h2 { margin: 0.5rem 0 0.75rem; font-size: clamp(1.6rem, 3vw, 2.1rem); }
.contact-card > p { margin-bottom: 1.8rem; }

/* ---------- legal ---------- */

.legal {
  max-width: 42rem;
  padding-block: clamp(4rem, 8vw, 6rem);
}

.legal h1 {
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  margin: 0.5rem 0 2rem;
}

.legal h2 {
  font-size: 1.1rem;
  margin: 2.2rem 0 0.75rem;
}

.legal p {
  font-size: 0.95rem;
  margin-bottom: 0.9rem;
}

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

.legal a { text-decoration: underline; }

.legal-updated {
  margin-top: 2.5rem;
  font-size: 0.85rem;
  opacity: 0.6;
}

/* ---------- footer ---------- */

.site-footer {
  border-top: 1px solid var(--border);
  padding-block: 1.75rem;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-faint);
}

/* ---------- responsive ---------- */

@media (max-width: 860px) {
  .cards { grid-template-columns: repeat(2, 1fr); }
  /* La règle de recentrage compte les éléments, pas les colonnes : hors grille
     à 3 colonnes elle placerait la carte au mauvais endroit. */
  .cards > :last-child:nth-child(3n + 1) { grid-column: auto; }
}

@media (max-width: 640px) {
  .nav {
    position: absolute;
    top: 4.25rem;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--bg-elev);
    border-bottom: 1px solid var(--border);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease;
  }

  .nav.open { max-height: 20rem; }

  .nav a {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border);
  }

  .nav-cta {
    margin: 1rem 1.5rem;
    text-align: center;
    border-radius: var(--radius-sm);
  }

  .nav-toggle { display: flex; }

  .cards { grid-template-columns: 1fr; }
  .hero-stats li { min-width: 45%; }
}

code {
  padding: 0.1em 0.3em;
  border-radius: 4px;
  background: rgba(127, 127, 127, 0.18);
}
