/* RIO — refonte du site public, posée PAR-DESSUS styles.css (chargée juste après).
   Elle n'emploie que les variables de la charte (--bg, --surface, --line, --ink, --t1…t4, --rio,
   --fail…) : le thème clair et le thème sombre suivent sans règle de plus. */

/* ---------- Lisibilité : une police, un corps plus grand, des gris plus clairs ---------- */
body {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 14.5px;
  color: var(--t1);
}
p { max-width: 70ch; }
h2 { font-size: clamp(22px, 2.3vw, 29px); }
h3 { font-size: 15.5px; }
.card p { font-size: 13px; color: var(--t2); }
.section-intro { font-size: 14.5px; color: var(--t2); }
.kicker { color: var(--rio); letter-spacing: .14em; }
.small { font-size: 12.5px; }
.btn { font-size: 13.25px; min-height: 42px; }
@media (max-width: 760px) { .btn { min-height: 48px; } }

/* ---------- Héros ---------- */
.hero-copy { font-size: 15px; color: var(--t2); }
.hero-reassure { display: flex; gap: 8px; align-items: center; margin: 16px 0 0; font-size: 12.25px; color: var(--t3); }
.hero-reassure svg { width: 16px; height: 16px; flex: none; fill: none; stroke: var(--rio); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Bande de confiance ---------- */
.trust-strip { border-top: 1px solid var(--line-soft); padding: 24px 0; background: var(--bg); }
.trust-strip ul { list-style: none; margin: 0 auto; display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }
.trust-strip li { display: flex; gap: 12px; align-items: flex-start; font-size: 12.5px; line-height: 1.45; color: var(--t2); }
.trust-strip svg { width: 20px; height: 20px; flex: none; margin-top: 1px; fill: none; stroke: var(--rio); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
@media (max-width: 900px) { .trust-strip ul { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .trust-strip ul { grid-template-columns: 1fr; } }

/* ---------- Le constat ---------- */
.pain-card { position: relative; padding: 28px; }
.pain-n { position: absolute; top: 22px; right: 24px; font-size: 12px; font-weight: 700; letter-spacing: .1em; color: var(--t4); }
.pain-icon { width: 42px; height: 42px; border-radius: 10px; display: grid; place-items: center; margin-bottom: 6px;
  color: var(--fail); background: color-mix(in srgb, var(--fail) 14%, transparent); }
.pain-icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.pain-card h3 { margin: 0; }
.pain-card p { margin: 0; }
.pain-answer { margin-top: 20px; display: flex; gap: 14px; align-items: flex-start; padding: 20px 24px; border-radius: var(--r);
  border: 1px solid color-mix(in srgb, var(--rio) 40%, var(--line));
  background: color-mix(in srgb, var(--rio) 8%, var(--surface)); }
.pain-answer svg { width: 22px; height: 22px; flex: none; margin-top: 3px; fill: none; stroke: var(--rio); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.pain-answer p { margin: 0; font-size: 14.5px; color: var(--ink); max-width: none; }
.pain-answer b { color: var(--rio); font-weight: 600; }

/* ---------- Une seule mention « illustratif » ---------- */
.story-note { font-size: 13px; color: var(--t4); margin-top: 10px; }

/* ---------- Aperçu des tarifs ---------- */
.plan-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
@media (max-width: 1000px) { .plan-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .plan-grid { grid-template-columns: 1fr; } }
.plan-card { display: flex; flex-direction: column; gap: 10px; padding: 24px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); }
.plan-card.featured { border-color: var(--rio); box-shadow: inset 0 0 0 1px var(--rio); }
.plan-card h3 { margin: 0; font-size: 15px; }
.plan-card > p { margin: 0; font-size: 12.5px; color: var(--t3); min-height: 3em; }
.plan-price { margin-top: 4px; font-size: 22px; font-weight: 700; letter-spacing: -.02em; color: var(--ink); }
.plan-price small { font-size: 12.5px; font-weight: 500; letter-spacing: 0; color: var(--t3); }
.plan-card ul { list-style: none; margin: 6px 0 10px; padding: 0; display: grid; gap: 8px; font-size: 12.5px; color: var(--t2); }
.plan-card li { display: flex; gap: 8px; align-items: flex-start; }
.plan-card li svg { width: 16px; height: 16px; flex: none; margin-top: 4px; fill: none; stroke: var(--rio); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.plan-card .btn { margin-top: auto; justify-content: center; }
.plan-note { margin: 0 0 28px; font-size: 12.5px; color: var(--t3); }

/* ---------- Section finale : un bandeau plein, centré, avec halo ---------- */
.cta-final2 { border-top: 0; padding-top: clamp(40px, 6vw, 72px); }
.cta2 { position: relative; overflow: hidden; isolation: isolate; text-align: center;
  padding: clamp(48px, 7vw, 88px) clamp(20px, 5vw, 64px); border-radius: 18px;
  border: 1px solid color-mix(in srgb, var(--rio) 35%, var(--line));
  background:
    linear-gradient(var(--line-soft) 1px, transparent 1px) 0 0 / 100% 44px,
    linear-gradient(90deg, var(--line-soft) 1px, transparent 1px) 0 0 / 44px 100%,
    var(--surface-2); }
.cta2::after { content: ""; position: absolute; inset: 0; z-index: -1;
  background: radial-gradient(ellipse at center, transparent 30%, var(--surface-2) 75%); }
.cta2-glow { position: absolute; z-index: -1; left: 50%; top: 0; width: min(720px, 90%); height: 70%;
  transform: translate(-50%, -45%); border-radius: 50%; filter: blur(60px);
  background: color-mix(in srgb, var(--rio) 32%, transparent); }
.cta2 h2 { margin: 0 auto; max-width: 20ch; font-size: clamp(23px, 2.8vw, 33px); letter-spacing: -.03em; }
.cta2 p { margin: 16px auto 0; max-width: 56ch; color: var(--t2); font-size: 14.5px; }
.cta2 .actions { justify-content: center; margin-top: 28px; }

/* ---------- Pied de page : la signature en tête, le logo en grand en bas ---------- */
footer { position: relative; overflow: hidden; padding-bottom: 0;
  background: linear-gradient(180deg, var(--bg), var(--surface-2)); }
footer::before { content: ""; position: absolute; top: 0; left: 50%; width: min(900px, 90%); height: 1px;
  transform: translateX(-50%); background: linear-gradient(90deg, transparent, var(--rio), transparent); opacity: .7; }
.footer-cols { gap: 40px; }
.footer-brand p { font-size: 12.5px; }
.footer-col h4 { color: var(--rio); }
.footer-col a { font-size: 12.75px; color: var(--t2); transition: color .15s, transform .15s; }
.footer-col a:hover { color: var(--ink); transform: translateX(3px); }
.footer-bottom { font-size: 12px; }
.footer-mark { margin-top: 28px; line-height: 0; color: var(--ink); opacity: .07; pointer-events: none; user-select: none;
  -webkit-mask-image: linear-gradient(180deg, #000 30%, transparent 95%); mask-image: linear-gradient(180deg, #000 30%, transparent 95%); }
.footer-mark svg { width: 100%; height: auto; max-height: 260px; display: block; }
@media (max-width: 760px) { .footer-mark { margin-top: 20px; } }

/* ---------- En-tête : menus déroulants riches (icône + une ligne d'explication) ----------
   La barre reste la pilule blanche de la charte ; les panneaux suivent sa palette claire. */
.nav-login { font-size: 13px; color: #2B2E31; white-space: nowrap; }
.nav-login:hover { color: #050505; }
.nav-dropdown a.mega-item { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border-radius: 12px;
  white-space: normal; color: #050505; transition: background .15s; }
.nav-dropdown a.mega-item:hover { background: #F2F5F4; }
.mega-ico { width: 28px; height: 28px; flex: none; border-radius: 9px; display: grid; place-items: center; background: #E6F5F1; color: #0F7A66; }
.mega-ico svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.mega-txt b { display: block; font-size: 13px; font-weight: 600; color: #050505; }
.mega-txt small { display: block; margin-top: 1px; font-size: 11.5px; line-height: 1.4; color: #5c5c5c; }
.mega-kicker { display: block; padding: 6px 10px 6px; font-size: 10px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: #0F7A66; }
.mega-list { display: grid; align-content: start; gap: 0; min-width: 270px; }
.nav-dropdown a.mega-feature { display: flex; flex-direction: column; gap: 6px; width: 220px; padding: 16px; border-radius: 14px;
  white-space: normal; background: #050505; color: #fff; }
.mega-feature .mega-kicker { padding: 0; color: #2ec4a6; }
.mega-feature span:not(.mega-kicker) { font-size: 12px; line-height: 1.5; color: #c3c3c3; }
.mega-feature em { margin-top: auto; font-style: normal; font-size: 12px; font-weight: 600; color: #2ec4a6; }
.mega-side { width: 240px; padding: 4px 4px 8px 14px; border-left: 1px solid #ECECEC; }
.mega-side .mega-kicker { padding-left: 0; }
.mega-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.nav-dropdown .mega-chips a { display: inline-block; padding: 5px 9px; border: 1px solid #E2E2E2; border-radius: 999px;
  font-size: 11.5px; color: #2B2E31; white-space: nowrap; }
.nav-dropdown .mega-chips a:hover { border-color: #0F7A66; color: #0F7A66; }
.nav-dropdown a.mega-more { display: inline-block; margin-top: 10px; padding: 0; font-size: 12px; font-weight: 600; color: #0F7A66; }

@media (min-width: 1181px) {
  .nav-dropdown.mega { display: flex; gap: 10px; width: max-content; max-width: min(760px, 92vw); min-width: 0;
    padding: 12px; border-radius: 18px; border-color: #E6E6E6; box-shadow: 0 18px 50px rgba(5,5,5,.16);
    left: -16px; animation: mega-in .18s ease-out; }
  @keyframes mega-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
}
@media (max-width: 1180px) {
  .nav-dropdown.mega { display: block; padding: 4px 0 10px; }
  .mega-list { min-width: 0; }
  .nav-dropdown a.mega-item { padding: 8px 0; border-bottom: 0; }
  .mega-ico { width: 26px; height: 26px; }
  .nav-dropdown a.mega-feature { display: none; }
  .mega-side { width: auto; border-left: 0; padding: 6px 0 0; }
  .mega-kicker { padding-left: 0; }
  .nav-login { display: block; padding: 12px 0; border-bottom: 1px solid #ECECEC; }
}
@media (prefers-reduced-motion: reduce) { .nav-dropdown.mega { animation: none; } }

/* Barre de navigation : un cran plus petit que l'origine (14,1 px). */
.nav-links, .nav-links a, .nav-group summary { font-size: 13px; }
.btn-cta { font-size: 13px; }
/* Produit : la carte « Fonctionnement » se place sous « Utiliser RIO », dans la même colonne. */
.mega-list > a.mega-feature { width: auto; margin-top: 10px; }

/* ---------- Bandeaux finaux des pages intérieures : même famille que la section finale ---------- */
.cta-band { position: relative; overflow: hidden; isolation: isolate; border-radius: 18px;
  border-color: color-mix(in srgb, var(--rio) 35%, var(--line));
  background: radial-gradient(ellipse 60% 120% at 0% 0%, color-mix(in srgb, var(--rio) 16%, transparent), transparent 60%), var(--surface-2); }
.cta-band .btn:first-child { background: var(--ink); color: var(--invert); border-color: var(--ink); }

/* ---------- Ancres par métier : la carte visée se signale ---------- */
.expertise-card { scroll-margin-top: 120px; }
.expertise-card:target { border-color: var(--rio); box-shadow: 0 0 0 1px var(--rio), 0 12px 40px -18px var(--rio); animation: carte-visee 1.6s ease-out 1; }
@keyframes carte-visee { 0% { transform: scale(1.015); } 100% { transform: none; } }

/* ---------- Barre d'action mobile ---------- */
.mobile-cta { display: none; }
@media (max-width: 760px) {
  .mobile-cta { display: flex; gap: 8px; position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 60;
    padding: 8px; border-radius: 16px; background: color-mix(in srgb, var(--bg) 82%, transparent);
    -webkit-backdrop-filter: blur(14px) saturate(160%); backdrop-filter: blur(14px) saturate(160%);
    border: 1px solid var(--line); box-shadow: 0 12px 34px rgba(0,0,0,.35);
    transform: translateY(140%); opacity: 0; pointer-events: none; transition: transform .28s cubic-bezier(.2,.7,.3,1), opacity .2s; }
  .mobile-cta.on { transform: none; opacity: 1; pointer-events: auto; }
  .mobile-cta .btn { flex: 1; justify-content: center; min-height: 46px; }
  .mobile-cta .btn-primary { flex: 1.6; }
  body.menu-open .mobile-cta { display: none; }
}

/* ---------- Fonctionnement : les sources émettent, puis les cinq moteurs s'allument un à un ----------
   Même cycle de 9 s que l'animation d'origine (rio-flux) : rien ne se désynchronise. */
.stages.actif .src { animation: rio-emet 9s ease-out infinite; }
.stages.actif .src > i { animation: rio-emet-pt 9s ease-out infinite; }
.stages.actif .src:nth-child(2), .stages.actif .src:nth-child(2) > i { animation-delay: .06s; }
.stages.actif .src:nth-child(3), .stages.actif .src:nth-child(3) > i { animation-delay: .12s; }
.stages.actif .src:nth-child(4), .stages.actif .src:nth-child(4) > i { animation-delay: .18s; }
.stages.actif .src:nth-child(5), .stages.actif .src:nth-child(5) > i { animation-delay: .24s; }
.stages.actif .src:nth-child(6), .stages.actif .src:nth-child(6) > i { animation-delay: .30s; }
.stages.actif .src:nth-child(7), .stages.actif .src:nth-child(7) > i { animation-delay: .36s; }
.stages.actif .src:nth-child(8), .stages.actif .src:nth-child(8) > i { animation-delay: .42s; }
.stages.actif .src:nth-child(9), .stages.actif .src:nth-child(9) > i { animation-delay: .48s; }
.stages.actif .src:nth-child(10), .stages.actif .src:nth-child(10) > i { animation-delay: .54s; }
.stages.actif .src:nth-child(11), .stages.actif .src:nth-child(11) > i { animation-delay: .60s; }
.stages.actif .src:nth-child(12), .stages.actif .src:nth-child(12) > i { animation-delay: .66s; }
.stages.actif .src:nth-child(13), .stages.actif .src:nth-child(13) > i { animation-delay: .72s; }
@keyframes rio-emet {
  0% { border-color: var(--line-soft); color: var(--t2); }
  3% { border-color: color-mix(in srgb, var(--rio) 60%, var(--line)); color: var(--ink); }
  10%, 100% { border-color: var(--line-soft); color: var(--t2); } }
@keyframes rio-emet-pt {
  0% { transform: scale(1); box-shadow: none; }
  3% { transform: scale(1.6); box-shadow: 0 0 0 4px color-mix(in srgb, var(--rio) 25%, transparent); }
  10%, 100% { transform: scale(1); box-shadow: none; } }

.stages.actif .outs .out-card { animation: rio-moteur 9s ease-out infinite; }
.stages.actif .outs .out-card:nth-child(2) { animation-delay: .32s; }
.stages.actif .outs .out-card:nth-child(3) { animation-delay: .64s; }
.stages.actif .outs .out-card:nth-child(4) { animation-delay: .96s; }
.stages.actif .outs .out-card:nth-child(5) { animation-delay: 1.28s; }
@keyframes rio-moteur {
  0%, 79% { box-shadow: 0 0 0 0 transparent; background: var(--bg); transform: none; }
  81% { box-shadow: 0 0 0 1px var(--accent), -6px 0 22px -8px var(--accent); background: var(--surface-2); transform: translateX(3px); }
  90% { box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 45%, transparent); background: var(--surface-2); transform: none; }
  97%, 100% { box-shadow: 0 0 0 0 transparent; background: var(--bg); transform: none; } }

/* ---------- En-tête compact au défilement (ordinateur) ---------- */
@media (min-width: 1181px) {
  .site-header.compact { position: fixed; top: 10px; animation: entete-revient .3s cubic-bezier(.2,.7,.3,1); }
  .site-header.compact .pill { padding-top: 6px; padding-bottom: 6px; background: rgba(255,255,255,.9);
    -webkit-backdrop-filter: blur(14px) saturate(170%); backdrop-filter: blur(14px) saturate(170%);
    box-shadow: 0 10px 34px rgba(5,5,5,.22); }
  .site-header.compact .btn-cta { min-height: 36px; padding-top: 8px; padding-bottom: 8px; }
  @keyframes entete-revient { from { transform: translateY(-120%); } to { transform: none; } }
}

/* ---------- Visite guidée de la chaîne ---------- */
.lineage-walk { display: inline-flex; align-items: center; gap: 8px; margin: 4px 0 14px; padding: 8px 14px; min-height: 38px;
  border-radius: 999px; border: 1px solid color-mix(in srgb, var(--rio) 50%, var(--line)); background: transparent;
  color: var(--rio); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.lineage-walk::after { content: "↓"; }
.lineage-walk:hover { background: color-mix(in srgb, var(--rio) 10%, transparent); }
.lineage-walk:disabled { opacity: .55; cursor: default; }
.node.walk-on { box-shadow: 0 0 0 1px var(--rio), 0 8px 24px -10px var(--rio); }

/* ---------- Accessibilité : contraste du gris le plus pâle en thème sombre ----------
   #6e6e6e donnait 3,6 à 3,7:1 sur les cartes ; #8f8f8f passe 4,5:1 sur #050505, #0d0d0d et #141414.
   Le thème clair garde sa valeur (5,1:1 sur blanc). */
:root:not([data-theme="light"]) { --t4: #8f8f8f; }
.site-header.compact .pill { background: rgba(255,255,255,.96); }
