/* danian.be, accueil : héros centré, démos en cartes empilées, mouvements harmonisés (1er novembre 2026).
   Une seule courbe pour tout : --dm-sortie (expo out). Une seule distance : 34px. Rien ne rebondit, rien ne tourne. */
:root { --dm-sortie: cubic-bezier(.16, 1, .3, 1); --dm-duree: .95s; }

/* ---------------------------------------------------------------- Lenis (ordinateur seulement) */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-stopped { overflow: clip; }

/* ---------------------------------------------------------------- Héros centré */
html body .dm-hero-centre .v-hero__top { display: flex; flex-direction: column; align-items: center; text-align: center; gap: clamp(20px, 2.2vw, 30px); max-width: 64rem; }
html body .dm-hero-centre .dm-hero-tete { display: flex; flex-direction: column; align-items: center; }
html body .dm-hero-centre .v-hero__titre { max-width: none; padding-top: 0; font-size: clamp(3rem, 1.2rem + 6.2vw, 6.6rem); }
html body .dm-hero-centre .v-hero__kicker { width: auto; max-width: none; margin-inline: auto; }
html body .dm-hero-centre .v-hero__deux { margin-inline: auto; max-width: 15em; }
html body .dm-hero-centre .v-hero__aside { display: flex; flex-direction: column; align-items: center; gap: 14px; padding-bottom: 0; }
html body .dm-hero-centre .v-hero__ligne { max-width: 34rem; }
html body .dm-hero-centre .v-hero__prix { max-width: 34rem; }
html body .dm-hero-centre .v-actions { justify-content: center; }
html body .dm-hero-centre .v-hero__garanties { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 28px; margin-top: 4px; text-align: left; }
html body .dm-hero-centre { padding-bottom: clamp(24px, 3vw, 44px); }
@media (width >= 1024px) {
  html body .dm-hero-centre::before {
    left: 0; width: 100%;
    background:
      radial-gradient(46% 38% at 50% 34%, rgba(110, 155, 255, .24), rgba(110, 155, 255, 0) 72%),
      radial-gradient(70% 46% at 50% 70%, rgba(12, 93, 254, .14), rgba(12, 93, 254, 0) 74%);
  }
}
@media (width < 700px) { html body .dm-hero-centre .v-hero__garanties { display: none; } }

/* Le héros entre une fois, au chargement, sans attendre aucun script. Chaque ligne du titre monte derrière son masque. */
@media (prefers-reduced-motion: no-preference) {
  html body .dm-hero-centre :is(.dm-annonce, .v-hero__kicker, .v-hero__aside > *) { animation: dm-monte var(--dm-duree) var(--dm-sortie) backwards; }
  html body .dm-hero-centre .dm-annonce { animation-delay: .05s; }
  html body .dm-hero-centre .v-hero__kicker { animation-delay: .12s; }
  html body .dm-hero-centre :is(.v-hero__une, .v-hero__deux) { animation: dm-ligne 1.15s var(--dm-sortie) backwards; }
  html body .dm-hero-centre .v-hero__une { animation-delay: .2s; }
  html body .dm-hero-centre .v-hero__deux { animation-delay: .34s; }
  html body .dm-hero-centre .v-hero__aside > :nth-child(1) { animation-delay: .5s; }
  html body .dm-hero-centre .v-hero__aside > :nth-child(2) { animation-delay: .58s; }
  html body .dm-hero-centre .v-hero__aside > :nth-child(3) { animation-delay: .66s; }
  html body .dm-hero-centre .v-hero__aside > :nth-child(4) { animation-delay: .74s; }
}
@keyframes dm-monte { 0% { opacity: 0; translate: 0 34px; } }
@keyframes dm-ligne { 0% { opacity: 0; translate: 0 .45em; clip-path: inset(0 0 100% 0); } 60% { opacity: 1; } 100% { clip-path: inset(0 0 -20% 0); } }

/* Les blocs du reste de la page : même montée, même courbe (remplace l'ancienne de 14px / .56s). */
@media screen and (prefers-reduced-motion: no-preference) {
  html body [data-rv].est-vu:not(.est-direct) { animation: v-monte var(--dm-duree) var(--dm-sortie) calc(var(--rv-i, 0) * 90ms) backwards; }
}
@keyframes v-monte { 0% { opacity: 0; translate: 0 34px; } }

/* Titres de section : chaque mot monte derrière son masque (mots préparés par dm-pile.js). */
.dm-m { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: .12em; margin-bottom: -.12em; }
.dm-m > span { display: inline-block; }
@media (prefers-reduced-motion: no-preference) {
  .dm-mots-prets .dm-m > span { translate: 0 108%; transition: translate 1s var(--dm-sortie); transition-delay: calc(var(--m, 0) * 45ms); }
  .dm-mots-prets.est-vu .dm-m > span { translate: 0 0; }
  /* Mots montés (dm-pile-2.js) : plus de masque ni de décalage, le titre ne coûte plus rien au défilement. */
  .dm-mots-prets.est-vu.est-pose .dm-m { overflow: visible; }
  .dm-mots-prets.est-vu.est-pose .dm-m > span { translate: none; transition: none; }
}

