/* Mouvement : sobre, court, toujours lisible à l'arrêt.
   Rien n'est caché par défaut : les éléments ne sont masqués que par le JavaScript
   (classe .reveal), donc tout reste visible si le JS ne tourne pas. */

@keyframes fade-up {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

/* Apparition douce au défilement (16 px au plus, 600 ms) */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 700ms cubic-bezier(0.22, 1, 0.36, 1) var(--rd, 0ms), transform 700ms cubic-bezier(0.22, 1, 0.36, 1) var(--rd, 0ms);
}
.reveal.is-in { opacity: 1; transform: none; }
/* Photos : elles se posent doucement (léger zoom arrière) */
.reveal--img { transform: scale(1.04); transition-duration: 1100ms; }
.reveal--img.is-in { transform: none; }

/* Transition entre pages (navigateurs compatibles) */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
  ::view-transition-old(root) { animation: 160ms var(--ease) both vt-out; }
  ::view-transition-new(root) { animation: 260ms var(--ease) both vt-in; }
}
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; transform: translateY(8px); } }

/* ---------- Ouverture : tout arrive en douceur, dans l'ordre ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes drop { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }
@keyframes name-rise {
  from { opacity: 0; transform: translateY(45%); clip-path: inset(0 0 100% 0); }
  to   { opacity: 1; transform: none; clip-path: inset(0 0 -12% 0); }
}
@keyframes settle { from { transform: scale(1.08); } to { transform: scale(1); } }
@keyframes print-a { from { opacity: 0; transform: translateY(30px) rotate(-11deg); } to { opacity: 1; transform: rotate(-4deg); } }
@keyframes print-b { from { opacity: 0; transform: translateY(30px) rotate(10deg); } to { opacity: 1; transform: rotate(3deg); } }

.site-header { animation: drop 700ms cubic-bezier(0.22, 1, 0.36, 1) both; }

/* Accueil */
.hero__first, .hero__last { animation: name-rise 1100ms cubic-bezier(0.22, 1, 0.36, 1) both; }
.hero__first { animation-delay: 150ms; }
.hero__last { animation-delay: 330ms; }
.hero__tagline { animation: rise 900ms cubic-bezier(0.22, 1, 0.36, 1) 750ms both; }
.hero__side { animation: fade 1200ms ease 1100ms both; }
.hero__controls { animation: fade 900ms ease 1200ms both; }
.hero__slide.is-active .hero__img { animation: settle 9s cubic-bezier(0.22, 1, 0.36, 1) both; }

/* Pages intérieures : titre et texte d'introduction montent l'un après l'autre */
.page-head > *, .page-head > div > * { animation: rise 850ms cubic-bezier(0.22, 1, 0.36, 1) both; }
.page-head > :nth-child(2), .page-head > div > :nth-child(2) { animation-delay: 110ms; }
.page-head > :nth-child(3), .page-head > div > :nth-child(3) { animation-delay: 220ms; }
.page-head--split .prints { animation: none; }
.print--a { animation: print-a 1000ms cubic-bezier(0.22, 1, 0.36, 1) 300ms both; }
.print--b { animation: print-b 1000ms cubic-bezier(0.22, 1, 0.36, 1) 450ms both; }
.about__text > *, .about__portrait { animation: rise 850ms cubic-bezier(0.22, 1, 0.36, 1) both; }
.about__text > :nth-child(2) { animation-delay: 100ms; }
.about__text > :nth-child(3) { animation-delay: 200ms; }
.about__text > :nth-child(4) { animation-delay: 300ms; }
.about__portrait { animation-delay: 150ms; }

/* Boutons : légère montée au survol */
.btn { transition: background-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), transform var(--t-med) var(--ease); }
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

@media (prefers-reduced-motion: reduce) {
  .reveal, .reveal--img { opacity: 1; transform: none; transition: none; }
  .hero__slide.is-active .hero__img { animation: none; }
  .btn:hover { transform: none; }
}

/* ---------- v4 : apparitions plus visibles, titres mot à mot, photos qui se dévoilent ---------- */
.site-header { animation: drop 700ms cubic-bezier(0.22, 1, 0.36, 1) backwards; transition: transform 550ms cubic-bezier(0.22, 1, 0.36, 1), border-color 300ms var(--ease); }
.site-header.is-hidden { transform: translateY(-100%); }

