/*
  global-motion.css — shared motion + design tokens
  Reference: Heritage Museum (Zajno) editorial restraint
  Lens: Jakub Krehel (production polish) > Emil Kowalski (restraint) > Jhey (delighters)
*/

:root {
  --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
  --ease-out-expo:  cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring:    cubic-bezier(0.34, 1.56, 0.64, 1);

  --dur-fast: 180ms;
  --dur-med:  320ms;
  --dur-slow: 560ms;
  --dur-reveal: 720ms;

  --reveal-distance: 28px;
  --reveal-stagger: 80ms;

  --motion-walnut: #8B5A33;
  --motion-sand:   #D9CDB8;
  --motion-charcoal: #111111;
  --motion-offwhite: #F8F7F4;
}

/* ─────────────────────────────────────────────────────────────────
   SCROLL REVEAL — opt-in via data-reveal
   <div data-reveal>            → fade + 28px slide-up
   <div data-reveal="up">       → same
   <div data-reveal="left">     → slide from -28px
   <div data-reveal="right">    → slide from +28px
   <div data-reveal="scale">    → scale 0.96 → 1
   <div data-reveal="mask">     → clip-path mask reveal (editorial)
   <div data-reveal data-reveal-delay="200"> → ms delay
   Containers can use data-reveal-stagger on a parent; children with
   data-reveal-child get auto-staggered.
   ───────────────────────────────────────────────────────────────── */

[data-reveal] {
  opacity: 0;
  transition:
    opacity var(--dur-reveal) var(--ease-out-quart),
    transform var(--dur-reveal) var(--ease-out-expo);
}
[data-reveal]:not(.is-visible) {
  will-change: opacity, transform;
}
[data-reveal] { transform: translate3d(0, var(--reveal-distance), 0); }
[data-reveal="left"]  { transform: translate3d(calc(var(--reveal-distance) * -1), 0, 0); }
[data-reveal="right"] { transform: translate3d(var(--reveal-distance), 0, 0); }
[data-reveal="scale"] { transform: scale(0.96); }
[data-reveal="mask"]  {
  clip-path: inset(0 0 100% 0);
  transform: none;
  opacity: 1;
}

[data-reveal].is-visible,
[data-reveal][data-reveal="left"].is-visible,
[data-reveal][data-reveal="right"].is-visible,
[data-reveal][data-reveal="scale"].is-visible,
[data-reveal][data-reveal="mask"].is-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
  clip-path: inset(0 0 0 0);
}

/* Legacy GSAP-style class — when ANY .section-reveal also has .is-visible,
   force it visible. Some pages declare `.section-reveal { opacity: 0 }` inline
   with the same specificity as ours; this !important guard wins regardless of
   inline source-order. */
.section-reveal.is-visible {
  opacity: 1 !important;
  transform: none !important;
}

/* ─────────────────────────────────────────────────────────────────
   GEOMETRIC ACCENT BADGES — Heritage Museum circle pattern
   <span class="accent-badge accent-badge-walnut">A family that …</span>
   ───────────────────────────────────────────────────────────────── */

.accent-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 9rem;
  height: 9rem;
  border-radius: 999px;
  background: var(--motion-walnut);
  color: var(--motion-offwhite);
  font-family: "Cormorant Garamond", serif;
  font-style: italic;
  font-size: 0.95rem;
  line-height: 1.25;
  text-align: center;
  padding: 0 1.25rem;
  transform: rotate(-6deg);
  box-shadow: 0 12px 32px -12px rgba(139, 90, 51, 0.35);
}
.accent-badge-sand     { background: var(--motion-sand); color: var(--motion-charcoal); }
.accent-badge-charcoal { background: var(--motion-charcoal); color: var(--motion-offwhite); }

/* ─────────────────────────────────────────────────────────────────
   EDITORIAL DIVIDER — Heritage Museum thin horizontal line
   <hr class="rule-thin"> or <div class="rule-thin"></div>
   ───────────────────────────────────────────────────────────────── */

.rule-thin {
  width: 100%;
  height: 1px;
  background: rgba(17, 17, 17, 0.18);
  border: 0;
  margin: 1.25rem 0;
}
.rule-thin-walnut { background: rgba(139, 90, 51, 0.32); }

/* ─────────────────────────────────────────────────────────────────
   SECTION LABEL — uppercase letter-spaced caption (editorial)
   <span class="section-label">Onze formules — 04</span>
   ───────────────────────────────────────────────────────────────── */

.section-label {
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--motion-walnut);
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
}
.section-label::before {
  content: "";
  width: 1.5rem;
  height: 1px;
  background: currentColor;
  display: inline-block;
}

/* ─────────────────────────────────────────────────────────────────
   DISPLAY HEADING — restrained editorial scale
   ───────────────────────────────────────────────────────────────── */

.h-editorial {
  font-family: "Cormorant Garamond", serif;
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 0.98;
  color: var(--motion-charcoal);
}

/* ─────────────────────────────────────────────────────────────────
   IMAGE PERFORMANCE — async-decode, fade in once loaded
   ───────────────────────────────────────────────────────────────── */

img[loading="lazy"] {
  opacity: 0;
  transition: opacity var(--dur-med) var(--ease-out-quart);
}
img[loading="lazy"].is-loaded,
img[loading="lazy"][data-loaded="true"] {
  opacity: 1;
}

/* ─────────────────────────────────────────────────────────────────
   QUIET HOVER — for editorial cards, use sparingly
   ───────────────────────────────────────────────────────────────── */

.card-quiet {
  transition:
    transform var(--dur-med) var(--ease-out-expo),
    box-shadow var(--dur-med) var(--ease-out-expo);
}
.card-quiet:hover {
  transform: translate3d(0, -2px, 0);
}

/* ─────────────────────────────────────────────────────────────────
   NO-SCRIPT FALLBACK — when JS disabled, show all reveal content
   immediately so the page never traps content invisible.
   ───────────────────────────────────────────────────────────────── */

@media (scripting: none) {
  [data-reveal] {
    opacity: 1 !important;
    transform: none !important;
    clip-path: none !important;
  }
  img[loading="lazy"] { opacity: 1 !important; }
}

/* Belt-and-braces: if scroll-reveal.js never runs for any reason
   (network failure, CSP block), reveal everything after 3 s with a real ease. */
@keyframes reveal-failsafe-show {
  from { opacity: 0; transform: translate3d(0, var(--reveal-distance), 0); }
  to   { opacity: 1; transform: none; }
}
[data-reveal]:not(.is-visible) {
  animation: reveal-failsafe-show var(--dur-reveal) var(--ease-out-quart) 3000ms forwards;
}

/* ─────────────────────────────────────────────────────────────────
   REDUCED MOTION — mandatory accessibility guard
   ───────────────────────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  [data-reveal],
  [data-reveal].is-visible {
    opacity: 1 !important;
    transform: none !important;
    clip-path: none !important;
    transition: none !important;
  }
  img[loading="lazy"] { opacity: 1 !important; transition: none !important; }
  .accent-badge { transform: rotate(0deg) !important; }
}
