/* Resolv-ia — socle commun aux 4 expériences
   Tokens, reset, navigation, sections, boutons, préchargeur, révélations. */

:root {
  /* Couleurs — nuit teintée de prune + aurore ancrée sur le rose de la marque */
  --bg: #06040c;
  --bg-2: #0d0818;
  --pink: #f0287a;
  --magenta: #d9166b;
  --rose: #f58fbf;
  --plum: #7a1f4f;
  --violet: #8c5bff;
  --blue: #4f8dff;
  --cyan: #3dd6f5;
  --green: #5cf2b8;
  --text: #f4f1f8;
  --muted: #a79fb5;
  --line: rgba(255, 255, 255, 0.09);
  --glass: rgba(13, 8, 24, 0.55);

  /* Typographie — chaque version redéfinit --font-display / --font-body / --font-mono */
  --font-display: 'Outfit', system-ui, sans-serif;
  --font-body: 'Manrope', system-ui, sans-serif;
  --font-mono: ui-monospace, 'JetBrains Mono', 'SF Mono', Menlo, monospace;
  --font-brand: 'Outfit', 'Poppins', system-ui, sans-serif;

  /* Mise en page */
  --gutter: clamp(20px, 5vw, 72px);
  --content-w: 1120px;
  --narrow-w: 760px;
  --nav-h: 76px;
  --radius: 22px;
  --ease-out: cubic-bezier(0.2, 0.7, 0.2, 1);
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
p { margin: 0; }
h1, h2, h3, h4 { margin: 0; font-weight: inherit; }
ul { margin: 0; padding: 0; list-style: none; }

::selection { background: rgba(240, 40, 122, 0.45); color: #fff; }

:focus-visible { outline: 2px solid var(--pink); outline-offset: 3px; border-radius: 4px; }

.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;
}

/* Toile WebGL fixée derrière le contenu */
.gl {
  position: fixed; inset: 0; z-index: 0;
  width: 100%; height: 100%;
  display: block;
}

.content { position: relative; z-index: 1; }

/* ---------- Marque ---------- */
.wordmark {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-brand);
  font-weight: 600; font-size: 1.35rem; letter-spacing: -0.02em; line-height: 1;
}
.wordmark .rv-mark { width: 32px; height: 31px; flex: none; }
/* le lettrage est un tracé (décalque du logo) : il prend la couleur du texte, « ia » garde son rose */
.wordmark .rv-word { height: 17px; width: auto; flex: none; overflow: visible; }
.wordmark .rv-legal { opacity: 0.66; }

/* ---------- Navigation ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 20;
  height: var(--nav-h);
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 0 var(--gutter);
  background: linear-gradient(to bottom, rgba(6, 4, 12, 0.8), rgba(6, 4, 12, 0));
  pointer-events: none;
}
.nav > * { pointer-events: auto; }
.nav-links { display: flex; gap: clamp(16px, 2.4vw, 34px); font-size: 0.9rem; font-weight: 500; color: var(--muted); }
.nav-links a { position: relative; padding: 6px 0; transition: color 0.3s; }
.nav-links a::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 1px;
  background: var(--pink); transform: scaleX(0); transform-origin: left; transition: transform 0.35s var(--ease-out);
}
.nav-links a:hover, .nav-links a.is-active { color: var(--text); }
.nav-links a:hover::after, .nav-links a.is-active::after { transform: scaleX(1); }
@media (max-width: 960px) { .nav-links { display: none; } }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 0.6em;
  padding: 0.95em 1.55em; border-radius: 999px; border: 1px solid transparent;
  background: var(--pink); color: #fff;
  font-weight: 600; font-size: 0.95rem; letter-spacing: 0.005em; line-height: 1;
  cursor: pointer; white-space: nowrap;
  transition: transform 0.35s var(--ease-out), box-shadow 0.35s var(--ease-out), background 0.3s, border-color 0.3s;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 14px 40px -12px rgba(240, 40, 122, 0.75); }
.btn:active { transform: translateY(0); }
.btn--ghost { background: rgba(255, 255, 255, 0.05); border-color: rgba(255, 255, 255, 0.16); color: var(--text); }
.btn--ghost:hover { background: rgba(255, 255, 255, 0.1); box-shadow: none; }
.btn--sm { padding: 0.7em 1.15em; font-size: 0.85rem; }
.btn .arrow { transition: transform 0.35s var(--ease-out); }
.btn:hover .arrow { transform: translateX(4px); }

/* ---------- Sections ---------- */
.section {
  position: relative;
  min-height: 100vh;
  display: grid; align-items: center;
  padding: calc(var(--nav-h) + 6vh) var(--gutter) 12vh;
}
.section-inner { width: min(100%, var(--content-w)); margin-inline: auto; }
.section-inner--narrow { width: min(100%, var(--narrow-w)); }
.section--tall { min-height: 130vh; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-mono); font-size: 0.74rem; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--rose);
  margin-bottom: clamp(16px, 2.4vh, 28px);
}
.eyebrow::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--pink); box-shadow: 0 0 14px var(--pink); }

