/* SnowRush Services — carrousels, bandeau et motion design (page d'accueil) */

/* ---------- Progression + en-tête ---------- */
.progress {
  position: absolute; left: 0; bottom: -1px; height: 2px; width: 100%;
  background: var(--blue); transform: scaleX(0); transform-origin: left; pointer-events: none;
}
.site-header { transition: box-shadow 0.3s ease; }
.site-header.scrolled { box-shadow: 0 8px 24px -16px rgba(18, 48, 90, 0.45); }

/* ---------- Boutons ---------- */
.btn { transition: transform 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease, color 0.2s ease; }
.btn:active { transform: scale(0.98); }
.btn .arr { display: inline-block; margin-left: 8px; transition: transform 0.2s ease; }
@media (hover: hover) {
  .btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 26px -12px rgba(18, 48, 90, 0.7); }
  .btn-primary:hover .arr { transform: translateX(4px); }
  .btn-ghost:hover { transform: translateY(-2px); }
}

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden;
  background:
    radial-gradient(900px 420px at 90% -10%, #DCEAF6 0%, rgba(220, 234, 246, 0) 62%),
    radial-gradient(700px 360px at -10% 105%, #E4EFF8 0%, rgba(228, 239, 248, 0) 62%),
    var(--bg);
}
.snow { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; }
.hero .hero-grid { position: relative; z-index: 1; }

.line { display: block; overflow: hidden; padding-bottom: 0.1em; margin-bottom: -0.1em; }
.line > span { display: block; }

.hero-media {
  position: relative; border-radius: 20px; overflow: hidden; aspect-ratio: 4 / 3;
  background: var(--panel); box-shadow: 0 30px 60px -32px rgba(18, 48, 90, 0.5);
  -webkit-mask-image: -webkit-radial-gradient(white, black); /* corrige le rognage arrondi sous Safari */
}
.hero-media .plx {
  position: absolute; left: 0; right: 0; top: -7%; height: 114%;
  transform: translate3d(0, var(--py, 0px), 0); will-change: transform;
}
.hero-media img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 62%; }
.badge {
  position: absolute; left: 14px; bottom: 14px; z-index: 2;
  display: inline-flex; align-items: center; gap: 10px;
  padding: 10px 16px; border-radius: 999px;
  background: rgba(243, 247, 250, 0.92);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  font-size: 14px; font-weight: 600; color: var(--ink);
  box-shadow: 0 10px 24px -12px rgba(0, 0, 0, 0.45);
}
.badge i { width: 8px; height: 8px; border-radius: 50%; background: #2BB673; animation: pulse 2s ease-out infinite; }

/* ---------- Carrousels horizontaux ---------- */
.rail {
  display: flex; gap: 14px; list-style: none; margin: 0 -20px; padding: 4px 20px 18px;
  overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding: 0 20px;
  overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.rail::-webkit-scrollbar { display: none; }
.rail > * { flex: 0 0 min(82%, 330px); scroll-snap-align: start; }

.dots { display: flex; justify-content: center; gap: 6px; margin-top: -2px; }
.dots span { width: 8px; height: 8px; border-radius: 999px; background: rgba(18, 48, 90, 0.2); transition: width 0.3s ease, background-color 0.3s ease; }
.dots span.on { width: 24px; background: var(--blue); }
.dark .dots span { background: rgba(243, 247, 250, 0.3); }
.dark .dots span.on { background: #fff; }

/* Services : cartes en verre sur fond sombre */
.card {
  position: relative; display: flex; flex-direction: column; gap: 10px;
  padding: 22px; min-height: 230px; border-radius: 18px;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.10), rgba(255, 255, 255, 0.03));
  border: 1px solid rgba(243, 247, 250, 0.16);
  transition: transform 0.35s cubic-bezier(0.2, 0.7, 0.2, 1), border-color 0.35s ease, background-color 0.35s ease;
}
.card-ico { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: rgba(159, 195, 230, 0.16); margin-bottom: 8px; }
.card-ico svg { width: 26px; height: 26px; }
.card-n { position: absolute; top: 20px; right: 22px; font-family: var(--display); font-stretch: 112%; font-weight: 800; font-size: 14px; letter-spacing: 0.08em; color: rgba(207, 224, 240, 0.55); }
.card h3 { margin: 0; font-size: 21px; font-weight: 600; }
.card p { margin: 0; font-size: 16px; line-height: 1.6; color: var(--sky); }

/* Contrat : cartes blanches */
.step {
  display: flex; flex-direction: column; gap: 8px;
  background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 22px; min-height: 220px;
  box-shadow: 0 18px 40px -30px rgba(18, 48, 90, 0.5);
  transition: transform 0.35s cubic-bezier(0.2, 0.7, 0.2, 1), box-shadow 0.35s ease;
}
.step-n { font-family: var(--display); font-stretch: 112%; font-weight: 800; font-size: 48px; line-height: 1; color: var(--blue); margin-bottom: 6px; }
.step h3 { margin: 0; font-size: 20px; font-weight: 600; }
.step p { margin: 0; font-size: 16px; line-height: 1.6; color: var(--muted); }

/* ---------- Bandeau des communes ---------- */
.marquee {
  overflow: hidden; padding: 4px 0;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
}
.marquee + .marquee { margin-top: 10px; }
.track { display: flex; flex-wrap: wrap; gap: 10px; padding: 0 20px; }
.track ul { display: flex; flex-wrap: wrap; gap: 10px; list-style: none; margin: 0; padding: 0; }
.js .track { flex-wrap: nowrap; width: max-content; padding: 0; animation: marq 44s linear infinite; }
.js .marquee.rev .track { animation-direction: reverse; animation-duration: 52s; }
.js .marquee:hover .track { animation-play-state: paused; }
.js .track ul { flex-wrap: nowrap; }
.chip {
  white-space: nowrap; padding: 10px 18px; font-size: 16px; line-height: 1.3;
  background: #fff; border: 1px solid var(--field); border-radius: 999px; color: var(--ink);
}
.zone-head { margin-bottom: 24px; }

/* ---------- Révélations au défilement ---------- */
.js .reveal { opacity: 0; transform: translateY(26px); transition: opacity 0.8s cubic-bezier(0.2, 0.7, 0.2, 1), transform 0.8s cubic-bezier(0.2, 0.7, 0.2, 1); transition-delay: calc(var(--i, 0) * 90ms); }
.js .reveal.in { opacity: 1; transform: none; }

/* ---------- Entrée du hero ---------- */
.js .rise { opacity: 0; animation: rise 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) forwards; animation-delay: calc(var(--d, 0) * 110ms + 120ms); }
.js .line > span { transform: translateY(108%); animation: lineup 1s cubic-bezier(0.2, 0.8, 0.2, 1) forwards; animation-delay: calc(var(--d, 0) * 130ms + 160ms); }
.js .hero-media { clip-path: inset(0 0 100% 0 round 20px); animation: unveil 1.2s cubic-bezier(0.2, 0.8, 0.2, 1) 0.3s forwards; }
.js .hero-media img { animation: settle 2s cubic-bezier(0.2, 0.7, 0.2, 1) 0.3s both; }

