/* Universal Connect — styles de la page d'accueil (layout B) */
:root {
  --bg: #02040C;          /* bleu nuit presque noir */
  --bg-raised: #0A1124;
  --accent: #4DA3FF;      /* bleu principal (traits, chiffres, points) */
  --accent-strong: #1F6FEB; /* fond des boutons : texte blanc lisible (contraste 4,6:1) */
  --accent-soft: #9CCBFF;
  --ink: #EEF3FF;         /* texte principal */
  --ink-muted: #B6C2D9;   /* texte secondaire (contraste > 9:1 sur --bg) */
  --line: rgba(255, 255, 255, 0.1);
  --glass: rgba(10, 18, 40, 0.55);

  --font-display: "Sora", "Segoe UI", system-ui, sans-serif;
  --font-body: "DM Sans", "Segoe UI", system-ui, sans-serif;

  --gutter: clamp(16px, 4vw, 48px);
  --radius-l: 28px;
  --radius-m: 18px;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent-soft); outline-offset: 3px; border-radius: 8px; }

.skip {
  position: absolute; left: 16px; top: -60px; z-index: 50;
  padding: 10px 16px; border-radius: 10px; background: var(--accent-strong); color: #FFFFFF;
}
.skip:focus { top: 16px; }

.glass {
  background: var(--glass);
  border: 1px solid var(--line);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}

