/* Piliers de service : ce que site-web, logiciel-sur-mesure et
   application-mobile partagent au-delà du socle. Le héros en scène, les
   repères chiffrés, la galerie, l'ancrage Vendée, la révélation lourde.
   Chaque pilier garde ensuite sa feuille pour ce qui n'appartient qu'à lui. */

/* Les piliers sont bleus, quel que soit le service : les accents corail et
   sarcelle du socle d'origine ne s'appliquent plus ici. */
body,
body.software,
body.application {
  --accent: var(--blue);
  --soft: #e9eeff;
}

/* Le héros règle lui-même sa marge sous la barre flottante. */
body:not(:has(main.accueil)) main.pilier {
  padding-top: 0;
}

/* Révélation plus lourde que celle du socle, comme sur l'accueil. */
.anim .pilier [data-anim] {
  opacity: 0;
  transform: translateY(30px);
  filter: blur(10px);
  transition: opacity 1s var(--ressort), transform 1s var(--ressort), filter 1s var(--ressort);
  transition-delay: calc(var(--i, 0) * 90ms);
}
.anim .pilier [data-anim].vu {
  opacity: 1;
  transform: none;
  filter: blur(0);
}

/* ---------- HÉROS ---------- */
.scene-hero {
  position: relative;
  overflow: clip;
  min-height: 100dvh;
  padding: 128px 20px 72px;
  display: grid;
  align-content: center;
  gap: 56px;
}
.scene-copy {
  width: min(100%, 1240px);
  margin: 0 auto;
}
.titre-masque {
  margin: 26px 0 0;
  font: 700 clamp(44px, 5.8vw, 86px) / 0.94 "Bricolage Grotesque";
  letter-spacing: -0.05em;
}
.titre-masque .mot {
  display: inline-block;
  overflow: hidden;
  vertical-align: bottom;
  padding: 0 0.04em 0.08em 0;
  margin-right: 0.02em;
}
.titre-masque .mot > span {
  display: inline-block;
  transform: translateY(112%);
  animation: monte 1.1s var(--ressort) forwards;
  animation-delay: calc(0.08s + var(--i, 0) * 0.06s);
}
.titre-masque .accent > span {
  color: var(--blue);
}
@keyframes monte {
  to {
    transform: translateY(0);
  }
}
.lead {
  max-width: 30em;
  margin: 28px 0 0;
  color: var(--muted);
  font-size: clamp(17px, 1.6vw, 21px);
  line-height: 1.5;
}
.scene-hero .actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 26px;
  margin-top: 36px;
}

/* Le héros sombre : encre, texte papier, cadres éclaircis */
.scene-hero.sombre {
  background: var(--ink);
  color: var(--paper);
}
.scene-hero.sombre .lead {
  color: rgba(248, 246, 241, 0.65);
}
.scene-hero.sombre .pill {
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.08);
  color: var(--paper);
}
.scene-hero.sombre .titre-masque .accent > span {
  color: #9db7ff;
}
.scene-hero.sombre .lien-nu {
  color: var(--paper);
}
.scene-hero.sombre .btn {
  background: var(--paper);
  color: var(--ink);
}
.scene-hero.sombre .btn i {
  background: rgba(17, 24, 39, 0.08);
}
.scene-hero.sombre .btn:hover {
  background: white;
}
.scene-hero.sombre .cadre {
  background: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12), 0 60px 120px -30px rgba(0, 0, 0, 0.7);
}
.scene-hero.sombre .cadre .coeur {
  background: #0b0f1a;
}
.scene-hero.sombre .halo {
  background: radial-gradient(closest-side, rgba(53, 108, 244, 0.45), rgba(53, 108, 244, 0.12) 55%, transparent 75%);
}