@keyframes rise   { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes lineup { to { transform: translateY(0); } }
@keyframes unveil { to { clip-path: inset(0 0 0 0 round 20px); } }
@keyframes settle { from { transform: scale(1.14); } to { transform: scale(1); } }
@keyframes marq   { to { transform: translateX(-50%); } }
@keyframes pulse  { 0% { box-shadow: 0 0 0 0 rgba(43, 182, 115, 0.55); } 70% { box-shadow: 0 0 0 10px rgba(43, 182, 115, 0); } 100% { box-shadow: 0 0 0 0 rgba(43, 182, 115, 0); } }

/* ---------- Tablette et plus ---------- */
@media (min-width: 768px) {
  .rail { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin: 0; padding: 0; overflow: visible; scroll-snap-type: none; }
  .rail > * { flex: none; }
  .dots { display: none; }
  .card { min-height: 280px; padding: 28px; }
  .step { min-height: 250px; padding: 28px; }
  .chip { font-size: 17px; padding: 12px 22px; }
  .zone-head { margin-bottom: 32px; }
  .hero-media { border-radius: 24px; }
  .badge { left: 20px; bottom: 20px; }
}
@media (hover: hover) and (min-width: 768px) {
  .js .card.reveal.in:hover, .js .step.reveal.in:hover { transform: translateY(-6px); }
  .card:hover { transform: translateY(-6px); border-color: rgba(243, 247, 250, 0.4); background: linear-gradient(160deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.05)); }
  .step:hover { transform: translateY(-6px); box-shadow: 0 26px 50px -28px rgba(18, 48, 90, 0.6); }
}

/* ---------- Mouvement réduit ---------- */
@media (prefers-reduced-motion: reduce) {
  .js .reveal, .js .rise, .js .line > span, .js .hero-media, .js .hero-media img { opacity: 1; transform: none; clip-path: none; animation: none; transition: none; }
  .snow { display: none; }
  .badge i { animation: none; }
  .js .track { animation: none; width: auto; flex-wrap: wrap; padding: 0 20px; }
  .js .track ul { flex-wrap: wrap; }
  .track ul[aria-hidden="true"] { display: none; }
  .marquee { -webkit-mask-image: none; mask-image: none; }
  .btn, .card, .step { transition: none; }
}