/* ---------- En-tête ---------- */
.site-header {
  position: absolute; inset: 0 0 auto 0; z-index: 10;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px;
  padding: 24px var(--gutter);
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand-mark {
  display: inline-grid; place-items: center; width: 40px; height: 40px;
  border-radius: 12px; border: 1px solid rgba(77, 163, 255, 0.6);
  font-family: var(--font-display); font-weight: 600; font-size: 14px; color: var(--accent-soft);
  box-shadow: 0 0 18px rgba(47, 123, 255, 0.3);
}
.brand-mark.small { width: 32px; height: 32px; font-size: 12px; border-radius: 10px; }
.brand-mark svg { width: 22px; height: 22px; fill: none; stroke: var(--accent); stroke-width: 1.7; stroke-linecap: round; }
.brand-mark.small svg { width: 17px; height: 17px; }
/* Nom de la compagnie (majuscules) + slogan bleu en dessous */
.brand-text { display: flex; flex-direction: column; gap: 2px; line-height: 1.1; }
.brand-name { font-family: var(--font-display); font-weight: 600; font-size: 16px; letter-spacing: 0.08em; text-transform: uppercase; color: #FFFFFF; }
.brand-tag { font-size: 12px; color: var(--accent); letter-spacing: 0.01em; }
.footer-tag { color: var(--accent-soft); }

.nav { display: flex; gap: 4px; padding: 6px; border-radius: 999px; }
.nav a {
  padding: 10px 18px; border-radius: 999px; text-decoration: none;
  font-size: 15px; color: var(--ink-muted); transition: color .2s, background-color .2s;
}
.nav a:hover { color: var(--ink); background: rgba(77, 163, 255, 0.14); }

.header-actions { display: flex; align-items: center; gap: 18px; }
.lang { font-size: 14px; color: var(--ink-muted); text-underline-offset: 5px; min-height: 44px; display: inline-flex; align-items: center; }
.lang:hover { color: var(--ink); }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 52px; padding: 0 28px; border-radius: 999px;
  font-size: 16px; font-weight: 500; text-decoration: none;
  transition: transform .2s, box-shadow .2s, background-color .2s;
}
.btn-small { min-height: 44px; padding: 0 20px; font-size: 15px; }
/* Dégradé bleu, texte blanc : les deux extrémités gardent un contraste ≥ 4,5:1 */
.btn-primary { background: linear-gradient(135deg, var(--accent-strong), #1550D6); color: #FFFFFF; box-shadow: 0 0 36px rgba(47, 123, 255, 0.45), inset 0 0 0 1px rgba(156, 203, 255, 0.35); }
.btn-primary:hover { box-shadow: 0 0 56px rgba(47, 123, 255, 0.7), inset 0 0 0 1px rgba(156, 203, 255, 0.6); transform: translateY(-1px); }
.btn-ghost { color: var(--ink); }
.btn-ghost:hover { border-color: rgba(77, 163, 255, 0.55); }

/* ---------- Hero ---------- */
.hero {
  position: relative; min-height: 100vh; min-height: 100svh;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 120px var(--gutter) 16px; overflow: hidden;   /* peu d'espace sous les cartes : « Our projects » suit de près */
  /* Espace bleu nuit : photo nébuleuse / Voie lactée (générée avec Higgsfield, voir originaux-ia/),
     halo léger derrière la Terre, fondu vers la section suivante. Couleur de secours si l'image ne charge pas. */
  background:
    linear-gradient(to bottom, transparent 78%, var(--bg) 100%),   /* fondu vers la section suivante, sans coupure */
    radial-gradient(ellipse 50% 42% at 50% 46%, rgba(28, 86, 210, 0.12) 0%, transparent 70%),
    url("../img/space/nebula-desktop.webp") center / cover no-repeat,
    #01030B;
}
.scene { position: absolute; inset: 0; z-index: 0; }
/* Canvas en absolu : sa taille interne (pixels × densité d'écran) ne doit jamais agrandir la scène.
   Sinon, sur mobile (scène dans la grille), boucle « canvas plus grand → scène plus grande → canvas plus grand ». */
.scene canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.scene-fallback {
  display: none; position: absolute; left: 50%; top: 46%; width: 340px; height: 340px; translate: -50% -50%;
  border-radius: 50%;
  background: radial-gradient(circle at 70% 28%, #E6F2FF 0%, #4DA3FF 14%, #123A8C 42%, #06122E 72%, #020611 100%);
  box-shadow: 0 0 140px rgba(47, 123, 255, 0.45);
}
.no-webgl .scene-fallback { display: block; }
.no-webgl .scene canvas { display: none; }

.hero-content {
  position: relative; z-index: 1; flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; gap: 28px; padding: 24px 0 48px;
  pointer-events: none;
}
.hero-content a, .hero-content p { pointer-events: auto; }

.hero-title {
  margin: 0;
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(48px, 10.5vw, 148px); line-height: 0.95; letter-spacing: -0.04em;
  text-transform: uppercase;
  text-shadow: 0 6px 50px rgba(0, 0, 0, 0.55);
}
/* Le masque sert à l'animation de montée ; la marge du haut garde les accents (Â, É) visibles. */
.hero-title .line { display: block; overflow: hidden; padding: 0.2em 0 0.04em; margin-top: -0.2em; }
.hero-title .line > span { display: inline-block; }

/* Mots en dégradé bleu avec un reflet qui glisse (titres).
   Le remplissage déborde (padding compensé) pour que le dégradé couvre aussi les accents (É, Ê).
   Pas d'ombre ni de lueur : avec un texte transparent, elles se verraient à travers les lettres. */
.text-accent {
  padding: 0.2em 0.06em 0.06em; margin: 0 -0.06em;
  background: linear-gradient(100deg, #D9EDFF 0%, #74B9FF 22%, #2F7BFF 50%, #74B9FF 78%, #D9EDFF 100%) 0 0 / 200% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: none;
  animation: title-sheen 9s linear infinite;
}
@keyframes title-sheen { to { background-position: 200% 0; } }
/* Dans le grand titre, le mot est un bloc animé : on compense aussi le padding vertical. */
.hero-title .line > .text-accent { margin: -0.2em -0.06em -0.06em; }

.hero-lead { margin: 0; max-width: 44ch; font-size: clamp(17px, 1.6vw, 20px); color: #EAF1FF; text-shadow: 0 1px 2px rgba(0,0,0,.8), 0 0 24px rgba(2,5,15,.9); }
.hero-ctas { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; }

/* Cartes des services : voir services.css */

/* ---------- Méthode ---------- */
.section-title {
  margin: 0; font-family: var(--font-display); font-weight: 600;
  font-size: clamp(40px, 5.5vw, 72px); line-height: 1.02; letter-spacing: -0.025em; text-transform: uppercase;
}
.method {
  max-width: 1320px; margin: 0 auto; padding: clamp(80px, 12vw, 160px) var(--gutter);
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(32px, 6vw, 96px); align-items: start;
}
.method .section-title { position: sticky; top: 48px; max-width: 9ch; }
.steps { list-style: none; margin: 0; padding: 0; }
.step {
  display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 16px;
  padding: 36px 0; border-top: 1px solid var(--line);
}
.step:last-child { border-bottom: 1px solid var(--line); }
.step-n { font-family: var(--font-display); font-weight: 300; font-size: 32px; line-height: 1; color: var(--accent); }
.step h3 { margin: 0; font-family: var(--font-display); font-weight: 400; font-size: clamp(22px, 2.2vw, 28px); line-height: 1.2; }
.step p { margin: 10px 0 0; max-width: 52ch; color: var(--ink-muted); }

/* ---------- Contact ---------- */
.contact {
  position: relative; overflow: hidden;
  max-width: 1320px; margin: 0 var(--gutter) clamp(48px, 8vw, 96px); padding: clamp(64px, 9vw, 120px) var(--gutter);
  border-radius: var(--radius-l); border: 1px solid var(--line); background: var(--bg-raised);
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 20px;
}
@media (min-width: 1416px) { .contact { margin-inline: auto; } }
.contact > * { position: relative; }
.contact p { margin: 0; max-width: 46ch; color: var(--ink-muted); }
.contact .note { font-size: 14px; }
.contact-glow {
  position: absolute; left: 50%; bottom: -260px; width: 720px; height: 420px; translate: -50% 0;
  border-radius: 50%; background: radial-gradient(closest-side, rgba(47, 123, 255, 0.38), transparent);
  pointer-events: none;
}

/* ---------- Pied de page ---------- */
.site-footer {
  display: flex; flex-wrap: wrap; align-items: center; gap: 16px;
  padding: 24px var(--gutter) 40px; color: var(--ink-muted); font-size: 14px;
}
.site-footer .lang { margin-left: auto; }
.site-footer .credit { font-size: 12px; opacity: 0.75; }

/* ---------- Page 404 ---------- */
.not-found {
  min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 18px; padding: 48px var(--gutter); text-align: center;
}
.not-found-code { margin: 0; font-family: var(--font-display); font-size: 15px; letter-spacing: 0.3em; color: var(--accent-soft); }
.not-found p { margin: 0; color: var(--ink-muted); }

/* ---------- Responsive ---------- */
@media (max-width: 760px) {
  .site-header { position: absolute; }
  .nav { order: 3; width: 100%; justify-content: center; }
  .brand-text { display: none; }
  .hero { padding-top: 170px; }
  /* Mobile : la Terre est centrée sur le titre et les boutons seulement (1re rangée),
     puis un espace net avant les cartes des services (2e rangée). */
  .hero { display: grid; grid-template-rows: 1fr auto; }
  /* Mobile : image portrait plus légère (le téléphone ne télécharge jamais la version ordinateur).
     Calée en haut : la Voie lactée passe derrière la Terre, le bas fond vers les cartes. */
  .hero {
    background:
      linear-gradient(to bottom, transparent 78%, var(--bg) 100%),
      radial-gradient(ellipse 70% 30% at 50% 30%, rgba(28, 86, 210, 0.12) 0%, transparent 70%),
      url("../img/space/nebula-mobile.webp") center top / cover no-repeat,
      #01030B;
  }
  .hero .scene {
    position: relative; grid-area: 1 / 1;
    margin: -170px calc(var(--gutter) * -1) 0;   /* la scène remonte sous l'en-tête et touche les bords */
  }
  .hero-content { grid-area: 1 / 1; }
  /* Boutons plus bas que la Terre : la scène perd la même hauteur en bas, donc la Terre et le titre ne bougent pas. */
  .hero-ctas { margin-top: clamp(40px, 12vw, 60px); }
  .hero .scene { margin-bottom: clamp(40px, 12vw, 60px); }
  .services-wrap { grid-row: 2; }   /* l'espace avant les cartes est dans services.css (sinon « margin: 0 » l'annule) */
  .method { grid-template-columns: minmax(0, 1fr); }
  .method .section-title { position: static; max-width: none; }
}
@media (max-width: 420px) {
  .nav a { padding: 10px 12px; }
  .btn { width: 100%; }
  .hero-ctas { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn, .nav a { transition: none; }
  .text-accent { animation: none; }
}