/* ---------------------------------------------------------------- La pile de démos */
html body .dm-pile { --pile-haut: 88px; padding-block: clamp(40px, 6vw, 96px) clamp(64px, 9vw, 140px); }
html body .dm-pile__tete { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 16px; margin-bottom: clamp(32px, 4.5vw, 64px); }
html body .dm-pile__sur {
  display: inline-flex; align-items: center; gap: 9px; margin: 0; padding: 7px 14px 7px 11px; border: 1px solid var(--joint); border-radius: 999px;
  background: rgba(255, 255, 255, .7); color: var(--pierre); font: 600 .8125rem/1 var(--f-studio); letter-spacing: .01em;
}
html body .dm-pile__sur span { width: 7px; height: 7px; border-radius: 50%; background: var(--cobalt); box-shadow: 0 0 0 4px rgba(12, 93, 254, .14); }
html body .dm-pile__titre { max-width: 17ch; margin: 0; }
@media (width >= 900px) { html body .dm-pile__titre { max-width: 21ch; } }
html body .dm-pile__intro { margin: 0; color: var(--pierre-douce); }

html body .dm-pile__liste { list-style: none; margin-block: 0; display: grid; gap: clamp(20px, 3vh, 36px); }
html body .dm-pile__item { position: sticky; top: calc(var(--pile-haut) + var(--i) * 14px); }
html body .dm-pile__carte {
  --echelle: 1; --voile: 0;
  position: relative; display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  height: clamp(460px, calc(100svh - var(--pile-haut) - 140px), 600px); overflow: hidden; border-radius: 28px; color: #fff; isolation: isolate;
  background:
    radial-gradient(55% 75% at 80% 78%, color-mix(in srgb, var(--accent) 46%, transparent), transparent 70%),
    radial-gradient(40% 50% at 10% 0%, rgba(255, 255, 255, .06), transparent 70%),
    #12181d;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .07), 0 -18px 40px -28px rgba(10, 20, 30, .35), 0 36px 70px -40px rgba(10, 20, 30, .6);
  transform: scale(var(--echelle)); transform-origin: 50% 0; will-change: transform;
}
html body .dm-pile__carte::after { content: ""; position: absolute; inset: 0; z-index: 3; border-radius: inherit; background: #05080b; opacity: var(--voile); pointer-events: none; }
/* Le voile posé par dm-pile-2.js : sa propre couche, l'assombrir ne redessine pas la carte. */
html body .dm-pile__voile { position: absolute; inset: 0; z-index: 3; background: #05080b; opacity: 0; pointer-events: none; will-change: opacity; }
html.dm-pile-voile body .dm-pile__carte::after { content: none; }

html body .dm-pile__texte { position: relative; z-index: 2; display: flex; flex-direction: column; align-items: flex-start; gap: 22px; padding: clamp(28px, 3.4vw, 52px); min-width: 0; }
html body .dm-pile__num { margin: 0; font: 600 .875rem/1 var(--f-studio); font-variant-numeric: tabular-nums; color: rgba(255, 255, 255, .86); letter-spacing: .02em; }
html body .dm-pile__num span { color: rgba(255, 255, 255, .42); }
html body .dm-pile__marque { display: flex; align-items: center; gap: 14px; margin-top: auto; }
html body .dm-pile__ico { width: 52px; height: 52px; border-radius: 14px; flex: none; box-shadow: 0 0 0 1px rgba(255, 255, 255, .12); }
html body .dm-pile__nom { margin: 0 0 6px; line-height: 0; }
html body .dm-pile__nom img { width: auto; height: 20px; max-width: 220px; object-fit: contain; object-position: 0 50%; filter: brightness(0) invert(1); }
html body .dm-pile__metier { margin: 0; color: rgba(255, 255, 255, .62); font-size: .9375rem; line-height: 1.3; }
html body .dm-pile__fonction { margin: 0; max-width: 13ch; font: 650 clamp(1.8rem, 1rem + 1.7vw, 2.75rem)/1.02 var(--f-studio); letter-spacing: -.032em; text-wrap: balance; }
html body .dm-pile__ouvrir {
  display: inline-flex; align-items: center; gap: 10px; min-height: 50px; padding: 0 22px; border-radius: 999px;
  background: #fff; color: var(--pierre); font: 600 1rem/1 var(--f-studio); text-decoration: none;
  transition: background-color .25s var(--dm-sortie), color .25s var(--dm-sortie), translate .45s var(--dm-sortie);
}
html body .dm-pile__ouvrir svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: translate .45s var(--dm-sortie); }
html body .dm-pile__ouvrir:is(:hover, :focus-visible) { background: var(--cobalt); color: #fff; }
html body .dm-pile__ouvrir:is(:hover, :focus-visible) svg { translate: 2px -2px; }
html body .dm-pile__ouvrir:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }

html body .dm-pile__ecran {
  position: relative; z-index: 1; align-self: end; display: block; margin: 56px 0 0; border-radius: 14px 0 0 0; overflow: hidden;
  background: #0b0f13; box-shadow: 0 0 0 1px rgba(255, 255, 255, .1), -30px -10px 80px -30px rgba(0, 0, 0, .6);
  text-decoration: none; transition: translate .7s var(--dm-sortie);
}
html body .dm-pile__barre { display: flex; align-items: center; gap: 7px; height: 36px; padding: 0 14px; background: #161d23; border-bottom: 1px solid rgba(255, 255, 255, .06); }
html body .dm-pile__barre i { width: 9px; height: 9px; border-radius: 50%; background: rgba(255, 255, 255, .18); }
html body .dm-pile__url { margin-left: 12px; padding: 4px 12px; border-radius: 999px; background: rgba(255, 255, 255, .06); color: rgba(255, 255, 255, .55); font: 500 .75rem/1.2 var(--f-studio); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
html body .dm-pile__photo { display: block; aspect-ratio: 16 / 10; overflow: hidden; }
html body .dm-pile__photo img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 0; transition: scale 1.1s var(--dm-sortie); }
@media (hover: hover) {
  html body .dm-pile__carte:has(.dm-pile__ouvrir:hover, .dm-pile__ecran:hover) .dm-pile__ecran { translate: 0 -8px; }
  html body .dm-pile__carte:has(.dm-pile__ouvrir:hover, .dm-pile__ecran:hover) .dm-pile__photo img { scale: 1.03; }
}

/* Entrée d'une carte (une fois) : le texte monte, l'écran glisse de sa place. */
@media (prefers-reduced-motion: no-preference) {
  html.dm-pile-pret .dm-pile__item:not(.est-vu) :is(.dm-pile__num, .dm-pile__marque, .dm-pile__fonction, .dm-pile__ouvrir) { opacity: 0; translate: 0 34px; }
  html.dm-pile-pret .dm-pile__item:not(.est-vu) .dm-pile__ecran { opacity: 0; translate: 48px 48px; }
  html.dm-pile-pret .dm-pile__item :is(.dm-pile__num, .dm-pile__marque, .dm-pile__fonction, .dm-pile__ouvrir) { transition: opacity .8s var(--dm-sortie), translate var(--dm-duree) var(--dm-sortie), background-color .25s var(--dm-sortie), color .25s var(--dm-sortie); }
  html.dm-pile-pret .dm-pile__item .dm-pile__ecran { transition: opacity .9s var(--dm-sortie), translate 1.15s var(--dm-sortie); transition-delay: .12s; }
  html.dm-pile-pret .dm-pile__item .dm-pile__marque { transition-delay: .06s; }
  html.dm-pile-pret .dm-pile__item .dm-pile__fonction { transition-delay: .12s; }
  html.dm-pile-pret .dm-pile__item .dm-pile__ouvrir { transition-delay: .18s; }
  html.dm-pile-pret .dm-pile__item.est-vu .dm-pile__ouvrir:is(:hover, :focus-visible) { transition-delay: 0s; }
}

/* Tablette et téléphone : le texte au-dessus, l'écran dessous, qui touche le bord. */
@media (width < 900px) {
  html body .dm-pile { --pile-haut: 78px; }
  html body .dm-pile__item { top: calc(var(--pile-haut) + var(--i) * 6px); }
  html body .dm-pile__carte { grid-template-columns: minmax(0, 1fr); height: auto; border-radius: 22px; }
  html body .dm-pile__texte { gap: 16px; padding: 24px 22px 22px; }
  html body .dm-pile__marque { margin-top: 0; order: -1; }
  html body .dm-pile__num { position: absolute; top: 24px; right: 22px; }
  html body .dm-pile__ico { width: 44px; height: 44px; border-radius: 12px; }
  html body .dm-pile__nom img { height: 17px; max-width: 190px; }
  html body .dm-pile__metier { font-size: .875rem; }
  html body .dm-pile__fonction { max-width: 16ch; font-size: clamp(1.45rem, 1.05rem + 2vw, 1.9rem); }
  html body .dm-pile__ouvrir { min-height: 46px; padding: 0 18px; font-size: .9375rem; }
  html body .dm-pile__ecran { margin: 0 0 0 22px; border-radius: 12px 0 0 0; }
  html body .dm-pile__barre { height: 28px; gap: 5px; padding: 0 10px; }
  html body .dm-pile__barre i { width: 7px; height: 7px; }
  html body .dm-pile__url { margin-left: 8px; font-size: .6875rem; padding: 3px 10px; }
  html body .dm-pile__photo { aspect-ratio: 16 / 9; }
}
@media (width < 900px) and (prefers-reduced-motion: no-preference) {
  html.dm-pile-pret .dm-pile__item:not(.est-vu) .dm-pile__ecran { translate: 0 40px; }
}

@media (prefers-reduced-motion: reduce) {
  html body .dm-pile__carte { transform: none; }
  html body .dm-pile__carte::after { opacity: 0; }
}

/* La fenêtre de démo reste cliquable même pendant le défilement doux. */
html.lenis.lenis-smooth .dm-fenetre iframe { pointer-events: auto; }