.h1 {
  font-family: var(--font-display);
  font-size: clamp(2.7rem, 7.4vw, 6.6rem);
  line-height: 0.98; letter-spacing: -0.025em;
  text-wrap: balance;
}
.h2 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4.8vw, 4rem);
  line-height: 1.02; letter-spacing: -0.02em;
  text-wrap: balance;
}
.h3 { font-family: var(--font-display); font-size: clamp(1.25rem, 1.8vw, 1.6rem); line-height: 1.15; letter-spacing: -0.01em; }
.lead {
  font-size: clamp(1.05rem, 1.35vw, 1.3rem); line-height: 1.55;
  color: var(--muted); max-width: 58ch;
  margin-top: clamp(18px, 2.6vh, 30px);
}
.lead strong, .lead b { color: var(--text); font-weight: 600; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: clamp(26px, 4vh, 44px); }

.text-shadow { text-shadow: 0 2px 30px rgba(6, 4, 12, 0.8), 0 0 2px rgba(6, 4, 12, 0.9); }

/* Cartes verre */
.card {
  position: relative;
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(22px, 2.6vw, 34px);
  backdrop-filter: blur(16px) saturate(1.1);
  -webkit-backdrop-filter: blur(16px) saturate(1.1);
  transition: border-color 0.4s, transform 0.5s var(--ease-out), box-shadow 0.5s var(--ease-out);
}
.card:hover { border-color: rgba(240, 40, 122, 0.45); transform: translateY(-4px); box-shadow: 0 30px 60px -30px rgba(240, 40, 122, 0.35); }
.card h3 { margin-bottom: 10px; }
.card p { color: var(--muted); font-size: 0.97rem; line-height: 1.55; }
.card .icon { width: 42px; height: 42px; margin-bottom: 18px; color: var(--rose); }
.card .icon svg { width: 100%; height: 100%; }

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(14px, 1.8vw, 24px); }
@media (max-width: 760px) { .grid-2 { grid-template-columns: 1fr; } }

/* Listes à puces "molécule" */
.dots-list li {
  position: relative; padding-left: 30px; margin-bottom: 14px;
  font-size: clamp(1rem, 1.25vw, 1.15rem); line-height: 1.45;
}
.dots-list li::before {
  content: ''; position: absolute; left: 0; top: 0.5em; width: 12px; height: 12px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, var(--rose), var(--pink) 60%, var(--plum));
  box-shadow: 0 0 16px rgba(240, 40, 122, 0.6);
}
.dots-list li span { display: block; color: var(--muted); font-size: 0.9em; margin-top: 3px; }

/* Promesse sur les données, dans le héros : croix suisse + trois engagements en une ligne */
.swiss {
  display: inline-flex; align-items: center; flex-wrap: wrap; gap: 10px;
  margin-top: clamp(16px, 2.4vh, 24px); padding: 9px 16px 9px 12px; border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.26); background: rgba(6, 4, 12, 0.55);
  font-size: 0.9rem; font-weight: 600; line-height: 1.3; color: var(--text);
}
.swiss .ch { width: 18px; height: 18px; flex: none; }
.guarantees strong .ch { display: inline-block; width: 15px; height: 15px; margin-right: 8px; vertical-align: -2px; }