/* La scène : un grand cadre, sa version téléphone devant, halo bleu */
.scene {
  position: relative;
  width: min(100%, 1240px);
  margin: 0 auto;
  aspect-ratio: 16 / 11;
  animation: apparait 1.4s var(--ressort) 0.35s both;
}
@keyframes apparait {
  from {
    opacity: 0;
    transform: translateY(40px);
    filter: blur(14px);
  }
  to {
    opacity: 1;
    transform: none;
    filter: blur(0);
  }
}
.halo {
  position: absolute;
  inset: -10% -5% auto;
  height: 90%;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(53, 108, 244, 0.32), rgba(53, 108, 244, 0.08) 55%, transparent 75%);
  filter: blur(30px);
  pointer-events: none;
}
.cadre-site {
  position: absolute;
  left: 0;
  top: 2%;
  width: 86%;
  --rayon: 30px;
  --bord: 8px;
  box-shadow: inset 0 0 0 1px rgba(17, 24, 39, 0.07), var(--ombre-portee);
  transform: rotate(-1.5deg);
  animation: flotte 8s ease-in-out infinite alternate;
}
.cadre-site .coeur {
  aspect-ratio: 16 / 10;
}
.cadre-site img {
  height: 100%;
  object-fit: cover;
  object-position: top;
}
/* Le film est en 16/9 : le cadre prend son format, rien n'est rogné. */
.cadre-site .coeur:has(video) {
  aspect-ratio: 16 / 9;
}
.cadre-site video {
  height: 100%;
  object-fit: contain;
}
.cadre-poche {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 25%;
  --rayon: 34px;
  --bord: 6px;
  box-shadow: inset 0 0 0 1px rgba(17, 24, 39, 0.07), var(--ombre-portee);
  transform: rotate(4deg);
  animation: flotte 9s ease-in-out 1s infinite alternate-reverse;
}
.etiquette {
  position: absolute;
  left: 4%;
  bottom: 6%;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 12px 18px 12px 14px;
  border-radius: 999px;
  background: rgba(248, 246, 241, 0.86);
  box-shadow: inset 0 0 0 1px rgba(17, 24, 39, 0.08), var(--ombre-douce);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--ink);
  font: 600 14px "DM Sans";
  animation: flotte 7s ease-in-out 0.5s infinite alternate;
}
.etiquette i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.18);
}
@keyframes flotte {
  from {
    translate: 0 0;
  }
  to {
    translate: 0 -12px;
  }
}

/* ---------- HÉROS : trois téléphones en éventail ---------- */
.eventail {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 4%;
  width: min(100%, 1240px);
  margin: 0 auto;
  padding: 24px 0 0;
  animation: apparait 1.4s var(--ressort) 0.35s both;
}
.eventail .cadre {
  --rayon: 38px;
  --bord: 7px;
  width: 30%;
  box-shadow: inset 0 0 0 1px rgba(17, 24, 39, 0.07), var(--ombre-portee);
  animation: flotte 8s ease-in-out infinite alternate;
}
.eventail .cadre.centre {
  width: 34%;
  z-index: 2;
  animation-delay: -2s;
}
.eventail .cadre.gauche {
  transform: rotate(-7deg) translateY(28px);
  animation-delay: -1s;
}
.eventail .cadre.droite {
  transform: rotate(7deg) translateY(28px);
  animation-delay: -3s;
}
.eventail .coeur {
  aspect-ratio: 9 / 19.5;
  background: #0b0f1a;
}
.eventail .coeur img {
  height: 100%;
  object-fit: cover;
  object-position: top;
}
.eventail .halo {
  inset: 10% 0 auto;
  height: 80%;
}
.eventail .etiquette {
  left: auto;
  right: 2%;
  bottom: 12%;
  z-index: 3;
}


/* ---------- MANIFESTE : titre collant, texte large surligné ---------- */
.manifeste {
  display: grid;
  gap: 32px;
  align-items: start;
}
.manifeste h2 {
  margin: 0;
  font: 700 clamp(38px, 5vw, 68px) / 0.98 "Bricolage Grotesque";
  letter-spacing: -0.045em;
}
.manifeste-texte p {
  margin: 0 0 22px;
  font-size: clamp(18px, 1.7vw, 23px);
  line-height: 1.45;
  color: var(--ink);
}
.manifeste-texte p:last-child {
  margin-bottom: 0;
}
.manifeste-texte strong {
  font-weight: 600;
  background: linear-gradient(rgba(53, 108, 244, 0.16), rgba(53, 108, 244, 0.16)) no-repeat 0 78% / 100% 0.42em;
}


