/* Animations du site : discrètes, au service du fil et de la broderie.
   Toutes coupées si le système demande moins de mouvement. */

/* ---------- Transitions entre pages (navigateurs récents ; les autres naviguent normalement) ---------- */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: vt-out .28s ease-in both; }
::view-transition-new(root) { animation: vt-in .5s var(--ease) both; }
@keyframes vt-out { to { opacity: 0; transform: translateY(-8px); } }
@keyframes vt-in { from { opacity: 0; transform: translateY(12px); } }
.top { view-transition-name: entete; }
::view-transition-group(entete) { animation: none; }

/* ---------- Fil de progression : un point de couture doré qui court en haut de page ---------- */
.thread {
  position: fixed; inset: 0 0 auto 0; z-index: 60; height: 3px; pointer-events: none;
  background: radial-gradient(circle, var(--gold) 1.2px, transparent 1.6px) 0 50% / 8px 3px repeat-x;
  transform-origin: left; transform: scaleX(var(--p, 0));
}
@supports (animation-timeline: scroll()) {
  .thread { animation: grow-x linear both; animation-timeline: scroll(root); }
  @keyframes grow-x { from { transform: scaleX(0); } to { transform: scaleX(1); } }
}

/* ---------- Héros ---------- */
.js .split-word { display: inline-block; overflow: clip; vertical-align: top; padding-bottom: .08em; margin-bottom: -.08em; }
.js .split-word > span { display: inline-block; transform: translateY(105%); animation: word-up .9s var(--ease) both; animation-delay: calc(.15s + var(--w) * 70ms); }
@keyframes word-up { to { transform: none; } }
.js .hero .eyebrow, .js .hero .lead, .js .hero__cta, .js .hero .proof { animation: soft-up .9s var(--ease) both; }
.js .hero .eyebrow { animation-delay: .05s; }
.js .hero .lead { animation-delay: .55s; }
.js .hero__cta { animation-delay: .7s; }
.js .hero .proof { animation-delay: .85s; }
@keyframes soft-up { from { opacity: 0; transform: translateY(14px); } }

/* La couture de l'arche avance doucement, comme une aiguille. */
.hero__stitch path { animation: stitch-run 26s linear infinite; }
@keyframes stitch-run { to { stroke-dashoffset: -180; } }
.hero__tag { animation: pop-in .8s var(--ease) .45s both, float 6s ease-in-out 1.4s infinite; }
@keyframes float { 50% { translate: 0 -8px; } }
.hero__tag::before { animation: spin 40s linear infinite; }
@keyframes spin { to { rotate: 360deg; } }

@supports (animation-timeline: view()) {
  .hero__img { animation: hero-in 1.1s var(--ease) both, drift linear both; animation-timeline: auto, scroll(root); animation-range: normal, 0 100vh; }
  @keyframes drift { to { object-position: 50% 70%; } }
  .hero__mini { animation: pop-in .8s var(--ease) .45s both, mini-drift linear both; animation-timeline: auto, scroll(root); animation-range: normal, 0 100vh; }
  @keyframes mini-drift { to { translate: 0 -40px; } }
}

/* ---------- Photos qui se dévoilent ---------- */
.js [data-reveal] .card__media img, .js [data-reveal] .guide__pic img, .js .story__art[data-reveal] img {
  clip-path: inset(100% 0 0 0); transition: clip-path 1.1s var(--ease), transform var(--slow) var(--ease); transition-delay: calc(var(--i, 0) * 80ms + .1s);
}
.js [data-reveal].is-in .card__media img, .js [data-reveal].is-in .guide__pic img, .js .story__art[data-reveal].is-in img { clip-path: inset(0 0 0 0); }



/* Cartes produit : l'ombre se pose */
.card__media { transition: box-shadow var(--base) ease, transform var(--base) var(--ease); }
.card:hover .card__media { box-shadow: var(--shadow-m); transform: translateY(-4px); }

/* ---------- Boutons : reflet satiné au survol ---------- */
.btn { position: relative; overflow: hidden; isolation: isolate; }
.btn::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(110deg, transparent 30%, rgb(255 255 255 / 18%) 50%, transparent 70%);
  transform: translateX(-120%); transition: transform .8s var(--ease);
}
.btn:hover::after { transform: translateX(120%); }

/* ---------- Panier ---------- */
.cart-count.bump { animation: bump .6s var(--ease); }
@keyframes bump { 30% { transform: scale(1.5); } 60% { transform: scale(.9); } }
.fly { position: fixed; z-index: 95; width: 56px; height: 56px; border-radius: 14px; object-fit: cover; pointer-events: none; box-shadow: var(--shadow-m); transition: transform .75s cubic-bezier(.5, -.2, .3, 1), opacity .75s ease; }

/* ---------- En-tête : se resserre au défilement ---------- */
.top__in { transition: min-height var(--base) var(--ease); }
@media (min-width: 1040px) { .top.is-stuck .top__in { min-height: 66px; } }

/* ---------- Étapes : le numéro se dessine ---------- */
.js .steps li[data-reveal] { border-top-color: transparent; background: radial-gradient(circle, var(--gold) 1px, transparent 1.4px) 0 0 / 8px 2px repeat-x; background-size: 0 2px; transition: opacity var(--slow) var(--ease), transform var(--slow) var(--ease), background-size 1.4s var(--ease); }
.js .steps li[data-reveal].is-in { background-size: 8px 2px; }

/* ---------- Atelier : le tambour respire, le fil change en douceur ---------- */
.hoop svg .bro-art { transition: opacity .3s ease; }
.atelier .hoop { animation: breathe 7s ease-in-out infinite; }
@keyframes breathe { 50% { transform: rotate(-1.5deg) translateY(-4px); } }
.bro-text, .bro-line, .bro-c1 { transition: fill .5s ease, stroke .5s ease; }

@media (prefers-reduced-motion: reduce) {
  .js .split-word > span { transform: none; animation: none; }
  .js [data-reveal] img { clip-path: none !important; }
  .hero__stitch path, .atelier .hoop, .hero__tag { animation: none !important; }
  ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
}

/* 28/11/2026 : plus d'apparition au défilement, tout s'affiche directement. */
.js [data-reveal] { opacity: 1 !important; transform: none !important; transition: none !important; }
.js [data-reveal] img { clip-path: none !important; transition: none !important; }
.js .steps li[data-reveal] { background-size: 8px 2px !important; transition: none !important; }
