/* motion-base.css - L0 baseline motion for every site, no library. Pair with motion-base.js
   and the head snippet from web-motion/SKILL.md (adds html.js, failsafe html.mb-off). */
:root {
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --ease-in-out: cubic-bezier(.77, 0, .175, 1);   /* things that move on screen (slides, tabs indicator) */
  --ease-drawer: cubic-bezier(.32, .72, 0, 1);    /* menus/drawers/sheets sliding in */
  --dur: .7s;
  --dist: 24px;
  interpolate-size: allow-keywords; /* lets height animate to auto (details FAQ) where supported */
}

/* 1. Scroll reveal. Hidden start ONLY when JS runs, motion allowed and the failsafe did not fire:
      crawlers, no-JS and reduced-motion users always see the content. */
@media (prefers-reduced-motion: no-preference) {
  .js:not(.mb-off) [data-reveal] {
    opacity: 0;
    transform: translateY(var(--dist));
    transition: opacity var(--dur) var(--ease-out), transform var(--dur) var(--ease-out);
    transition-delay: calc(var(--i, 0) * 80ms);
  }
  .js:not(.mb-off) [data-reveal="fade"]  { transform: none; }
  .js:not(.mb-off) [data-reveal="left"]  { transform: translateX(calc(var(--dist) * -1)); }
  .js:not(.mb-off) [data-reveal="right"] { transform: translateX(var(--dist)); }
  .js:not(.mb-off) [data-reveal="scale"] { transform: scale(.96); }
  .js:not(.mb-off) [data-reveal].is-in   { opacity: 1; transform: none; }

  /* 2. CSS-only load entrance for SECONDARY hero bits (never the H1 or hero image = LCP) */
  [data-enter] { animation: mb-rise .8s var(--ease-out) both; animation-delay: calc(var(--d, 0) * 1ms + 120ms); }
}
@keyframes mb-rise { from { opacity: 0; transform: translateY(16px); } }

/* 3. Micro-interactions (opt-in classes, do not combine .mb-lift with data-magnetic) */
.mb-lift { transition: transform .25s var(--ease-out), box-shadow .25s var(--ease-out), background-color .2s, color .2s; }
/* hover motion only for a real mouse: on touch a tap leaves :hover stuck */
@media (hover: hover) and (pointer: fine) {
  .mb-lift:hover { transform: translateY(-2px); }
}
.mb-lift:active { transform: scale(.97); transition-duration: .12s; } /* pressed feel, also on touch */

.mb-link {
  text-decoration: none;
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat;
  transition: background-size .3s var(--ease-out);
}
.mb-link:hover, .mb-link:focus-visible { background-size: 100% 1px; }

.mb-zoom { overflow: hidden; }
.mb-zoom img { transition: transform .7s var(--ease-out); }
@media (hover: hover) and (pointer: fine) {
  .mb-zoom:hover img { transform: scale(1.04); }
}
.mb-zoom:focus-within img { transform: scale(1.04); }

[data-magnetic] { transition: transform .3s var(--ease-out); }

:where(a, button, input, select, textarea, summary):focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }

/* 4. Header that hides on scroll down and returns on scroll up */
.mb-header { transition: transform .35s var(--ease-out), background-color .25s, box-shadow .25s; }
.mb-header.is-hidden { transform: translateY(-100%); }

/* 5. Marquee: items written twice in the track (second copy aria-hidden="true");
      give items padding-right instead of flex gap so the loop is seamless */
.mb-marquee { overflow: hidden; }
.mb-marquee__track { display: flex; width: max-content; animation: mb-marquee var(--speed, 35s) linear infinite; }
.mb-marquee:hover .mb-marquee__track, .mb-marquee:focus-within .mb-marquee__track { animation-play-state: paused; }
@keyframes mb-marquee { to { transform: translateX(-50%); } }

/* 6. Smooth FAQ <details class="mb-acc"> (Chrome 131+; instant elsewhere, still works) */
details.mb-acc::details-content {
  height: 0;
  overflow: clip;
  transition: height .25s var(--ease-out), content-visibility .25s allow-discrete;
}
details.mb-acc[open]::details-content { height: auto; }

/* 7. Cross-page transitions for a multi-page site (Chrome/Edge 126+, Safari 18.2+) */
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .3s; }

/* 8. Reduced motion: no movement anywhere */
@media (prefers-reduced-motion: reduce) {
  .mb-marquee__track { animation: none; }
  details.mb-acc::details-content { transition: none; }
  .mb-lift:hover, .mb-zoom:hover img { transform: none; }
  @view-transition { navigation: none; }
}
