/* ==========================================================================
   Perceval Création — page d'accueil
   ========================================================================== */

/* Hero : halos qui rappellent la sphère brillante du logo */
.hero { position: relative; padding: 72px 0 96px; }
.halo { position: absolute; border-radius: 50%; filter: blur(70px); opacity: .55; z-index: -1; animation: derive 18s ease-in-out infinite alternate; }
.halo-1 { width: 520px; height: 520px; background: var(--bleu-clair); top: -160px; right: -80px; }
.halo-2 { width: 380px; height: 380px; background: #ffc2b3; bottom: -140px; left: 30%; animation-duration: 22s; animation-delay: -6s; }
@keyframes derive { to { transform: translate(-60px, 50px) scale(1.12); } }

.hero .conteneur { display: grid; grid-template-columns: 1.1fr 1fr; gap: 48px; align-items: center; }
.pastille {
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--blanc); border: 1px solid var(--bordure); border-radius: 999px;
  font-weight: 500; font-size: .85rem; padding: 7px 16px 7px 10px; margin-bottom: 26px;
}
.pastille .point { width: 9px; height: 9px; border-radius: 50%; background: #22b573; animation: pulse 2.2s infinite; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(34, 181, 115, .6); }
  70%, 100% { box-shadow: 0 0 0 9px rgba(34, 181, 115, 0); }
}
.hero h1 { font-size: clamp(2.5rem, 5.4vw, 4.3rem); font-weight: 800; margin-bottom: 24px; }

/* Mot tournant du titre */
.mot-tournant { display: inline-grid; color: var(--bleu); vertical-align: bottom; }
.mot-tournant span { grid-area: 1 / 1; justify-self: start; position: relative; opacity: 0; transform: translateY(.45em); transition: opacity .5s, transform .5s; }
.mot-tournant span.actif { opacity: 1; transform: none; }
.mot-tournant span::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: .06em; height: .12em; border-radius: 4px;
  background: var(--corail); transform: scaleX(0); transform-origin: left; transition: transform .6s .25s;
}
.mot-tournant span.actif::after { transform: scaleX(1); }

.hero .intro { font-size: 1.15rem; color: var(--doux); max-width: 32em; margin-bottom: 32px; }
.hero .actions { margin-bottom: 34px; }
.garanties { display: grid; gap: 10px; font-weight: 500; font-size: .95rem; }
.garanties li { display: flex; align-items: center; gap: 12px; }
.garanties li::before {
  content: "✓"; display: grid; place-items: center; flex: none; width: 22px; height: 22px; border-radius: 50%;
  background: var(--bleu-pale); color: var(--bleu); font-size: .75rem; font-weight: 700;
}

/* Pile de captures flottantes */
.pile { position: relative; height: 480px; }
.ecran {
  position: absolute; width: 74%; margin: 0;
  background: var(--blanc); border: 1px solid var(--bordure); border-radius: 14px; overflow: hidden;
  box-shadow: 0 30px 60px -24px rgba(13, 18, 64, .35);
  transform: rotate(var(--r));
  transition: transform .5s var(--ressort);
  animation: flotte 7s ease-in-out infinite;
}
.ecran .barre { display: flex; gap: 6px; padding: 9px 12px; background: #f3f1ec; }
.ecran .barre i { width: 9px; height: 9px; border-radius: 50%; background: #d9d4c9; }
.ecran img { width: 100%; aspect-ratio: 5 / 3; object-fit: cover; object-position: top; }
.ecran:nth-child(1) { top: 0; left: 0; --r: -4deg; }
.ecran:nth-child(2) { top: 110px; right: 0; --r: 3deg; animation-delay: -2.3s; z-index: 2; }
.ecran:nth-child(3) { top: 220px; left: 8%; --r: -1deg; animation-delay: -4.6s; z-index: 3; }
.ecran:hover { z-index: 5; transform: rotate(0) scale(1.04); animation-play-state: paused; }
@keyframes flotte { 50% { translate: 0 -12px; } }

/* Bandeau défilant des références */
.defilant { position: relative; background: var(--nuit); color: var(--blanc); }
.defilant .fenetre { overflow: hidden; padding: 20px 0; mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent); }
.defilant .piste {
  display: flex; gap: 48px; width: max-content; padding-right: 48px;
  font-family: var(--titres); font-weight: 500; font-size: 1.15rem; white-space: nowrap;
  animation: defile 38s linear infinite;
}
.defilant:hover .piste { animation-play-state: paused; }
.defilant .piste li::after { content: "✦"; color: var(--bleu-clair); margin-left: 48px; }
@keyframes defile { to { transform: translateX(-50%); } }
.bouton-pause {
  position: absolute; right: 16px; top: 50%; transform: translateY(-50%); z-index: 2;
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--nuit); color: var(--blanc); border: 1px solid rgba(255, 255, 255, .3); border-radius: 999px;
  padding: 7px 14px; font: 500 .8rem/1 Inter, system-ui, sans-serif; cursor: pointer;
}
.bouton-pause:hover { border-color: var(--blanc); }
.bouton-pause .lecture { display: none; }
.bouton-pause[aria-pressed="true"] .lecture { display: inline; }
.bouton-pause[aria-pressed="true"] .pause { display: none; }