/* Engagements sur les données : quatre promesses, deux par ligne */
.guarantees-title { margin-top: clamp(26px, 4vh, 42px); font-family: var(--font-display); font-size: clamp(1.15rem, 1.6vw, 1.45rem); font-weight: 600; line-height: 1.2; color: var(--text); }
.guarantees { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(18px, 2.4vw, 30px) clamp(18px, 3vw, 44px); margin-top: clamp(14px, 2vh, 22px); }
.guarantees li { position: relative; padding-top: 16px; border-top: 1px solid rgba(255, 255, 255, 0.2); }
.guarantees li::before { content: ''; position: absolute; left: 0; top: -1px; width: 34px; height: 2px; background: var(--stage, var(--pink)); box-shadow: 0 0 12px var(--stage, var(--pink)); }
.guarantees strong { display: block; margin-bottom: 6px; font-family: var(--font-display); font-size: 1.05rem; font-weight: 600; line-height: 1.25; color: var(--text); }
.guarantees span { display: block; font-size: 0.92rem; line-height: 1.5; color: var(--muted); }
@media (max-width: 760px) { .guarantees { grid-template-columns: 1fr; gap: 14px; } }
.panel .guarantees-title { margin-top: 14px; font-size: 1rem; }
.panel .guarantees { grid-template-columns: 1fr; gap: 8px; margin-top: 10px; }
.panel .guarantees li { padding-top: 8px; }
.panel .guarantees strong { display: inline; margin: 0 6px 0 0; font-size: 0.9rem; }
.panel .guarantees span { display: inline; font-size: 0.84rem; }

/* Étapes numérotées (séquence réelle) */
.steps { display: grid; gap: clamp(10px, 1.4vh, 18px); margin-top: clamp(28px, 4vh, 44px); }
.step {
  display: grid; grid-template-columns: 64px 1fr auto; gap: 18px; align-items: baseline;
  padding: clamp(18px, 2.2vh, 26px) 0; border-top: 1px solid var(--line);
}
.step:last-child { border-bottom: 1px solid var(--line); }
.step .num { font-family: var(--font-mono); font-size: 0.85rem; color: var(--rose); letter-spacing: 0.1em; }
.step .title { font-family: var(--font-display); font-size: clamp(1.3rem, 2.2vw, 1.9rem); letter-spacing: -0.01em; }
.step .desc { grid-column: 2; color: var(--muted); max-width: 52ch; margin-top: 6px; }
.step .when { font-family: var(--font-mono); font-size: 0.78rem; color: var(--muted); letter-spacing: 0.08em; text-transform: uppercase; white-space: nowrap; }
@media (max-width: 640px) {
  .step { grid-template-columns: 44px 1fr; }
  .step .when { grid-column: 2; }
}

/* ---------- Révélations au défilement ---------- */
[data-reveal] {
  opacity: 0; transform: translateY(26px);
  transition: opacity 0.9s var(--ease-out), transform 0.9s var(--ease-out);
}
[data-reveal].is-in { opacity: 1; transform: none; }
[data-reveal][data-delay='1'] { transition-delay: 0.1s; }
[data-reveal][data-delay='2'] { transition-delay: 0.2s; }
[data-reveal][data-delay='3'] { transition-delay: 0.3s; }
[data-reveal][data-delay='4'] { transition-delay: 0.4s; }
[data-reveal][data-delay='5'] { transition-delay: 0.5s; }

/* Entrée du héros (après le préchargeur) */
[data-intro] { opacity: 0; transform: translateY(34px); transition: opacity 1.1s var(--ease-out), transform 1.1s var(--ease-out); }
.is-ready [data-intro] { opacity: 1; transform: none; }
.is-ready [data-intro][data-delay='1'] { transition-delay: 0.15s; }
.is-ready [data-intro][data-delay='2'] { transition-delay: 0.3s; }
.is-ready [data-intro][data-delay='3'] { transition-delay: 0.45s; }
.is-ready [data-intro][data-delay='4'] { transition-delay: 0.6s; }