.reveal {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 1000ms cubic-bezier(0.22, 1, 0.36, 1) var(--rd, 0ms), transform 1000ms cubic-bezier(0.22, 1, 0.36, 1) var(--rd, 0ms);
}

/* Titres : chaque mot monte depuis un masque */
.split .wm { display: inline-block; overflow: hidden; vertical-align: top; padding: 0 0.05em 0.16em; margin: 0 -0.05em -0.16em; }
.split .wm__i { display: inline-block; transform: translateY(115%); transition: transform 1000ms cubic-bezier(0.22, 1, 0.36, 1) calc(var(--i, 0) * 60ms); }
.split.is-in .wm__i { transform: none; }

/* Photos : un rideau se lève et la photo se pose (le cadre observé n'est jamais masqué) */
.reveal--clip, .reveal--clip.reveal { opacity: 1; transform: none; transition: none; }
.reveal--clip picture { clip-path: inset(100% 0 0 0); transition: clip-path 1300ms cubic-bezier(0.22, 1, 0.36, 1) var(--rd, 0ms); }
.reveal--clip picture img { transform: scale(1.2); transition: transform 1800ms cubic-bezier(0.22, 1, 0.36, 1) var(--rd, 0ms); }
.reveal--clip.is-in picture { clip-path: inset(0 0 0 0); }
.reveal--clip.is-in picture img { transform: scale(1); }
.reveal--clip .work-card__meta { opacity: 0; transform: translateY(10px); transition: opacity 800ms ease calc(var(--rd, 0ms) + 700ms), transform 800ms cubic-bezier(0.22, 1, 0.36, 1) calc(var(--rd, 0ms) + 700ms); }
.reveal--clip.is-in .work-card__meta { opacity: 1; transform: none; }
.reveal--clip .work-card__zoom { scale: 0; transition: scale 600ms cubic-bezier(0.34, 1.56, 0.64, 1) calc(var(--rd, 0ms) + 1000ms); }
.reveal--clip.is-in .work-card__zoom { scale: 1; }

/* Petits effets au survol */
.offer { transition: transform 500ms cubic-bezier(0.22, 1, 0.36, 1); }
.offer:hover { transform: translateY(-6px); }
.process__list li .process__n { display: block; transition: transform 500ms cubic-bezier(0.22, 1, 0.36, 1), color 300ms; }
.process__list li:hover .process__n { transform: translateX(8px); }
.nav__cta span { display: inline-block; transition: transform 350ms cubic-bezier(0.22, 1, 0.36, 1); }
.nav__cta:hover span { transform: translate(3px, -3px); }
.work-card__zoom { transition: transform 400ms cubic-bezier(0.22, 1, 0.36, 1), background-color 300ms; }
.work-card:hover .work-card__zoom { transform: rotate(90deg); background: var(--signal); }

/* Effets liés au défilement (navigateurs compatibles) : ligne de progression, cartes qui dérivent, photo qui se déplace */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    body::before { content: ""; position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 130; background: var(--signal); transform-origin: 0 50%; transform: scaleX(0); animation: progress linear both; animation-timeline: scroll(root); pointer-events: none; }
    @keyframes progress { to { transform: scaleX(1); } }
    .work-card:nth-child(3n+2) { animation: drift-a linear both; animation-timeline: view(); animation-range: cover 0% cover 100%; }
    .work-card:nth-child(3n) { animation: drift-b linear both; animation-timeline: view(); animation-range: cover 0% cover 100%; }
    @keyframes drift-a { from { translate: 0 3.5rem; } to { translate: 0 -3.5rem; } }
    @keyframes drift-b { from { translate: 0 -1.75rem; } to { translate: 0 1.75rem; } }
    .break__img img { animation: break-par linear both; animation-timeline: view(); }
    @keyframes break-par { from { translate: 0 -7%; scale: 1.18; } to { translate: 0 7%; scale: 1.18; } }
  }
}
@media (prefers-reduced-motion: reduce) {
  .split .wm__i { transform: none; transition: none; }
  .reveal--clip picture, .reveal--clip picture img, .reveal--clip .work-card__meta, .reveal--clip .work-card__zoom { clip-path: none; transform: none; scale: 1; opacity: 1; transition: none; }
  .site-header.is-hidden { transform: none; }
}