/* Chiffres */
.chiffres { padding: 72px 0 0; }
.chiffres .conteneur { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.chiffre { background: var(--blanc); border: 1px solid var(--bordure); border-radius: var(--rayon); padding: 26px; }
.chiffre strong { display: block; font-family: var(--titres); font-size: 2.6rem; font-weight: 800; color: var(--bleu); line-height: 1; margin-bottom: 8px; }
.chiffre > span { color: var(--doux); font-size: .92rem; }

/* Délais d'apparition propres à l'accueil */
.chiffres .apparait:nth-child(2) { transition-delay: .12s; }
.chiffres .apparait:nth-child(3) { transition-delay: .24s; }
.chiffres .apparait:nth-child(4) { transition-delay: .36s; }

/* Services */
.service { display: grid; grid-template-columns: auto 1fr; gap: 0 22px; }
.service .icone { grid-row: span 3; margin: 0; }

/* Réalisations */
.realisation { margin: 0; padding: 0; }
.realisation a { display: block; text-decoration: none; }
.realisation .vignette { overflow: hidden; border-bottom: 1px solid var(--bordure); background: #f3f1ec; }
.realisation img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; object-position: top; transition: transform 1.2s ease; }
.realisation:hover img { transform: scale(1.05); }
.realisation .legende { padding: 20px 24px 24px; }
.realisation h3 { font-size: 1.15rem; margin-bottom: 4px; }
.realisation p { font-size: .92rem; }
.realisation .externe { color: var(--bleu); font-weight: 600; font-size: .88rem; display: inline-block; margin-top: 10px; }


/* Méthode */
.etapes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 28px; position: relative; counter-reset: etape; }
.etapes::before, .etapes::after { content: ""; position: absolute; top: 24px; left: 24px; right: 24px; height: 2px; }
.etapes::before { background: var(--bordure); }
.etapes::after { background: var(--bleu); transform: scaleX(0); transform-origin: left; transition: transform 1.6s ease .3s; }
.etapes.visible::after, html:not(.js) .etapes::after { transform: scaleX(1); }
.etapes li { position: relative; z-index: 1; counter-increment: etape; }
.etapes li::before {
  content: counter(etape); display: grid; place-items: center; width: 50px; height: 50px; border-radius: 50%;
  background: var(--creme); border: 2px solid var(--bleu); color: var(--bleu);
  font-family: var(--titres); font-weight: 800; font-size: 1.2rem; margin-bottom: 18px;
}
.etapes h3 { font-size: 1.15rem; margin-bottom: 8px; }
.etapes p { color: var(--doux); font-size: .94rem; }

/* Témoignages */
.temoignage { margin: 0; display: flex; flex-direction: column; }
.temoignage blockquote { font-size: 1.02rem; color: var(--texte); flex: 1; }
.temoignage blockquote::before { content: "“"; display: block; font-family: var(--titres); font-size: 3.4rem; line-height: .8; color: var(--bleu-clair); }
.temoignage figcaption { margin-top: 20px; font-size: .9rem; color: var(--doux); }
.temoignage figcaption strong { color: var(--texte); display: block; }
.provisoire { display: inline-block; background: #fff3cd; color: #6b4e00; border-radius: 6px; padding: 2px 8px; font-size: .78rem; font-weight: 600; margin-bottom: 12px; }

/* Lego */
.lego .boite { position: relative; background: var(--nuit); color: var(--blanc); border-radius: 28px; display: grid; grid-template-columns: 1fr 1fr; overflow: hidden; }
.lego .boite::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(circle, rgba(255, 255, 255, .07) 7px, transparent 8px); background-size: 34px 34px;
}
.lego .texte { position: relative; padding: 56px; }
.lego .surtitre { color: var(--jaune); }
.lego h2 { color: var(--blanc); }
.lego p { color: #c3c8e6; margin-bottom: 18px; }
.lego .clients { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 28px; }
.lego .clients li { border: 1px solid rgba(255, 255, 255, .22); border-radius: 999px; padding: 5px 14px; font-size: .85rem; }
.lego .btn-plein { background: var(--jaune); color: var(--nuit); box-shadow: none; }
.lego .btn-plein:hover { background: #ffd770; }
.lego figure { position: relative; overflow: hidden; margin: 0; background: #000; }
.lego figure img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s ease; }
.lego .boite:hover figure img { transform: scale(1.05); }

/* Appel final */
.appel { text-align: center; }
.appel h2, .appel .chapo { margin-inline: auto; }
.appel .chapo { margin-bottom: 32px; }
.appel .actions { justify-content: center; margin-bottom: 0; }

/* Sur grand écran, le défilement s'arrête avant le bouton de pause au lieu de passer dessous */
@media (min-width: 901px) {
  .defilant .fenetre { margin-right: 270px; }
}

@media (max-width: 900px) {
  .hero .conteneur, .lego .boite { grid-template-columns: 1fr; }
  .chiffres .conteneur, .etapes { grid-template-columns: 1fr 1fr; }
  .etapes::before, .etapes::after { display: none; }
  .pile { height: 420px; }
  .lego .texte { padding: 40px 28px; }
  .bouton-pause { position: static; transform: none; margin: 0 auto 16px; display: flex; }
}
@media (max-width: 520px) {
  .chiffres .conteneur, .etapes { grid-template-columns: 1fr; }
  .pile { height: 340px; }
  .ecran { width: 86%; }
  .ecran:nth-child(2) { top: 80px; }
  .ecran:nth-child(3) { top: 160px; left: 4%; }
}