/* ---------- REPÈRES ---------- */
.reperes-section {
  padding-top: 0;
  padding-bottom: 0;
}
.reperes {
  display: grid;
  margin: 0 auto;
  border-top: 1px solid rgba(17, 24, 39, 0.12);
  border-bottom: 1px solid rgba(17, 24, 39, 0.12);
}
.reperes div {
  padding: 28px 0;
  border-bottom: 1px solid rgba(17, 24, 39, 0.08);
}
.reperes div:last-child {
  border-bottom: 0;
}
.reperes dt {
  font: 800 clamp(40px, 4.4vw, 60px) / 0.95 "Bricolage Grotesque";
  letter-spacing: -0.05em;
}
.reperes dd {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 15px;
}

/* ---------- GALERIE ---------- */
.galerie-section {
  background: white;
}
.galerie {
  display: grid;
  gap: 40px 26px;
}
.galerie figure {
  margin: 0;
  transition: transform 0.7s var(--ressort);
}
.galerie figure:hover {
  transform: translateY(-8px);
}
.galerie .coeur {
  aspect-ratio: 1600 / 1000;
}
.galerie .coeur img {
  height: 100%;
  object-fit: cover;
  object-position: top;
}
.galerie .ouvrir {
  display: block;
  color: inherit;
  text-decoration: none;
}
.galerie figcaption {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-top: 18px;
}
.galerie figcaption b {
  font: 700 22px "Bricolage Grotesque";
  letter-spacing: -0.02em;
}
.galerie figcaption span {
  color: var(--muted);
  font-size: 15px;
}
.demo-lien {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  color: var(--blue-texte);
  text-decoration: none;
  font: 600 15px "DM Sans";
}
.demo-lien i {
  font-style: normal;
  transition: transform 0.4s var(--ressort);
}
.demo-lien:hover i {
  transform: translate(2px, -2px);
}
.galerie-suite {
  margin: 48px auto 0;
}

/* ---------- ANCRAGE VENDÉE ---------- */
.ancrage-section {
  padding-top: 0;
}
.ancrage {
  display: grid;
  gap: 28px;
  padding: 40px;
  border-radius: 30px;
  background: var(--ink);
  color: var(--paper);
}
.ancrage h2 {
  margin: 0;
  font: 700 clamp(30px, 3.4vw, 46px) / 1 "Bricolage Grotesque";
  letter-spacing: -0.045em;
}
.ancrage p {
  margin: 16px 0 0;
  max-width: 30em;
  color: rgba(248, 246, 241, 0.65);
}
.ancrage .btn {
  align-self: center;
  justify-self: start;
}

/* Les puces des communes, sous le maillage d'un pilier Vendée ou l'ancrage d'un pilier de service. */
.communes-puces {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 28px 0 0;
}
.communes-puces span {
  width: 100%;
  margin-bottom: 4px;
  color: var(--muted);
  font: 600 11px "DM Sans";
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.communes-puces a {
  padding: 9px 14px;
  border: 1px solid rgba(17, 24, 39, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--ink);
  text-decoration: none;
  font: 500 14px "DM Sans";
  transition: background 0.4s var(--ressort), color 0.4s var(--ressort), border-color 0.4s var(--ressort);
}
.communes-puces a:hover {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--paper);
}

.ancrage-section .communes-puces {
  width: min(100%, 1240px);
  margin: 22px auto 0;
}

