/* =================================================================
   EL BARISTOCRATE — Système de design « L'Ascension »
   CSS moderne 2026 : @layer · OKLCH/color-mix · container queries
   · :has() · scroll-driven animations. Mobile-first.
   ================================================================= */

@layer reset, tokens, base, layout, components, utilities;

/* ---------------------------------------------------------------- */
@layer reset {
  *, *::before, *::after { box-sizing: border-box; }
  * { margin: 0; }
  html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
  body { min-height: 100svh; line-height: var(--leading-body); -webkit-font-smoothing: antialiased; }
  img, picture, video, canvas, svg { display: block; max-width: 100%; height: auto; }
  input, button, textarea, select { font: inherit; color: inherit; }
  p, h1, h2, h3, h4, h5, h6 { overflow-wrap: break-word; }
  ul[role="list"], ol[role="list"] { list-style: none; padding: 0; }
  :where(a) { color: inherit; }
}

/* ---------------------------------------------------------------- */
@layer tokens {
  :root {
    color-scheme: light;

    /* — Couleur (marque extraite du logo + site live) — */
    --brand:        #0c5cc5;                                   /* bleu royal */
    --brand-strong: oklch(from var(--brand) calc(l - 0.10) c h);
    --brand-soft:   color-mix(in oklch, var(--brand) 12%, transparent);
    --brand-tint:   color-mix(in oklch, var(--brand) 7%, white);
    --accent:       #30a8d8;                                   /* cyan « circuit » */
    --accent-strong:oklch(from var(--accent) calc(l - 0.08) c h);

    --ink:          #12161d;                                   /* cage d'ascenseur */
    --ink-2:        oklch(from var(--ink) calc(l + 0.05) c h);
    --ink-3:        oklch(from var(--ink) calc(l + 0.11) c h);

    --paper:        #ffffff;
    --surface:      #f5f8fc;
    --surface-2:    #eaf1f9;

    --text:         #2b2e34;                                   /* titres */
    --text-body:    #3a3f45;                                   /* corps  */
    --text-muted:   color-mix(in oklch, var(--text) 74%, white); /* ≥ 4.5:1 sur blanc ET sur --surface (WCAG AA) */
    --line:         color-mix(in oklch, var(--ink) 13%, transparent);
    --line-soft:    color-mix(in oklch, var(--ink) 7%, transparent);

    --on-dark:      #eef3fa;
    --on-dark-muted:color-mix(in oklch, var(--on-dark) 64%, var(--ink));
    --on-dark-line: color-mix(in oklch, var(--on-dark) 16%, transparent);

    --ok:           #1f9d57;
    --warn:         #d98a1f;
    --err:          #cc3a3a;

    /* — Typographie fluide (ratio ~1.25) — */
    --font-display: "Josefin Sans", ui-sans-serif, system-ui, sans-serif;
    --font-body:    system-ui, -apple-system, "Segoe UI", Roboto, "Open Sans", Helvetica, Arial, sans-serif;
    --step--1: clamp(0.83rem, 0.79rem + 0.18vw, 0.94rem);
    --step-0:  clamp(1.00rem, 0.95rem + 0.26vw, 1.13rem);
    --step-1:  clamp(1.25rem, 1.15rem + 0.50vw, 1.56rem);
    --step-2:  clamp(1.56rem, 1.38rem + 0.90vw, 2.20rem);
    --step-3:  clamp(1.95rem, 1.62rem + 1.65vw, 3.05rem);
    --step-4:  clamp(2.44rem, 1.85rem + 2.95vw, 4.40rem);
    --leading-tight: 1.08;
    --leading-body:  1.62;
    --tracking-display: -0.02em;
    --tracking-eyebrow: 0.22em;

    /* — Rythme d'espacement — */
    --space-3xs: .25rem; --space-2xs: .5rem; --space-xs: .75rem;
    --space-s: 1rem; --space-m: 1.5rem; --space-l: 2.5rem;
    --space-xl: 4rem; --space-2xl: 6.5rem; --space-3xl: 9.5rem;

    /* — Mouvement — */
    --ease-out:   cubic-bezier(0.22, 1, 0.36, 1);
    --ease-inout: cubic-bezier(0.65, 0, 0.35, 1);
    --ease-rev:   cubic-bezier(0.16, 1, 0.3, 1);  /* décélération "premium" pour les révélations */
    --dur-fast: 180ms; --dur-base: 320ms; --dur-slow: 640ms; --dur-rev: 1000ms;

    /* — Formes & élévation — */
    --radius: 14px; --radius-lg: 22px; --radius-pill: 999px;
    --shadow-1: 0 1px 2px oklch(0 0 0 / .06), 0 6px 18px oklch(0 0 0 / .07);
    --shadow-2: 0 10px 40px oklch(0 0 0 / .12);
    --shadow-brand: 0 12px 30px color-mix(in oklch, var(--brand) 32%, transparent);

    /* — Grille — */
    --measure: 66ch;
    --container: 1200px;
    --container-wide: 1360px;
    --gutter: clamp(1.1rem, 5vw, 3rem);
    --header-h: 76px;
  }

  @media (prefers-reduced-motion: reduce) {
    :root { --dur-fast: 0ms; --dur-base: 0ms; --dur-slow: 0ms; }
    html { scroll-behavior: auto; }
  }
  @media (prefers-reduced-motion: no-preference) {
    html { scroll-behavior: smooth; }
  }
}

