/* ============ ALPINE ============ */
[x-cloak] { display: none !important; }

/* ============ FONDATIONS ============ */
::selection { background: #D4A017; color: #0A3A24; }

:focus-visible {
  outline: 2.5px solid #D4A017;
  outline-offset: 3px;
  border-radius: 4px;
}

/* ============ TEXTURES ============ */
.texture-dots {
  background-image: radial-gradient(circle, rgba(250, 247, 241, 0.15) 1px, transparent 1px);
  background-size: 16px 16px;
}

.texture-grain {
  position: relative;
}
.texture-grain::before {
  content: '';
  position: absolute; inset: 0;
  pointer-events: none;
  opacity: .5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.05'/%3E%3C/svg%3E");
}
.w-full .h-full .object-cover{
  position: inherit;
  width: 20px;
}
/* Motif losange inspiré des tissus wax — très discret, jamais décoratif à outrance */
.texture-wax {
  background-image:
    linear-gradient(45deg, rgba(212,160,23,0.06) 25%, transparent 25%, transparent 75%, rgba(212,160,23,0.06) 75%),
    linear-gradient(45deg, rgba(212,160,23,0.06) 25%, transparent 25%, transparent 75%, rgba(212,160,23,0.06) 75%);
  background-size: 34px 34px;
  background-position: 0 0, 17px 17px;
}

/* ============ SCEAU INSTITUTIONNEL ============ */
.seal-ring {
  position: relative;
  display: flex; align-items: center; justify-content: center;
}
.seal-ring::before {
  content: '';
  position: absolute; inset: -10px;
  border-radius: 9999px;
  border: 1.5px dashed rgba(232, 193, 88, 0.55);
  animation: spin-slow 40s linear infinite;
}
.seal-ring::after {
  content: '';
  position: absolute; inset: -3px;
  border-radius: 9999px;
  border: 1px solid rgba(232, 193, 88, 0.35);
}
@keyframes spin-slow { to { transform: rotate(360deg); } }

/* ============ CARTES "CARNET DE CRÉDIT" (paliers de financement) ============ */
.passbook {
  position: relative;
  background-image: radial-gradient(circle at 8px 0, transparent 7px, currentColor 7.5px, currentColor 8px, transparent 8.5px);
  background-size: 20px 16px;
  background-repeat: repeat-x;
  background-position: -6px top;
}
.passbook-card {
  position: relative;
  isolation: isolate;
}
.passbook-card::before {
  content: '';
  position: absolute;
  top: -1px; left: 14px; right: 14px;
  height: 8px;
  background-image: radial-gradient(circle, #FAF7F1 6px, transparent 6.5px);
  background-size: 10px 6px;
  background-repeat: repeat-x;
  background-position: left top;
  z-index: 2;
}

/* ============ CHEMIN ASCENDANT (signature) ============ */
.stair-step {
  transition: transform .3s cubic-bezier(.2,.8,.2,1), box-shadow .3s ease;
}
.stair-step:hover {
  transform: translateY(-8px);
  box-shadow: 0 24px 48px -14px rgba(10, 58, 36, 0.4);
}

/* ============ LIENS SOULIGNÉS PROGRESSIFS ============ */
.link-grow {
  position: relative;
  background-image: linear-gradient(currentColor, currentColor);
  background-position: 0 100%;
  background-repeat: no-repeat;
  background-size: 0% 1.5px;
  transition: background-size .3s ease;
}
.link-grow:hover { background-size: 100% 1.5px; }

/* ============ REVEAL AU SCROLL ============ */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  animation: reveal .7s cubic-bezier(.2,.7,.2,1) forwards;
}
@keyframes reveal {
  to { opacity: 1; transform: translateY(0); }
}
.reveal-1 { animation-delay: .08s; }
.reveal-2 { animation-delay: .16s; }
.reveal-3 { animation-delay: .24s; }
.reveal-4 { animation-delay: .32s; }
.reveal-5 { animation-delay: .4s; }

/* ============ SCROLLBAR (discrète) ============ */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: #FAF7F1; }
::-webkit-scrollbar-thumb { background: #0F5132; border-radius: 999px; border: 2px solid #FAF7F1; }

@media (prefers-reduced-motion: reduce) {
  .stair-step { transition: none; }
  .reveal, .reveal-1, .reveal-2, .reveal-3, .reveal-4, .reveal-5 { animation: none; opacity: 1; transform: none; }
  .seal-ring::before { animation: none; }
  .link-grow { transition: none; }
}

/* ============================================================
   PASSE ANIMATION — révélation au scroll, compteurs, flottaison
   ============================================================ */

/* Révélation déclenchée par IntersectionObserver (site.js) plutôt
   qu'au chargement : chaque section s'anime quand elle entre à l'écran. */
[data-reveal] {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .8s cubic-bezier(.16,.8,.24,1), transform .8s cubic-bezier(.16,.8,.24,1);
}
[data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
}
[data-reveal="scale"] { transform: translateY(18px) scale(.96); }
[data-reveal="scale"].is-visible { transform: translateY(0) scale(1); }
[data-reveal="left"] { transform: translateX(-32px); }
[data-reveal="left"].is-visible { transform: translateX(0); }
[data-reveal="right"] { transform: translateX(32px); }
[data-reveal="right"].is-visible { transform: translateX(0); }

/* Décalage en cascade pour les grilles de cartes (nth-child) */
[data-reveal-group] > * { transition-delay: calc(var(--reveal-i, 0) * 90ms); }

/* Flottaison lente des halos décoratifs */
.float-slow { animation: float-slow 9s ease-in-out infinite; }
.float-slow-delay { animation: float-slow 11s ease-in-out infinite 1.5s; }
@keyframes float-slow {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(14px, -18px); }
}

/* Navbar réactive au scroll */
.navbar-scrolled {
  box-shadow: 0 8px 24px -12px rgba(10,58,36,0.18);
}

/* Sweep lumineux sur les CTA principaux */
.btn-shine {
  position: relative;
  overflow: hidden;
}
.btn-shine::after {
  content: '';
  position: absolute;
  top: 0; left: -60%;
  width: 40%; height: 100%;
  background: linear-gradient(115deg, transparent, rgba(255,255,255,0.55), transparent);
  transform: skewX(-20deg);
  transition: left .7s ease;
}
.btn-shine:hover::after { left: 130%; }

/* Tilt léger au survol des cartes (complète .stair-step) */
.tilt-card {
  transition: transform .35s cubic-bezier(.2,.8,.2,1), box-shadow .35s ease;
  transform-style: preserve-3d;
}
.tilt-card:hover {
  box-shadow: 0 20px 40px -18px rgba(10,58,36,0.28);
}

/* Bouton retour en haut */
#scroll-top {
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity .3s ease, transform .3s ease;
}
#scroll-top.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

/* Soulignement animé façon "trait de plume" pour les titres clés */
.underline-draw {
  position: relative;
  display: inline-block;
}
.underline-draw::after {
  content: '';
  position: absolute;
  left: 0; bottom: -4px;
  width: 100%; height: 3px;
  background: currentColor;
  border-radius: 2px;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .6s cubic-bezier(.16,.8,.24,1);
}
[data-reveal].is-visible .underline-draw::after { transform: scaleX(1); }

/* Scroll doux (respecte reduced-motion plus bas) */
html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  [data-reveal] { opacity: 1; transform: none; transition: none; }
  .float-slow, .float-slow-delay { animation: none; }
  .btn-shine::after { display: none; }
  html { scroll-behavior: auto; }
}