/* Parallaxe pilotée par le défilement, sans écouteur JS */
@supports (animation-timeline: view()) {
  .cadre-site,
  .cadre-poche {
    animation: flotte 8s ease-in-out infinite alternate, derive linear both;
    animation-timeline: auto, view();
    animation-range: normal, entry 0% exit 100%;
  }
  .cadre-poche {
    animation-name: flotte, derive-lente;
  }
  @keyframes derive {
    from { translate: 0 60px; }
    to { translate: 0 -80px; }
  }
  @keyframes derive-lente {
    from { translate: 0 30px; }
    to { translate: 0 -140px; }
  }
}

/* ---------- Réactif ---------- */
@media (min-width: 700px) {
  .reperes {
    grid-template-columns: repeat(4, 1fr);
  }
  .reperes div {
    padding: 36px 28px;
    border-bottom: 0;
    border-left: 1px solid rgba(17, 24, 39, 0.08);
  }
  .reperes div:first-child {
    padding-left: 0;
    border-left: 0;
  }
  .galerie {
    grid-template-columns: repeat(12, 1fr);
  }
  .g-cafe { grid-column: span 7; }
  .g-amelec { grid-column: span 5; }
  .g-loko { grid-column: span 5; }
  .g-easy { grid-column: span 7; }
  .ancrage {
    grid-template-columns: 1fr auto;
    padding: 56px;
  }
}
@media (min-width: 980px) {
  .scene-hero {
    grid-template-columns: 0.82fr 1.18fr;
    align-items: center;
    gap: 24px;
    padding: 140px 0 80px max(40px, calc((100vw - 1240px) / 2));
  }
  .scene-copy,
  .scene {
    width: auto;
    margin: 0;
  }
  .scene {
    margin-right: -6vw;
    aspect-ratio: 16 / 10.5;
  }
  .cadre-site {
    width: 90%;
  }
  .cadre-poche {
    width: 21%;
    right: 3%;
  }
  .objections.trois {
    grid-template-columns: repeat(3, 1fr);
  }
  .eventail {
    width: auto;
    margin: 0;
    padding: 0;
    gap: 3%;
  }
  .eventail .cadre {
    width: 31%;
  }
  .eventail .cadre.centre {
    width: 36%;
  }
  .manifeste {
    grid-template-columns: 0.9fr 1.1fr;
    gap: 64px;
  }
  .manifeste h2 {
    position: sticky;
    top: 120px;
  }
}
@media (max-width: 699px) {
  .cadre-site,
  .cadre-poche {
    transform: none;
    animation: flotte 8s ease-in-out infinite alternate;
  }
  .scene {
    margin-top: 24px;
  }
  .etiquette {
    display: none;
  }
  .eventail {
    gap: 3%;
  }
  .eventail .cadre.gauche,
  .eventail .cadre.droite {
    transform: none;
  }
  .eventail .etiquette {
    display: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  .titre-masque .mot > span {
    animation: none;
    transform: none;
  }
  .scene,
  .cadre-site,
  .cadre-poche,
  .etiquette {
    animation: none;
  }
  .anim .pilier [data-anim] {
    filter: none;
    transition-duration: 0.3s;
  }
  .galerie figure,
  .communes-puces a {
    transition: none;
  }
  .eventail,
  .eventail .cadre {
    animation: none;
  }
}

/* Téléphone : les repères en grille deux par deux, le héros moins haut. */
@media (max-width: 699px) {
  .reperes {
    grid-template-columns: 1fr 1fr;
    gap: 0 20px;
    padding: 6px 0;
  }
  .reperes div {
    padding: 18px 0;
    border-bottom: 0;
  }
  .reperes dt {
    font-size: 30px;
  }
  .reperes dd {
    margin-top: 6px;
    font-size: 13px;
    line-height: 1.4;
  }
  .scene-hero {
    min-height: 0;
    padding: 108px 20px 48px;
    gap: 36px;
  }
  .lead {
    margin-top: 20px;
    font-size: 17px;
  }
  .scene-hero .actions {
    margin-top: 26px;
    gap: 18px;
  }
  .ancrage {
    padding: 30px 26px;
  }
  .manifeste-texte p {
    font-size: 18px;
  }
}