/* Indice de défilement */
.scroll-hint {
  position: absolute; left: 50%; bottom: 28px; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.24em; text-transform: uppercase; color: var(--muted);
}
.scroll-hint::after {
  content: ''; width: 1px; height: 54px;
  background: linear-gradient(to bottom, var(--pink), transparent);
  animation: hint-line 2.2s var(--ease-out) infinite;
  transform-origin: top;
}
@keyframes hint-line { 0% { transform: scaleY(0); opacity: 0; } 30% { opacity: 1; } 100% { transform: scaleY(1); opacity: 0; } }

/* ---------- Préchargeur ---------- */
#preloader {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center; place-content: center; gap: 22px;
  background: var(--bg);
  transition: opacity 0.9s var(--ease-out), visibility 0.9s;
}
#preloader.is-done { opacity: 0; visibility: hidden; pointer-events: none; }
#preloader svg { width: clamp(72px, 10vw, 110px); height: auto; }
#preloader svg circle, #preloader svg path { transform-box: fill-box; transform-origin: center; animation: pre-pulse 1.5s ease-in-out infinite; animation-delay: calc(var(--i, 0) * 0.11s); }
@keyframes pre-pulse { 0%, 100% { transform: scale(0.82); opacity: 0.55; } 50% { transform: scale(1); opacity: 1; } }
#preloader .pre-label {
  font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.26em; text-transform: uppercase; color: var(--muted);
  display: flex; align-items: center; gap: 14px;
}
/* écran étroit : le pourcentage et la barre sur une ligne, la phrase centrée dessous */
@media (max-width: 560px) {
  #preloader .pre-label:not(.pre-label--notice) { flex-wrap: wrap; justify-content: center; row-gap: 12px; padding: 0 20px; }
  #preloader .pre-label:not(.pre-label--notice) > span:last-child { flex-basis: 100%; text-align: center; text-wrap: balance; line-height: 1.8; letter-spacing: 0.12em; }
}
#preloader .pre-label--notice {
  display: block; max-width: 46ch; padding: 0 24px; text-align: center;
  font-family: var(--font-body); font-size: 0.95rem; line-height: 1.55; letter-spacing: 0; text-transform: none; color: var(--text);
}
#preloader .pre-label--notice code { font-family: var(--font-mono); font-size: 0.9em; color: var(--rose); }
#preloader .pre-label--notice a, #preloader .pre-label--notice button {
  color: var(--rose); background: none; border: 0; padding: 0; font: inherit; text-decoration: underline; cursor: pointer;
}
#preloader .pre-bar { width: 140px; height: 1px; background: rgba(255, 255, 255, 0.1); position: relative; overflow: hidden; }
#preloader .pre-bar::after {
  content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, var(--green), var(--blue), var(--violet), var(--pink));
  transform: scaleX(var(--p, 0)); transform-origin: left; transition: transform 0.3s var(--ease-out);
}

/* ---------- Pied de page ---------- */
.footer {
  position: relative; z-index: 1;
  padding: 48px var(--gutter) 40px;
  border-top: 1px solid var(--line);
  background: linear-gradient(to bottom, rgba(6, 4, 12, 0.2), rgba(6, 4, 12, 0.9));
  display: flex; flex-wrap: wrap; gap: 20px 40px; align-items: center; justify-content: space-between;
  font-size: 0.85rem; color: var(--muted);
}
.footer .tag { font-family: var(--font-mono); letter-spacing: 0.18em; text-transform: uppercase; font-size: 0.68rem; }
.footer nav { display: flex; gap: 22px; }
.footer nav a:hover { color: var(--text); }

/* Badge prototype : retour aux 4 directions (à retirer en production) */
.proto-badge {
  position: fixed; left: 16px; bottom: 16px; z-index: 30;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 12px; border-radius: 999px;
  background: rgba(13, 8, 24, 0.7); border: 1px solid var(--line); backdrop-filter: blur(10px);
  font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted);
  transition: color 0.3s, border-color 0.3s;
}
.proto-badge:hover { color: var(--text); border-color: rgba(240, 40, 122, 0.5); }
.proto-badge b { color: var(--rose); font-weight: 600; }

/* ---------- Mouvement réduit ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  [data-reveal], [data-intro] { opacity: 1; transform: none; }
}