/* ---------------------------------------------------------------- */
@layer base {
  body {
    font-family: var(--font-body);
    font-size: var(--step-0);
    color: var(--text-body);
    background: var(--paper);
    text-rendering: optimizeLegibility;
  }

  h1, h2, h3, h4 {
    font-family: var(--font-display);
    color: var(--text);
    line-height: var(--leading-tight);
    letter-spacing: var(--tracking-display);
    font-weight: 600;
    text-wrap: balance;
  }
  h1 { font-size: var(--step-4); }
  h2 { font-size: var(--step-3); }
  h3 { font-size: var(--step-2); }
  h4 { font-size: var(--step-1); }
  p  { text-wrap: pretty; max-width: var(--measure); }

  a { color: var(--brand); text-decoration-thickness: 1px; text-underline-offset: 3px; transition: color var(--dur-fast) var(--ease-out); }
  a:hover { color: var(--brand-strong); }

  ::selection { background: var(--brand); color: #fff; }

  :where(a, button, input, textarea, select, summary, [tabindex]):focus-visible {
    outline: 3px solid var(--brand);   /* #0c5cc5 = 6.26:1 sur blanc (WCAG 2.2 SC 1.4.11) */
    outline-offset: 2px;
    border-radius: 4px;
  }
  /* Sur fonds sombres, le cyan offre un meilleur contraste que le bleu */
  :where(.section--dark, .hero, .page-hero, .site-footer) :where(a, button, input, textarea, select, summary, [tabindex]):focus-visible {
    outline-color: var(--accent);
  }

  strong, b { font-weight: 600; color: var(--text); }
  hr { border: 0; border-top: 1px solid var(--line); margin: var(--space-l) 0; }

  /* Lien d'évitement (a11y) */
  .skip-link {
    position: absolute; left: -9999px; top: 0; z-index: 2000;
    background: var(--ink); color: #fff; padding: .8rem 1.2rem; border-radius: 0 0 var(--radius) 0;
  }
  .skip-link:focus { left: 0; color: #fff; }
}

/* ---------------------------------------------------------------- */
@layer layout {
  .container { width: min(100% - (var(--gutter) * 2), var(--container)); margin-inline: auto; }
  .container-wide { width: min(100% - (var(--gutter) * 2), var(--container-wide)); margin-inline: auto; }

  .section { padding-block: clamp(3.5rem, 8vw, var(--space-3xl)); position: relative; }
  .section--tight { padding-block: clamp(2.5rem, 6vw, var(--space-2xl)); }
  .section--dark { background: var(--ink); color: var(--on-dark); }
  .section--dark :is(h1,h2,h3,h4) { color: #fff; }
  .section--dark p { color: var(--on-dark-muted); }
  .section--surface { background: var(--surface); }

  .stack > * + * { margin-block-start: var(--flow, 1em); }
  .grid { display: grid; gap: var(--grid-gap, var(--space-m)); }

  main { display: block; }
}

/* ---------------------------------------------------------------- */
@layer components {

  /* ---- En-tête / navigation ---- */
  .site-header {
    position: sticky; top: 0; z-index: 100;
    background: color-mix(in oklch, var(--paper) 86%, transparent);
    -webkit-backdrop-filter: saturate(160%) blur(14px);
    backdrop-filter: saturate(160%) blur(14px);
    border-bottom: 1px solid transparent;
    transition: border-color var(--dur-base) var(--ease-out), background var(--dur-base) var(--ease-out);
  }
  .site-header[data-scrolled="true"] { border-bottom-color: var(--line-soft); box-shadow: 0 6px 24px oklch(0 0 0 / .05); }
  .header-inner { display: flex; align-items: center; gap: var(--space-m); min-height: var(--header-h); }
  .brand { display: inline-flex; align-items: center; gap: .6rem; flex: 0 0 auto; }
  .brand img { width: auto; height: 46px; }
  .brand__wordmark { font-family: var(--font-display); font-weight: 700; letter-spacing: .04em; color: var(--text); font-size: 1.1rem; }

  .primary-nav { margin-inline-start: auto; }
  .primary-nav ul { display: flex; align-items: center; gap: clamp(.5rem, 1.6vw, 1.6rem); list-style: none; padding: 0; margin: 0; }
  .primary-nav a { display: inline-block; padding: .55rem .25rem; font-size: var(--step--1); font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--text); text-decoration: none; position: relative; }
  .primary-nav a::after { content: ""; position: absolute; left: 0; bottom: .1rem; height: 2px; width: 0; background: var(--brand); transition: width var(--dur-base) var(--ease-out); }
  .primary-nav a:hover::after, .primary-nav .current-menu-item > a::after { width: 100%; }
  .primary-nav .current-menu-item > a { color: var(--brand); }

  .header-actions { display: flex; align-items: center; gap: .6rem; flex: 0 0 auto; }
  .header-search-toggle { display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: var(--radius-pill); border: 1px solid var(--line); background: var(--paper); cursor: pointer; color: var(--text); transition: border-color var(--dur-fast), color var(--dur-fast); }
  .header-search-toggle:hover { border-color: var(--brand); color: var(--brand); }
  .header-search-toggle svg { width: 18px; height: 18px; }

  .nav-toggle { display: none; }

  /* Tiroir de recherche */
  .header-search { display: grid; grid-template-rows: 0fr; transition: grid-template-rows var(--dur-base) var(--ease-out); border-top: 1px solid transparent; }
  .site-header:has(.header-search-toggle[aria-expanded="true"]) .header-search { grid-template-rows: 1fr; border-top-color: var(--line-soft); }
  .header-search > div { overflow: hidden; visibility: hidden; transition: visibility 0s linear var(--dur-base); } /* hors ordre de tabulation quand replié */
  .site-header:has(.header-search-toggle[aria-expanded="true"]) .header-search > div { visibility: visible; transition: visibility 0s; }
  .header-search form { display: flex; gap: .5rem; padding-block: var(--space-s); }

  /* ---- Boutons ---- */
  .btn { --_bg: var(--brand); --_fg: #fff;
    display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
    padding: .85rem 1.5rem; min-height: 48px;
    font-family: var(--font-body); font-weight: 600; font-size: var(--step--1); letter-spacing: .03em;
    color: var(--_fg); background: var(--_bg); border: 1.5px solid var(--_bg);
    border-radius: var(--radius-pill); text-decoration: none; cursor: pointer;
    transition: transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-base) var(--ease-out), background var(--dur-fast);
  }
  .btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-brand); color: #fff; }
  .btn:active { transform: translateY(0); }
  .btn svg { width: 18px; height: 18px; }
  .btn--ghost { --_bg: transparent; --_fg: var(--brand); border-color: color-mix(in oklch, var(--brand) 40%, transparent); }
  .btn--ghost:hover { --_bg: var(--brand); --_fg: #fff; }
  .btn--accent { --_bg: var(--accent); border-color: var(--accent); }
  .btn--wa { --_bg: #25d366; --_fg: #fff; border-color: #25d366; }   /* vert WhatsApp officiel */
  .btn--wa:hover { --_bg: #1ebe5d; border-color: #1ebe5d; box-shadow: 0 12px 30px color-mix(in oklch, #25d366 34%, transparent); }
  .btn--on-dark { --_bg: #fff; --_fg: var(--ink); border-color: #fff; }
  .btn--on-dark:hover { color: var(--ink); }
  .btn--lg { padding: 1rem 2rem; font-size: var(--step-0); }
  .btn--block { width: 100%; }

  .eyebrow { display: inline-flex; align-items: center; gap: .6rem; font-family: var(--font-body); font-weight: 700; font-size: var(--step--1); letter-spacing: var(--tracking-eyebrow); text-transform: uppercase; color: var(--brand); }
  .eyebrow::before { content: ""; width: 28px; height: 2px; background: currentColor; display: inline-block; }
  .section--dark .eyebrow { color: var(--accent); }

  /* ---- HERO ---- */
  .hero { position: relative; isolation: isolate; min-height: min(94svh, 880px); display: grid; align-items: center; color: var(--on-dark); overflow: clip; background: var(--ink); }
  .hero__media { position: absolute; inset: 0; z-index: -2; overflow: clip; }
  .hero__media img, .hero__media video { width: 100%; height: 100%; object-fit: cover; }
  /* Scrim pondéré à gauche (lisibilité du titre) + base sombre + halo cyan + grain de lumière */
  .hero::after {
    content: ""; position: absolute; inset: 0; z-index: -1;
    background:
      linear-gradient(96deg, color-mix(in oklch, var(--ink) 90%, transparent) 0%, color-mix(in oklch, var(--ink) 72%, transparent) 34%, color-mix(in oklch, var(--ink) 34%, transparent) 70%, transparent 100%),
      linear-gradient(0deg, color-mix(in oklch, var(--ink) 82%, transparent) 0%, transparent 40%),
      radial-gradient(80% 65% at 88% 4%, color-mix(in oklch, var(--accent) 26%, transparent), transparent 55%);
  }
  .hero__inner { padding-block: clamp(5rem, 12vw, 9rem); max-width: 48rem; }
  .hero h1 { font-size: var(--step-4); color: #fff; font-weight: 600; text-wrap: balance; text-shadow: 0 2px 36px color-mix(in oklch, var(--ink) 60%, transparent); }
  .hero__lead { font-size: var(--step-1); color: var(--on-dark); max-width: 38rem; margin-block-start: var(--space-m); text-shadow: 0 1px 20px color-mix(in oklch, var(--ink) 55%, transparent); }
  .hero__meta { margin-block-start: var(--space-s); color: var(--accent); font-weight: 700; letter-spacing: var(--tracking-eyebrow); text-transform: uppercase; font-size: var(--step--1); display: inline-flex; align-items: center; gap: .7rem; }
  .hero__meta::before { content: ""; width: 32px; height: 2px; background: currentColor; }
  .hero__actions { display: flex; flex-wrap: wrap; gap: var(--space-s); margin-block-start: var(--space-l); }
  .hero__scroll { position: absolute; bottom: 1.4rem; left: 50%; translate: -50% 0; color: var(--on-dark-muted); font-size: var(--step--1); letter-spacing: .2em; text-transform: uppercase; display: inline-flex; flex-direction: column; align-items: center; gap: .4rem; }
  .hero__scroll span { width: 1px; height: 34px; background: linear-gradient(var(--accent), transparent); }

  /* Titre révélé ligne par ligne (masque qui remonte) */
  .hero__title { line-height: 1.08; }
  .hero__line { display: block; overflow: clip; padding-block: .03em; }
  .hero__line > span { display: block; }

  /* Indicateur d'étage décoratif (motif ascenseur) — coin haut-droit en desktop */
  .hero__floor { position: absolute; z-index: 3; top: calc(var(--header-h) + clamp(1rem, 4vw, 2.4rem)); right: max(var(--gutter), calc((100% - var(--container-wide)) / 2 + var(--gutter))); display: inline-flex; align-items: center; gap: .6rem; padding: .4rem .8rem .4rem .45rem; border-radius: var(--radius-pill); background: color-mix(in oklch, var(--on-dark) 8%, transparent); border: 1px solid var(--on-dark-line); -webkit-backdrop-filter: blur(5px); backdrop-filter: blur(5px); }
  .hero__floor-arrow { flex: none; width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center; background: color-mix(in oklch, var(--accent) 18%, transparent); color: var(--accent); }
  .hero__floor-arrow::before { content: ""; width: 8px; height: 8px; border-top: 2px solid currentColor; border-right: 2px solid currentColor; rotate: -45deg; translate: 0 1px; }
  .hero__floor-read { font-family: var(--font-display); font-variant-numeric: tabular-nums; font-weight: 600; letter-spacing: .06em; color: #fff; font-size: var(--step-0); }
  .hero__floor-unit { font-size: var(--step--1); letter-spacing: .14em; text-transform: uppercase; color: var(--on-dark-muted); font-weight: 700; }
  .hero__floor-cage { display: inline-flex; flex-direction: column; gap: 3px; }
  .hero__floor-cage i { width: 5px; height: 5px; border-radius: 50%; background: color-mix(in oklch, var(--accent) 70%, transparent); }
  @media (max-width: 980px) { .hero__floor { display: none; } }

  @media (prefers-reduced-motion: no-preference) {
    /* Image : Ken Burns (scale) + parallaxe vertical au scroll (translate) — propriétés distinctes, pas de conflit. scale ≥1.08 = marge anti-débordement pour le parallaxe. */
    .hero__media img { animation: kenburns 22s var(--ease-inout) infinite alternate, heroParallax linear both; animation-timeline: auto, scroll(root block); transform-origin: 50% 42%; }
    @keyframes kenburns { from { scale: 1.08; } to { scale: 1.15; } }
    @keyframes heroParallax { from { translate: 0 -3%; } to { translate: 0 3%; } }

    /* Titre : révélation ligne par ligne (masque qui remonte = montée dans la cage) */
    .hero__line > span { animation: heroLineUp var(--dur-slow) var(--ease-out) both; animation-delay: calc(var(--ln, 0) * 110ms + 160ms); will-change: transform; }
    @keyframes heroLineUp { from { transform: translateY(112%); } to { transform: none; } }

    /* Le reste « monte » après le titre */
    .hero__floor  { animation: rise 700ms var(--ease-out) 40ms both; }
    .hero__meta   { animation: rise 800ms var(--ease-out) 90ms both; }
    .hero__lead   { animation: rise 820ms var(--ease-out) 520ms both; }
    .hero__actions{ animation: rise 820ms var(--ease-out) 640ms both; }
    @keyframes rise { from { opacity: 0; transform: translateY(22px); filter: blur(5px); } to { opacity: 1; transform: none; filter: blur(0); } }

    .hero__scroll span { animation: cabinDrop 2.4s var(--ease-inout) infinite; }
    @keyframes cabinDrop { 0%,100% { transform: scaleY(.4); transform-origin: top; opacity:.4 } 50% { transform: scaleY(1); opacity:1 } }
  }
  @media (prefers-reduced-motion: reduce) {
    .hero__line > span { transform: none; }
    .hero__media img { scale: 1; translate: 0; }
  }

      /* ============================================================
     SIGNATURE « L'ASCENSION » — ascenseur mécanique vivant au scroll.
     Capsule chrome auto-éclairée dans un puits usiné clippé. Toute la
     lueur d'accent vit DANS le puits (overflow:hidden) ou en inset —
     aucune bavure sur les sections claires. --cab-h reste 32 (JS CAB_H = 32).
     Animations scroll-driven : course `top` (cabine / contrepoids / crête)
     + remplissage `scaleY` (sillage). Le « ping » d'arrivée est discret,
     réamorcé par .is-active (jamais au scroll).
     ============================================================ */
  .elevator {
    position: fixed; left: 0; top: var(--header-h); bottom: 0;
    width: 72px; z-index: 60; pointer-events: none; display: none;
    --cab-h: 32px;                 /* inchangé — JS CAB_H reste 32 */
    --shaft-x: 14px;
    --shaft-w: 22px;
    --cab-w: 20px;
    --axis: calc(var(--shaft-x) + var(--shaft-w) / 2);
    --cwt-x: calc(var(--shaft-x) + var(--shaft-w) - 8px);
    --edge: color-mix(in oklch, var(--accent) 62%, white);
  }
  @media (min-width: 1280px) and (prefers-reduced-motion: no-preference) {
    .elevator { display: block; }
  }

  /* ---- PUITS : cage usinée profonde qui fournit son propre fond ---- */
  .elevator__shaft {
    position: absolute; top: 0; bottom: 0; left: var(--shaft-x);
    width: var(--shaft-w); border-radius: 3px; overflow: hidden;
    background:
      radial-gradient(120% 22% at 50% 0%,   rgba(0,0,0,.85), transparent 60%),
      radial-gradient(120% 24% at 50% 100%, rgba(0,0,0,.88), transparent 60%),
      radial-gradient(135% 36% at 50% 50%,
        color-mix(in oklch, var(--accent) 9%, transparent) 0%, transparent 62%),
      repeating-linear-gradient(180deg,
        transparent 0 92px,
        rgba(0,0,0,.55) 92px 93px,
        rgba(255,255,255,.05) 93px 95px,
        transparent 95px 96px),
      linear-gradient(90deg,
        #07090e 0%, #1c232e 26%, #0c1017 52%, #1a212b 76%, #07090d 100%);
    box-shadow:
      inset 2px 0 6px rgba(0,0,0,.70),
      inset -2px 0 6px rgba(0,0,0,.70),
      inset 0 0 0 1px rgba(255,255,255,.05),
      0 0 0 1px rgba(0,0,0,.40);
  }
  /* Rails de guidage acier poli — cœur spéculaire net sur fond clair comme sombre. */
  .elevator__shaft::before,
  .elevator__shaft::after {
    content: ""; position: absolute; top: 0; bottom: 0; width: 3px;
    border-radius: 2px; z-index: 2;
    background: linear-gradient(90deg,
      rgba(0,0,0,.50) 0%,
      rgba(255,255,255,.42) 42%,
      rgba(210,224,236,.18) 60%,
      rgba(0,0,0,.45) 100%);
  }
  .elevator__shaft::before { left: 3px; }
  .elevator__shaft::after  { right: 3px; }

  /* ---- PROGRESSION : sillage d'accent qui descend avec la cabine ----
     Corps : croît depuis le haut via scaleY scroll-driven (origin top),
     teinte plus vive vers le bas (tête près de la cabine). Clippé par le
     puits — aucune bavure cyan sur le blanc. */
  .elevator__progress {
    position: absolute; left: 0; right: 0; top: 0; height: 100%; z-index: 1;
    transform-origin: 50% 0%;
    transform: scaleY(0);
    border-radius: 3px 3px 0 0;
    background: linear-gradient(180deg,
      color-mix(in oklch, var(--accent) 8%,  transparent) 0%,
      color-mix(in oklch, var(--accent) 24%, transparent) 55%,
      color-mix(in oklch, var(--accent) 46%, transparent) 100%);
    box-shadow:
      inset 0 0 6px color-mix(in oklch, var(--accent) 20%, transparent);
    will-change: transform;
  }
  /* CRÊTE : barre vive de hauteur FIXE (3px) qui coiffe le sillage JUSTE
     au-dessus de la cabine (visible, non masquée par la cabine). Voyage par
     `top` synchronisé au sommet de la cabine. Clippée par le puits. */
  .elevator__progress-edge {
    position: absolute; left: 1px; right: 1px; top: 0; height: 3px; z-index: 3;
    border-radius: 2px;
    background: linear-gradient(90deg,
      var(--edge) 0%, var(--accent) 50%, var(--edge) 100%);
    box-shadow:
      0 0 4px var(--accent),
      inset 0 0 2px rgba(255,255,255,.7);
    will-change: top;
  }

  /* ---- CÂBLE : ligne de levage tendue, acier crédible un cran plus vif ---- */
  .elevator__cable {
    position: absolute; top: 0; left: var(--axis); translate: -50% 0;
    width: 2px; height: 100%; z-index: 2; border-radius: 1px;
    background: linear-gradient(180deg,
      rgba(226,238,250,.52) 0%,
      rgba(180,200,222,.30) 30%,
      rgba(130,160,190,.15) 60%,
      rgba(120,150,180,.07) 88%,
      transparent 100%);
    box-shadow: 0 0 0 .5px rgba(0,0,0,.30);
  }

  /* ---- CONTREPOIDS : fonte empilée, masse équilibrée sur la course inverse ---- */
  .elevator__weight {
    position: absolute; left: var(--cwt-x); top: 0;
    width: 6px; height: 26px; border-radius: 1.5px; z-index: 3;
    background:
      repeating-linear-gradient(180deg,
        rgba(255,255,255,.20) 0 1px,
        rgba(0,0,0,.10) 1px 3.5px,
        rgba(0,0,0,.52) 3.5px 5px),
      linear-gradient(90deg, #2a3039 0%, #5e6772 40%, #828c98 52%, #4a525c 66%, #242a32 100%);
    box-shadow:
      inset 0 1px 0 rgba(255,255,255,.34),
      inset 0 -1px 0 rgba(0,0,0,.55),
      inset 1px 0 0 rgba(255,255,255,.10),
      0 1px 3px rgba(0,0,0,.62);
  }
  /* Fil de tension : le brin de câble qui suspend le contrepoids (acier, jamais d'accent). */
  .elevator__weight::before {
    content: ""; position: absolute; left: 50%; translate: -50% 0;
    bottom: 100%; width: 1px; height: 100vh;
    background: linear-gradient(180deg, transparent 0%, rgba(200,216,232,.28) 40%, rgba(200,216,232,.40) 100%);
  }

  /* ---- CABINE : capsule verre chromée éclairée (sujet de premier plan) ---- */
  .elevator__cabin {
    position: absolute; left: var(--axis); translate: -50% 0; top: 0;
    width: var(--cab-w); height: var(--cab-h); border-radius: 4px; z-index: 5;
    background:
      radial-gradient(78% 60% at 50% 56%,
        rgba(255,240,212,.62) 0%,
        rgba(255,226,182,.36) 40%,
        rgba(198,212,226,.20) 68%, transparent 84%),
      linear-gradient(102deg,
        transparent 20%, rgba(255,255,255,.60) 32%, rgba(255,255,255,0) 45%),
      linear-gradient(90deg,
        #424c58 0%, #cdd8e4 16%, #8c98a7 38%,
        #5a6573 56%, #aeb9c8 80%, #4a5460 100%);
    border: 1px solid #20262e;
    box-shadow:
      0 3px 9px rgba(0,0,0,.55),
      inset 0 1px 0 rgba(255,255,255,.64),
      inset 0 0 4px rgba(255,232,196,.30),
      inset 0 -3px 6px rgba(0,0,0,.42);
  }
  /* Porte à deux vantaux : montant central + ergots de patin latéraux */
  .elevator__cabin::before {
    content: ""; position: absolute; top: 5px; bottom: 7px; left: 50%;
    width: 1px; translate: -50% 0;
    background: linear-gradient(180deg, rgba(0,0,0,0), rgba(0,0,0,.48), rgba(0,0,0,0));
    box-shadow:
      1px 0 0 rgba(255,255,255,.20),
      -7px 0 0 -3px #c9d3df,
       7px 0 0 -3px #c9d3df;
  }
  /* Joug d'attache du câble au sommet de la cabine */
  .elevator__cabin::after {
    content: ""; position: absolute; left: 50%; top: -9px;
    width: 5px; height: 9px; translate: -50% 0; border-radius: 2px 2px 0 0;
    background: linear-gradient(90deg, #353c45, #828d9b 50%, #2f353d);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.4);
  }
  /* Indicateur BIJOU : bandeau d'accent net (tout inset → no bleed) */
  .elevator__cabin-light {
    position: absolute; top: 3px; left: 3px; right: 3px; height: 2px;
    border-radius: 2px;
    background: linear-gradient(90deg,
      var(--edge) 0%, var(--accent) 50%, var(--edge) 100%);
    box-shadow:
      inset 0 0 2px rgba(255,255,255,.85),
      inset 0 .5px 0 rgba(255,255,255,.6),
      0 0 3px var(--accent);
  }

  /* ---- PALIERS : index vertical éditorial, support discret ---- */
  .elevator__floors { position: absolute; inset: 0; z-index: 4; }
  .elevator__floor {
    position: absolute; left: var(--shaft-x); width: 56px;
    transform: translateY(-50%);
    display: flex; align-items: center; gap: 7px;
  }
  /* Tiret : porte aussi le connecteur fin rail→numéro (::after). */
  .elevator__floor-tick {
    position: relative;
    flex: none; width: var(--shaft-w); height: 2px; border-radius: 1px;
    transform-origin: 0% 50%;
    background: color-mix(in oklch, var(--on-dark) 22%, transparent);
    transition:
      background var(--dur-base) var(--ease-out),
      width var(--dur-base) var(--ease-out),
      box-shadow var(--dur-base) var(--ease-out);
  }
  /* Connecteur hairline qui se déploie du rail vers le numéro à l'activation. */
  .elevator__floor-tick::after {
    content: ""; position: absolute; top: 50%; left: 100%;
    width: 5px; height: 1px; translate: 0 -50%;
    transform: scaleX(0); transform-origin: 0 50%;
    background: linear-gradient(90deg, var(--accent), color-mix(in oklch, var(--accent) 20%, transparent));
    opacity: 0;
    transition:
      transform var(--dur-base) var(--ease-out),
      opacity var(--dur-base) var(--ease-out);
  }
  /* Numéros : police display, chiffres tabulaires, hiérarchie inactif→actif. */
  .elevator__floor-num {
    font: 600 10px/1 var(--font-display);
    letter-spacing: .1em;
    color: var(--on-dark-muted);
    font-variant-numeric: tabular-nums lining-nums;
    /* Halo sombre multi-couche : lisible sur hero sombre ET sections claires. */
    text-shadow: 0 0 2px rgba(0,0,0,.92), 0 0 4px rgba(0,0,0,.6), 0 1px 1px rgba(0,0,0,.9);
    white-space: nowrap; display: none;
    opacity: .55;
    transform-origin: left center;
    transform: translateX(-3px) scale(.9);
    transition:
      color var(--dur-base) var(--ease-out),
      opacity var(--dur-base) var(--ease-out),
      transform var(--dur-base) var(--ease-out),
      letter-spacing var(--dur-base) var(--ease-out);
  }

  /* ---- PALIER ACTIF : « arrivée » (ping discret + connecteur + numéro focal) ---- */
  .elevator__floor.is-active .elevator__floor-tick {
    background: var(--accent);
    width: calc(var(--shaft-w) + 4px);
    box-shadow:
      inset 0 0 2px rgba(255,255,255,.6),
      0 0 4px var(--accent);
    animation: elevTickPing var(--dur-base) var(--ease-out) both;
  }
  .elevator__floor.is-active .elevator__floor-tick::after {
    transform: scaleX(1);
    opacity: 1;
  }
  .elevator__floor.is-active .elevator__floor-num {
    color: #fff;
    opacity: 1;
    transform: translateX(2px) scale(1.16);
    letter-spacing: .04em;
    text-shadow: 0 0 4px color-mix(in oklch, var(--accent) 55%, transparent),
                 0 0 2px rgba(0,0,0,.95), 0 1px 1px rgba(0,0,0,.92);
    animation: elevNumArrive var(--dur-base) var(--ease-out) both;
  }
  @media (prefers-reduced-motion: no-preference) {
    @keyframes elevTickPing {
      0%   { transform: scaleX(.62); }
      55%  { transform: scaleX(1.08); }
      100% { transform: scaleX(1); }
    }
    @keyframes elevNumArrive {
      0%   { opacity: 0; transform: translateX(-5px) scale(1.02); }
      60%  { opacity: 1; }
      100% { opacity: 1; transform: translateX(2px) scale(1.16); }
    }
  }

  /* ---- COURSE SCROLL-DRIVEN : cabine, contrepoids, sillage + crête ---- */
  @media (prefers-reduced-motion: no-preference) {
    .elevator__cabin { animation: elevCabin linear both; animation-timeline: scroll(root block); }
    @keyframes elevCabin { from { top: 0; } to { top: calc(100% - var(--cab-h)); } }

    .elevator__weight { animation: elevWeight linear both; animation-timeline: scroll(root block); }
    @keyframes elevWeight { from { top: calc(100% - 26px); } to { top: 0; } }

    /* Corps du sillage : scaleY 0→1 (transform → perf-clean) */
    .elevator__progress { animation: elevProgress linear both; animation-timeline: scroll(root block); }
    @keyframes elevProgress { from { transform: scaleY(0); } to { transform: scaleY(1); } }

    /* Crête : coiffe le sillage 3px AU-DESSUS du sommet de la cabine (visible) */
    .elevator__progress-edge { animation: elevEdge linear both; animation-timeline: scroll(root block); }
    @keyframes elevEdge {
      from { top: -3px; }
      to   { top: calc(100% - var(--cab-h) - 3px); }
    }
  }

  @media (min-width: 1380px) { .elevator__floor-num { display: block; } }

  /* ====== Système de révélation au scroll — niveau agence (IntersectionObserver) ====== */
  /* Bloc : montée + fondu + léger défocus qui se pose */
  .js .reveal { opacity: 0; transform: translateY(36px); filter: blur(6px); transition: opacity .7s var(--ease-rev), transform var(--dur-rev) var(--ease-rev), filter .7s var(--ease-rev); will-change: opacity, transform; }
  .js .reveal.in-view { opacity: 1; transform: none; filter: blur(0); }

  /* Typographie cinétique : le titre remonte derrière un masque */
  .js .reveal-title { overflow: clip; }
  .js .reveal-title > span { display: inline-block; transform: translateY(115%); transition: transform var(--dur-rev) var(--ease-rev); will-change: transform; }
  .js .reveal-title.in-view > span { transform: none; }

  /* Média cinématographique : volet qui s'ouvre vers le haut + zoom qui se pose */
  .js .reveal-media { overflow: clip; }
  .js .reveal-media img { clip-path: inset(0 0 100% 0); transform: scale(1.12); transition: clip-path 1.1s var(--ease-rev), transform 1.3s var(--ease-rev); will-change: clip-path, transform; }
  .js .reveal-media.in-view img { clip-path: inset(0 0 0 0); transform: scale(1); }

  /* Grilles en cascade */
  .js .stagger > * { opacity: 0; transform: translateY(30px); filter: blur(5px); transition: opacity .6s var(--ease-rev), transform .85s var(--ease-rev), filter .6s var(--ease-rev); }
  .js .stagger.in-view > * { opacity: 1; transform: none; filter: blur(0); }
  .js .stagger.in-view > *:nth-child(1) { transition-delay: .05s; }
  .js .stagger.in-view > *:nth-child(2) { transition-delay: .13s; }
  .js .stagger.in-view > *:nth-child(3) { transition-delay: .21s; }
  .js .stagger.in-view > *:nth-child(4) { transition-delay: .29s; }
  .js .stagger.in-view > *:nth-child(5) { transition-delay: .37s; }
  .js .stagger.in-view > *:nth-child(6) { transition-delay: .45s; }

  /* Trait de l'eyebrow qui se dessine à la révélation */
  .js .eyebrow.reveal::before { width: 0; transition: width .8s var(--ease-rev) .25s; }
  .js .eyebrow.reveal.in-view::before { width: 28px; }
  /* Dans un bandeau de section, l'eyebrow monte d'un cran plus court que le
     gap (14px < space-s) → il ne plonge jamais dans le titre pendant l'anim. */
  .js .section-head .eyebrow.reveal:not(.in-view) { transform: translateY(14px); }

  @media (prefers-reduced-motion: reduce) {
    .js .reveal, .js .stagger > * { opacity: 1; transform: none; filter: none; transition: none; }
    .js .reveal-title > span { transform: none; transition: none; }
    .js .reveal-media img { clip-path: none; transform: none; transition: none; }
    .js .eyebrow.reveal::before { width: 28px; transition: none; }
  }
  /* Atténuer le flou sur mobile (coût GPU) */
  @media (max-width: 640px) {
    .js .reveal, .js .stagger > * { filter: none; }
  }

  /* ---- Cartes services ---- */
  .features { display: grid; gap: var(--space-m); grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr)); }
  .feature-card { container-type: inline-size; position: relative; background: var(--paper); border: 1px solid var(--line-soft); border-radius: var(--radius-lg); padding: clamp(1.4rem, 3vw, 2rem); transition: transform var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out), border-color var(--dur-base); overflow: clip; }
  .feature-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: linear-gradient(90deg, var(--brand), var(--accent)); scale: 0 1; transform-origin: left; transition: scale var(--dur-base) var(--ease-out); }
  .feature-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-2); border-color: transparent; }
  .feature-card:hover::before { scale: 1 1; }
  .feature-card .icon-badge { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; background: var(--brand-tint); color: var(--brand); margin-block-end: var(--space-s); }
  .feature-card .icon-badge svg { width: 28px; height: 28px; }
  .feature-card h3 { font-size: var(--step-1); margin-block-end: .5rem; }
  .feature-card p { color: var(--text-body); font-size: var(--step-0); }
  .section--dark .feature-card { background: var(--ink-2); border-color: var(--on-dark-line); }
  .section--dark .feature-card p { color: var(--on-dark-muted); }
  .section--dark .feature-card .icon-badge { background: color-mix(in oklch, var(--accent) 16%, transparent); color: var(--accent); }
  /* Container query : la carte s'adapte à SON conteneur (sidebar, pleine largeur…) */
  @container (min-width: 24rem) {
    .feature-card { padding: clamp(1.8rem, 3vw, 2.4rem); }
    .feature-card .icon-badge { width: 64px; height: 64px; }
    .feature-card h3 { font-size: var(--step-2); }
  }
  @container (max-width: 16rem) {
    .feature-card .icon-badge { width: 48px; height: 48px; }
  }

  /* ---- Bandeau de section (titre + intro) ----
     Flex column + gap : empile proprement eyebrow / titre / intro sans
     collision (l'eyebrow inline-flex + le titre overflow:clip se
     chevauchaient en flux normal). */
  .section-head { max-width: 46rem; margin-inline: auto; text-align: center; margin-block-end: clamp(2rem, 5vw, var(--space-xl)); display: flex; flex-direction: column; align-items: center; gap: var(--space-s); }
  .section-head > * { margin-block: 0; }
  .section-head p:not(.eyebrow) { color: var(--text-muted); }
  .section-head--left { margin-inline: 0; text-align: left; align-items: flex-start; }

  /* ---- Split média/texte ---- */
  .split { display: grid; gap: clamp(1.5rem, 5vw, var(--space-xl)); align-items: center; grid-template-columns: 1fr; }
  @media (min-width: 860px) { .split { grid-template-columns: 1fr 1fr; } .split--reverse > :first-child { order: 2; } }
  .split__media { border-radius: var(--radius-lg); overflow: clip; box-shadow: var(--shadow-2); aspect-ratio: 4 / 3; }
  .split__media img { width: 100%; height: 100%; object-fit: cover; }
  .split__list { list-style: none; padding: 0; margin-block-start: var(--space-m); display: grid; gap: .75rem; }
  .split__list li { display: flex; gap: .7rem; align-items: flex-start; }
  .split__list svg { width: 22px; height: 22px; color: var(--brand); flex: 0 0 auto; margin-top: .15rem; }

  /* ---- Stat / compteur ---- */
  .stat { display: flex; flex-direction: column; }
  .stat__num { font-family: var(--font-display); font-size: var(--step-3); color: var(--brand); line-height: 1; }
  .section--dark .stat__num { color: var(--accent); }
  .stat__label { color: var(--text-muted); font-weight: 600; letter-spacing: .04em; text-transform: uppercase; font-size: var(--step--1); margin-top: .35rem; }

  /* ---- Grille de références (logos clients) ---- */
  .refs { display: grid; gap: var(--space-m); grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); align-items: stretch; }
  .ref-card { display: grid; place-items: center; padding: clamp(1rem, 3vw, 1.6rem); background: var(--paper); border: 1px solid var(--line-soft); border-radius: var(--radius); min-height: 110px; }
  .ref-card img { max-height: 64px; width: auto; filter: grayscale(1); opacity: .72; transition: filter var(--dur-base), opacity var(--dur-base), transform var(--dur-base) var(--ease-out); }
  .ref-card:hover img { filter: grayscale(0); opacity: 1; transform: scale(1.04); }

  /* ---- Tarifs / contrats ---- */
  .pricing { display: grid; gap: var(--space-m); grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr)); align-items: stretch; }
  .price-card { display: flex; flex-direction: column; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: clamp(1.5rem, 3vw, 2rem); position: relative; transition: transform var(--dur-base) var(--ease-out), box-shadow var(--dur-base); }
  .price-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-2); }
  .price-card--featured { border-color: var(--brand); box-shadow: var(--shadow-brand); }
  .price-card__tag { position: absolute; top: -12px; left: 50%; translate: -50% 0; background: var(--brand); color: #fff; font-size: var(--step--1); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; padding: .3rem 1rem; border-radius: var(--radius-pill); }
  .price-card h3 { font-size: var(--step-2); }
  .price-card__price { color: var(--text-muted); font-weight: 600; margin-block: .25rem var(--space-s); }
  .price-card ul { list-style: none; padding: 0; margin: 0 0 var(--space-m); display: grid; gap: .7rem; flex: 1; }
  .price-card li { display: flex; gap: .6rem; align-items: flex-start; font-size: var(--step-0); }
  .price-card li svg { width: 20px; height: 20px; color: var(--ok); flex: 0 0 auto; margin-top: .15rem; }

  /* ---- Bandeau CTA ---- */
  .cta-band { position: relative; isolation: isolate; overflow: clip; background: linear-gradient(120deg, var(--brand-strong), var(--brand)); color: #fff; border-radius: var(--radius-lg); padding: clamp(2rem, 6vw, 4rem); text-align: center; }
  .cta-band::after { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(80% 120% at 100% 0%, color-mix(in oklch, var(--accent) 50%, transparent), transparent 55%); }
  .cta-band h2 { color: #fff; }
  .cta-band p { color: color-mix(in oklch, #fff 86%, transparent); margin-inline: auto; }
  .cta-band .hero__actions, .cta-band .btn-row { justify-content: center; }

  .btn-row { display: flex; flex-wrap: wrap; gap: var(--space-s); margin-block-start: var(--space-m); }
  .btn-row--center { justify-content: center; }

  /* ---- Fil d'ariane ---- */
  .breadcrumb { font-size: var(--step--1); color: var(--text-muted); padding-block: var(--space-m); }
  .breadcrumb a { color: var(--text-muted); text-decoration: underline; text-underline-offset: 2px; }
  .breadcrumb a:hover { color: var(--brand); }
  .breadcrumb [aria-current] { color: var(--text); }

  /* ---- En-tête de page interne ---- */
  .page-hero { background: var(--ink); color: var(--on-dark); padding-block: clamp(3.5rem, 9vw, 7rem) clamp(2.5rem, 6vw, 4.5rem); position: relative; isolation: isolate; overflow: clip; }
  .page-hero::after { content:""; position:absolute; inset:0; z-index:-1; background: radial-gradient(90% 70% at 90% 0%, color-mix(in oklch, var(--accent) 18%, transparent), transparent 55%); }
  .page-hero h1 { color: #fff; }
  .page-hero p { color: var(--on-dark-muted); margin-block-start: var(--space-s); }

  /* ---- Formulaires ---- */
  .field { display: grid; gap: .4rem; margin-block-end: var(--space-s); }
  .field label { font-weight: 600; font-size: var(--step--1); color: var(--text); }
  .field .req { color: var(--err); }
  input[type=text], input[type=email], input[type=tel], input[type=search], input[type=number], input[type=password], textarea, select {
    width: 100%; padding: .8rem 1rem; background: var(--paper); color: var(--text-body);
    border: 1.5px solid var(--line); border-radius: var(--radius); transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
  }
  input:focus, textarea:focus, select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); outline: none; }
  textarea { min-height: 140px; resize: vertical; }
  .form-grid { display: grid; gap: 0 var(--space-m); grid-template-columns: 1fr; }
  @media (min-width: 620px) { .form-grid--2 { grid-template-columns: 1fr 1fr; } }
  .form-note { font-size: var(--step--1); color: var(--text-muted); }
  .form-status { padding: .9rem 1.1rem; border-radius: var(--radius); font-size: var(--step--1); margin-block-end: var(--space-s); display: none; }
  .form-status.is-ok  { display:block; background: color-mix(in oklch, var(--ok) 12%, white); color: var(--ok); border: 1px solid color-mix(in oklch, var(--ok) 30%, transparent); }
  .form-status.is-err { display:block; background: color-mix(in oklch, var(--err) 10%, white); color: var(--err); border: 1px solid color-mix(in oklch, var(--err) 30%, transparent); }
  .hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

  /* ---- Carte info contact ---- */
  .info-card { display: flex; gap: var(--space-s); align-items: flex-start; padding: var(--space-m); background: var(--surface); border-radius: var(--radius); }
  .info-card svg { width: 26px; height: 26px; color: var(--brand); flex: 0 0 auto; }
  .info-card h3 { font-size: var(--step-0); margin-bottom: .15rem; }
  .info-card p, .info-card a { color: var(--text-body); text-decoration: none; }

  /* ---- Blog ---- */
  .posts { display: grid; gap: var(--space-l); grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr)); }
  .post-card { display: flex; flex-direction: column; background: var(--paper); border: 1px solid var(--line-soft); border-radius: var(--radius-lg); overflow: clip; transition: transform var(--dur-base) var(--ease-out), box-shadow var(--dur-base); }
  .post-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-2); }
  .post-card__thumb { aspect-ratio: 16 / 10; overflow: clip; background: var(--surface-2); }
  .post-card__thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform var(--dur-slow) var(--ease-out); }
  .post-card:hover .post-card__thumb img { transform: scale(1.05); }
  .post-card__body { padding: var(--space-m); display: flex; flex-direction: column; gap: .5rem; flex: 1; }
  .post-card__meta { font-size: var(--step--1); color: var(--text-muted); letter-spacing: .03em; }
  .post-card h2, .post-card h3 { font-size: var(--step-1); }
  .post-card h2 a, .post-card h3 a { text-decoration: none; color: var(--text); }
  .post-card h2 a:hover, .post-card h3 a:hover { color: var(--brand); }

  .entry-content { max-width: var(--measure); margin-inline: auto; }
  .entry-content > * + * { margin-block-start: var(--space-m); }
  .entry-content :is(h2,h3) { margin-block-start: var(--space-l); }
  .entry-content img { border-radius: var(--radius); }
  .entry-content blockquote { border-left: 3px solid var(--brand); padding-left: var(--space-m); color: var(--text); font-size: var(--step-1); font-family: var(--font-display); }

  .pagination { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: center; margin-block-start: var(--space-xl); }
  .pagination .page-numbers { display: inline-grid; place-items: center; min-width: 44px; min-height: 44px; padding: 0 .6rem; border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--text); }
  .pagination .current { background: var(--brand); color: #fff; border-color: var(--brand); }
  .pagination a:hover { border-color: var(--brand); color: var(--brand); }

  /* ---- Pied de page ---- */
  .site-footer { background: var(--ink); color: var(--on-dark-muted); padding-block: clamp(3rem, 7vw, 5rem) var(--space-l); }
  .footer-grid { display: grid; gap: var(--space-l); grid-template-columns: 1fr; }
  @media (min-width: 720px) { .footer-grid { grid-template-columns: 1.6fr 1fr 1.2fr; } }
  .site-footer h4 { color: #fff; font-size: var(--step-0); letter-spacing: .04em; text-transform: uppercase; margin-bottom: var(--space-s); }
  .site-footer a { color: var(--on-dark-muted); text-decoration: none; }
  .site-footer a:hover { color: var(--accent); }
  .footer-brand .brand__wordmark { color: #fff; font-size: 1.3rem; }
  .footer-menu { list-style: none; padding: 0; display: grid; gap: .6rem; }
  .footer-contact { list-style: none; padding: 0; display: grid; gap: .8rem; }
  .footer-contact li { display: flex; gap: .6rem; align-items: flex-start; }
  .footer-contact svg { width: 20px; height: 20px; color: var(--accent); flex: 0 0 auto; margin-top: .1rem; }
  .footer-bottom { margin-block-start: var(--space-xl); padding-block-start: var(--space-m); border-top: 1px solid var(--on-dark-line); display: flex; flex-wrap: wrap; gap: var(--space-s); justify-content: space-between; font-size: var(--step--1); }

  /* ---- Bouton WhatsApp flottant ---- */
  .whatsapp-float { position: fixed; bottom: 22px; right: 22px; width: 58px; height: 58px; background: #25d366; color: #fff; border-radius: 50%; display: grid; place-items: center; box-shadow: 0 10px 26px oklch(0 0 0 / .28); z-index: 1000; text-decoration: none; transition: transform var(--dur-base) var(--ease-out), background var(--dur-fast); }
  .whatsapp-float svg { width: 30px; height: 30px; }
  .whatsapp-float:hover { background: #1ebe5d; transform: scale(1.08); color: #fff; }
  @media (prefers-reduced-motion: no-preference) {
    .whatsapp-float::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: rgba(37,211,102,.45); animation: waPulse 2s ease-out infinite; z-index: -1; }
    @keyframes waPulse { 0% { transform: scale(1); opacity: .6; } 100% { transform: scale(1.9); opacity: 0; } }
  }

  /* ---- 404 ---- */
  .error-404 { text-align: center; padding-block: clamp(4rem, 12vw, 8rem); }
  .error-404 .code { font-family: var(--font-display); font-size: clamp(5rem, 22vw, 12rem); line-height: 1; color: var(--brand); }
}

/* ---------------------------------------------------------------- */
@layer utilities {
  .visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
  .text-center { text-align: center; }
  .mx-auto { margin-inline: auto; }
  .mt-s { margin-block-start: var(--space-s); }
  .mt-m { margin-block-start: var(--space-m); }
  .mt-l { margin-block-start: var(--space-l); }
  .flow-l { --flow: var(--space-m); }
  .lead { font-size: var(--step-1); color: var(--text-muted); }
  .grid-3 { display: grid; gap: var(--space-l); grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr)); }
  [hidden] { display: none !important; }
}

/* ---- Responsive : navigation mobile ---- */
@media (max-width: 1024px) {
  .nav-toggle { display: inline-grid; place-items: center; width: 46px; height: 46px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); cursor: pointer; color: var(--text); }
  .nav-toggle svg { width: 24px; height: 24px; }
  .header-actions { margin-inline-start: auto; }
  /* Les CTA passent dans le tiroir mobile pour désencombrer la barre */
  .header-actions .btn--devis, .header-actions .btn--phone { display: none; }
  .nav-cta { display: grid; gap: .7rem; margin-block-start: var(--space-l); }
  /* display:flex explicite : garde l'icône + le texte sur UNE ligne centrée
     (sinon `.primary-nav a{display:block}` non-layered forçait l'empilement). */
  .nav-cta .btn { display: flex; align-items: center; justify-content: center; gap: .6rem; width: 100%; min-height: 56px; padding: .95rem 1.4rem; font-size: var(--step-0); letter-spacing: .02em; }
  .nav-cta .btn span { white-space: nowrap; }
  /* Icônes colorisées dans le tiroir : l'icône du bouton fantôme passe en accent. */
  .nav-cta .btn--ghost .icon { color: var(--accent); }
  .nav-cta .btn--ghost:hover .icon, .nav-cta .btn--ghost:focus-visible .icon { color: #fff; }
  /* Tiroir : fondu + léger glissement vertical (PAS de translateX hors-écran → zéro débordement horizontal). */
  .primary-nav { position: fixed; inset: var(--header-h) 0 0 0; background: var(--paper); margin: 0; padding: var(--space-l) var(--gutter); opacity: 0; transform: translateY(-10px); visibility: hidden; transition: opacity var(--dur-base) var(--ease-out), transform var(--dur-base) var(--ease-out), visibility 0s linear var(--dur-base); overflow-y: auto; overflow-x: hidden; z-index: 90; }
  body:has(.nav-toggle[aria-expanded="true"]) .primary-nav { opacity: 1; transform: none; visibility: visible; transition: opacity var(--dur-base) var(--ease-out), transform var(--dur-base) var(--ease-out), visibility 0s; }
  /* Bascule de l'icône hamburger / croix */
  .nav-toggle .i-close { display: none; }
  .nav-toggle[aria-expanded="true"] .i-menu { display: none; }
  .nav-toggle[aria-expanded="true"] .i-close { display: block; }
  body:has(.nav-toggle[aria-expanded="true"]) { overflow: hidden; }
  .primary-nav ul { flex-direction: column; align-items: stretch; gap: 0; }
  .primary-nav li { border-bottom: 1px solid var(--line-soft); }
  .primary-nav .nav-menu a { display: block; padding: 1rem .25rem; font-size: var(--step-1); text-transform: none; letter-spacing: 0; }
  .primary-nav .nav-menu a::after { display: none; }
}

/* ---- Composants complémentaires ---- */
@layer components {
  /* Logo personnalisé (the_custom_logo) */
  .custom-logo-link { display: inline-flex; align-items: center; }
  .custom-logo-link img, .custom-logo { height: 46px; width: auto; }

  /* Formulaire de recherche */
  .search-form { display: flex; gap: .5rem; width: 100%; }
  .search-form .search-field { flex: 1; }
  .search-form .btn { flex: 0 0 auto; padding-inline: 1rem; }

  /* Boutons de l'en-tête */
  .btn { white-space: nowrap; }
  .btn--phone { padding-inline: 1rem; }
  .btn--devis { box-shadow: var(--shadow-1); }

  /* Micro-interaction premium : reflet qui balaie les boutons pleins au survol */
  .btn { position: relative; overflow: hidden; isolation: isolate; }
  .btn:not(.btn--ghost)::after {
    content: ""; position: absolute; inset: 0; left: -130%; z-index: -1; pointer-events: none;
    background: linear-gradient(110deg, transparent 32%, color-mix(in oklch, #fff 32%, transparent) 50%, transparent 68%);
    transition: left .6s var(--ease-out);
  }
  .btn:not(.btn--ghost):hover::after { left: 130%; }
  @media (prefers-reduced-motion: reduce) { .btn::after { display: none; } }
  .nav-cta { display: none; }

  /* Navigation entre articles */
  .post-nav { display: flex; justify-content: space-between; gap: var(--space-m); flex-wrap: wrap; border-top: 1px solid var(--line); padding-block-start: var(--space-m); }
  .post-nav a { text-decoration: none; font-family: var(--font-display); color: var(--text); }
  .post-nav a:hover { color: var(--brand); }
  .post-nav__next { margin-inline-start: auto; text-align: right; }

  /* Étiquettes d'article */
  .entry-tags a { display: inline-block; font-size: var(--step--1); padding: .3rem .8rem; border: 1px solid var(--line); border-radius: var(--radius-pill); text-decoration: none; color: var(--text-muted); margin: .2rem .2rem 0 0; }
  .entry-tags a:hover { border-color: var(--brand); color: var(--brand); }
  .page-links { margin-block-start: var(--space-m); font-weight: 600; }
  .page-links a { padding: .2rem .6rem; border: 1px solid var(--line); border-radius: 6px; text-decoration: none; margin: 0 .2rem; }

  /* Réseaux sociaux (pied) */
  .footer-social { display: flex; gap: .6rem; }
  .footer-social a { display: inline-grid; place-items: center; width: 40px; height: 40px; border: 1px solid var(--on-dark-line); border-radius: 50%; }
  .footer-social a:hover { background: var(--accent); border-color: var(--accent); color: var(--ink); }
  .footer-social svg { width: 20px; height: 20px; }

  /* Widgets (barre latérale blog) */
  .widget { margin-block-end: var(--space-l); }
  .widget-title { font-family: var(--font-display); font-size: var(--step-1); margin-block-end: var(--space-s); }
  .widget ul { list-style: none; padding: 0; display: grid; gap: .5rem; }
  .widget a { text-decoration: none; color: var(--text-body); }
  .widget a:hover { color: var(--brand); }

  /* Commentaires */
  .comments-area { margin-block-start: var(--space-l); }
  .comments-title { font-family: var(--font-display); margin-block-end: var(--space-m); }
  .comment-list { list-style: none; padding: 0; display: grid; gap: var(--space-m); }
  .comment-list .comment-body { background: var(--paper); border: 1px solid var(--line-soft); border-radius: var(--radius); padding: var(--space-m); }
  .comment-list .children { list-style: none; padding-inline-start: var(--space-m); margin-block-start: var(--space-m); display: grid; gap: var(--space-m); }
  .comment-respond { margin-block-start: var(--space-l); }
  .comment-form label { display: block; font-weight: 600; margin-block-end: .3rem; }
  .comment-form input[type=text], .comment-form input[type=email], .comment-form input[type=url], .comment-form textarea { width: 100%; }
  .comment-form p { margin-block-end: var(--space-s); }

  /* Liens de pagination commentaires & login 2FA */
  .elb-2fa-field input { width: 100%; }
}

/* =================================================================
   GARDE-FOUS (non-layered) — priment sur les styles globaux WordPress.
   Les styles dans @layer perdent toujours face aux styles non-layered
   (theme.json/blocs). On ré-affirme ici les couleurs critiques.
   ================================================================= */
a.btn { color: var(--_fg, #fff); text-decoration: none; }
.btn--ghost { --_fg: var(--brand); }
.btn--on-dark { --_fg: var(--ink); }
.btn:hover, .btn--accent:hover, .btn--devis:hover, .btn--ghost:hover { color: #fff; }
.btn--on-dark:hover { color: var(--ink); }
.hero h1, .page-hero h1, .page-hero .eyebrow, .cta-band h2, .cta-band h3, .cta-band p,
.section--dark h1, .section--dark h2, .section--dark h3, .section--dark h4,
.site-footer h4, .footer-brand .brand__wordmark { color: #fff; }
.page-hero p { color: var(--on-dark-muted); }
.hero h1 { color: #fff; }

/* =================================================================
   v4 — EXPÉRIENCE MOBILE PREMIUM (motions, styles, responsive)
   ================================================================= */

/* ---- Tiroir de navigation : entrée en cascade + raffinement ---- */
@media (max-width: 1024px) {
  .primary-nav {
    background:
      radial-gradient(130% 50% at 100% 0%, color-mix(in oklch, var(--brand) 8%, transparent), transparent 60%),
      var(--paper);
    padding-top: var(--space-xl);
  }
  .primary-nav a { font-family: var(--font-display); letter-spacing: .01em; }
  .primary-nav li, .nav-cta > * {
    opacity: 0; transform: translateY(12px);
    transition: opacity .5s var(--ease-out), transform .5s var(--ease-out);
  }
  body:has(.nav-toggle[aria-expanded="true"]) .primary-nav li,
  body:has(.nav-toggle[aria-expanded="true"]) .nav-cta > * { opacity: 1; transform: none; }
  body:has(.nav-toggle[aria-expanded="true"]) .primary-nav li:nth-child(1) { transition-delay: .10s; }
  body:has(.nav-toggle[aria-expanded="true"]) .primary-nav li:nth-child(2) { transition-delay: .16s; }
  body:has(.nav-toggle[aria-expanded="true"]) .primary-nav li:nth-child(3) { transition-delay: .22s; }
  body:has(.nav-toggle[aria-expanded="true"]) .primary-nav li:nth-child(4) { transition-delay: .28s; }
  body:has(.nav-toggle[aria-expanded="true"]) .primary-nav li:nth-child(5) { transition-delay: .34s; }
  body:has(.nav-toggle[aria-expanded="true"]) .primary-nav li:nth-child(6) { transition-delay: .40s; }
  body:has(.nav-toggle[aria-expanded="true"]) .nav-cta > *:nth-child(1) { transition-delay: .46s; }
  body:has(.nav-toggle[aria-expanded="true"]) .nav-cta > *:nth-child(2) { transition-delay: .52s; }
  body:has(.nav-toggle[aria-expanded="true"]) .nav-cta > *:nth-child(3) { transition-delay: .58s; }
  /* Hamburger / croix : rotation douce */
  .nav-toggle svg { transition: transform var(--dur-base) var(--ease-out); }
  .nav-toggle[aria-expanded="true"] .i-close { animation: spinIn var(--dur-base) var(--ease-out); }
  @keyframes spinIn { from { transform: rotate(-90deg); opacity: 0; } to { transform: none; opacity: 1; } }
}
@media (max-width: 1024px) and (prefers-reduced-motion: reduce) {
  .primary-nav li, .nav-cta > * { opacity: 1; transform: none; transition: none; }
  .nav-toggle[aria-expanded="true"] .i-close { animation: none; }
}

/* ---- Barre d'actions flottante (mobile) ---- */
.mobile-bar { display: none; }
@media (max-width: 640px) {
  .mobile-bar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 200;
    display: grid; grid-template-columns: 1fr 1.25fr 1fr; align-items: stretch; gap: .25rem;
    width: 100%; max-width: 100%; box-sizing: border-box; overflow: hidden;
    background: color-mix(in oklch, var(--paper) 92%, transparent);
    -webkit-backdrop-filter: blur(16px) saturate(160%); backdrop-filter: blur(16px) saturate(160%);
    border-top: 1px solid var(--line-soft);
    box-shadow: 0 -8px 28px oklch(0 0 0 / .12);
    padding: .35rem .4rem calc(.35rem + env(safe-area-inset-bottom, 0px));
    animation: barUp var(--dur-slow) var(--ease-out) both;
  }
  @keyframes barUp { from { transform: translateY(100%); } to { transform: none; } }
  .mobile-bar__item {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .15rem;
    min-width: 0; min-height: 52px; border-radius: 13px; text-decoration: none;
    color: var(--text); font-size: .66rem; font-weight: 700; letter-spacing: .01em;
    transition: transform var(--dur-fast) var(--ease-out); overflow: hidden;
  }
  .mobile-bar__item span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .mobile-bar__item:active { transform: scale(.94); }
  .mobile-bar__item svg { width: 21px; height: 21px; flex: 0 0 auto; }
  .mobile-bar__item--cta { background: linear-gradient(120deg, var(--brand-strong), var(--brand)); color: #fff; box-shadow: var(--shadow-brand); }
  .mobile-bar__item--wa svg { color: #25d366; }
  /* La barre remplace le bouton flottant WhatsApp sur mobile */
  .whatsapp-float { display: none; }
  /* Espace pour ne pas masquer le bas du contenu */
  body { padding-bottom: calc(74px + env(safe-area-inset-bottom, 0px)); }
}
@media (max-width: 640px) and (prefers-reduced-motion: reduce) {
  .mobile-bar { animation: none; }
}

/* ---- Hero mobile ---- */
@media (max-width: 640px) {
  .hero { min-height: 86svh; }
  .hero__inner { padding-block: clamp(3.5rem, 15vw, 5.5rem); max-width: 100%; }
  .hero h1 { font-size: clamp(2.3rem, 9.5vw, 3rem); }
  .hero::after {
    background:
      linear-gradient(180deg, color-mix(in oklch, var(--ink) 64%, transparent) 0%, color-mix(in oklch, var(--ink) 34%, transparent) 38%, color-mix(in oklch, var(--ink) 90%, transparent) 100%),
      radial-gradient(95% 45% at 80% 2%, color-mix(in oklch, var(--accent) 24%, transparent), transparent 55%);
  }
  .hero__actions { flex-direction: column; align-items: stretch; gap: .7rem; }
  .hero__actions .btn { width: 100%; }
  .hero__scroll { display: none; }
}

/* ---- Réglages tactiles & rythme mobile ---- */
@media (max-width: 640px) {
  .section { padding-block: clamp(2.75rem, 11vw, 4rem); }
  .section-head { margin-block-end: var(--space-l); }
  .btn { min-height: 50px; }                 /* cibles tactiles confortables */
  .header-search-toggle { width: 44px; height: 44px; }
  .feature-card { padding: 1.4rem; }
  .price-card { padding: 1.5rem; }
  .cta-band { padding: 2rem 1.4rem; }
  .stat__num { font-size: var(--step-2); }
  .footer-bottom { flex-direction: column; gap: .4rem; text-align: center; align-items: center; }
  /* éviter tout débordement horizontal */
  .container, .container-wide { width: min(100% - 2.2rem, var(--container-wide)); }
  /* Breadcrumb mobile : compact, retour à la ligne propre juste après le hero */
  .breadcrumb { padding-block: var(--space-s); font-size: .8rem; display: flex; flex-wrap: wrap; align-items: center; gap: .15rem .4rem; line-height: 1.4; }
  /* En-têtes de page : titres plus mesurés sur petit écran */
  .page-hero { padding-block: clamp(2.5rem, 12vw, 4rem) clamp(1.75rem, 6vw, 3rem); }
  .page-hero h1 { font-size: clamp(2rem, 8.5vw, 2.7rem); }
  .page-hero p { font-size: var(--step-0); }
  /* Splits internes (services / à propos) : espace vertical resserré, média d'abord */
  .split { gap: var(--space-l); }
  .split__media { aspect-ratio: 16 / 11; }
}

/* ---- Révélations : amplitude réduite sur mobile (plus fluide) ---- */
@media (max-width: 640px) {
  .js .reveal { transform: translateY(20px); }
  .js .stagger > * { transform: translateY(16px); }
}

/* =================================================================
   FIX tiroir mobile : le backdrop-filter de l'en-tête créait un bloc
   conteneur qui piégeait le tiroir position:fixed (taille + empilement
   cassés → il passait DERRIÈRE le hero). On neutralise le filtre en
   mobile : le tiroir se positionne alors relativement au viewport et
   s'empile correctement au-dessus du contenu.
   ================================================================= */
@media (max-width: 1024px) {
  .site-header { -webkit-backdrop-filter: none; backdrop-filter: none; background: var(--paper); }
  .primary-nav { z-index: 250; }
  /* Le tiroir couvre tout l'écran sous l'en-tête, opaque, au-dessus du hero */
  body:has(.nav-toggle[aria-expanded="true"]) .primary-nav { background: var(--paper); }
  /* Masquer la barre d'actions flottante quand le menu est ouvert (sinon elle passe au-dessus) */
  body:has(.nav-toggle[aria-expanded="true"]) .mobile-bar { display: none; }
  /* Idem pour le bouton WhatsApp flottant éventuel */
  body:has(.nav-toggle[aria-expanded="true"]) .whatsapp-float { display: none; }
}

/* =================================================================
   SIGNATURE MOBILE — « LE RAIL D'ASCENSION »
   L'ascenseur desktop est masqué < 1280px ; sur mobile, ce rail fin au
   bord gauche restitue la promesse « L'Ascension » : un sillage cyan qui
   croît au scroll (scaleY, GPU) coiffé d'une cabine qui descend (top).
   100% CSS scroll-driven, pointer-events:none, hors-flux (CLS=0), ne
   touche jamais le LCP du hero. Bloc NON-LAYERED en fin de fichier →
   gagne la cascade (comme .mobile-bar).
   ================================================================= */
.ascension-rail { display: none; }

@media (max-width: 640px) {
  .ascension-rail {
    position: fixed; left: 0; z-index: 150; pointer-events: none; display: block;
    top: calc(var(--header-h) + env(safe-area-inset-top, 0px));
    bottom: calc(74px + env(safe-area-inset-bottom, 0px)); /* dégage la barre d'actions flottante */
    width: 4px; border-radius: var(--radius-pill);
  }
  /* Masqué quand le tiroir plein écran est ouvert */
  body:has(.nav-toggle[aria-expanded="true"]) .ascension-rail { display: none; }

  .ascension-rail__shaft {
    position: absolute; inset: 0; border-radius: inherit;
    background: linear-gradient(180deg,
      color-mix(in oklch, var(--ink) 18%, transparent),
      color-mix(in oklch, var(--ink) 8%, transparent));
    box-shadow: inset 0 0 0 1px var(--line-soft);
  }
  /* Sillage : état de BASE statique (scaleY .28) → les navigateurs sans
     scroll-timeline (Safari iOS / Firefox) lisent un filet intentionnel. */
  .ascension-rail__wake {
    position: absolute; inset: 0; transform-origin: 50% 0%;
    transform: scaleY(.28); opacity: .3; border-radius: inherit; will-change: transform;
    background: linear-gradient(180deg,
      color-mix(in oklch, var(--accent) 16%, transparent) 0%,
      color-mix(in oklch, var(--accent) 48%, transparent) 68%,
      color-mix(in oklch, var(--accent) 78%, transparent) 100%);
  }
  /* Cabine : nœud de hauteur fixe qui voyage par `top` (même principe que la
     crête de progression desktop). Déborde légèrement (left/right -2px) pour
     se lire ; pas d'overflow:clip sur le rail afin de garder le débord + halo. */
  .ascension-rail__cabin {
    position: absolute; left: -2.5px; right: -2.5px; top: 0; height: 14px;
    border-radius: var(--radius-pill);
    background: linear-gradient(90deg, color-mix(in oklch, var(--accent) 70%, white), var(--accent), color-mix(in oklch, var(--accent) 70%, white));
    box-shadow: 0 0 9px var(--accent), 0 0 2px var(--accent), inset 0 0 2px color-mix(in oklch, #fff 85%, transparent);
    will-change: top;
  }
}
/* Mouvement scroll-driven : uniquement si supporté ; écrase l'état de base. */
@supports (animation-timeline: scroll(root block)) {
  @media (max-width: 640px) and (prefers-reduced-motion: no-preference) {
    .ascension-rail__wake { opacity: 1; animation: railWake linear both; animation-timeline: scroll(root block); }
    @keyframes railWake { from { transform: scaleY(0); } to { transform: scaleY(1); } }
    .ascension-rail__cabin { animation: railCabin linear both; animation-timeline: scroll(root block); }
    @keyframes railCabin { from { top: 0; } to { top: calc(100% - 14px); } }
  }
}
/* Reduced-motion : rail calme, filet plein, sans cabine mobile. */
@media (max-width: 640px) and (prefers-reduced-motion: reduce) {
  .ascension-rail__wake { transform: scaleY(1); opacity: .2; }
  .ascension-rail__cabin { display: none; }
}

/* ---- Hero mobile : retirer le flou (coût GPU/LCP) de l'entrée du texte ----
   On échange seulement le nom du keyframe (les délais/durées L286-288 restent). */
@media (max-width: 640px) {
  .hero__meta, .hero__lead, .hero__actions { animation-name: heroRiseMobile; }
  @keyframes heroRiseMobile { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: none; } }
}

/* ---- Cartes : physique de pression tactile (le :hover est mort au doigt) ---- */
@media (max-width: 640px) {
  .feature-card, .price-card {
    -webkit-tap-highlight-color: transparent;
    transition: transform var(--dur-fast) var(--ease-out),
                box-shadow var(--dur-fast) var(--ease-out),
                border-color var(--dur-fast) var(--ease-out);
  }
  .feature-card:active, .price-card:active {
    transform: scale(.975) translateY(2px);
    box-shadow: var(--shadow-1);
    border-color: color-mix(in oklch, var(--brand) 30%, var(--line));
  }
  .feature-card:active::before { scale: 1 1; }              /* allume la barre d'accent au tap */
  .feature-card .btn:active, .price-card .btn:active { transform: scale(.96); }
}
@media (max-width: 640px) and (prefers-reduced-motion: reduce) {
  .feature-card, .price-card { transition: none; }
  .feature-card:active, .price-card:active { transform: none; }
}
