/* =========================================================================
   Stegnor — motion layer (2026-11-17). Loaded last on every page. No custom cursor (removed 17 Nov, owner).
   Durations and easing come from these tokens only.
   ========================================================================= */
:root {
  --dur-1: 160ms;   /* hovers, small state changes */
  --dur-2: 320ms;   /* cards, menus */
  --dur-3: 700ms;   /* reveals */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-soft: cubic-bezier(0.33, 1, 0.68, 1);
}

/* ---------- smooth scrolling (motion.js + vendor/lenis) ---------- */
html.lenis, html.lenis body { height: auto; }
html.lenis { scroll-behavior: auto !important; }
.lenis:not(.lenis-autoToggle).lenis-stopped { overflow: clip; }
.lenis [data-lenis-prevent] { overscroll-behavior: contain; }

/* ---------- section titles rise out of a mask ---------- */
/* hidden with opacity (an IntersectionObserver ignores opacity but treats a clip-path'd box as zero size) */
html.mo .mo-title { opacity: 0; }
html.mo .mo-title.is-in { opacity: 1; animation: mo-rise var(--dur-3) var(--ease-out) both; }
@keyframes mo-rise { from { clip-path: inset(-0.2em -0.2em 100% -0.2em); translate: 0 0.45em; } to { clip-path: inset(-0.2em -0.2em -0.35em -0.2em); translate: 0 0; } }

/* ---------- illustrations drift on scroll (translate set by motion.js) ---------- */
html.mo [data-art] { transition: translate 120ms linear; }

/* ---------- magnetic primary buttons ---------- */
.btn.btn--grad { transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease), background-position 0.6s var(--ease), background-color 0.3s, border-color 0.3s, color 0.3s, translate 0.5s var(--ease-out); }
.btn.btn--grad.is-mag { transition-duration: 0.35s, 0.35s, 0.6s, 0.3s, 0.3s, 0.3s, 90ms; }

/* ---------- page to page: a soft cross-fade where the browser supports it ---------- */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: 220ms var(--ease-soft) both mo-out; }
::view-transition-new(root) { animation: 420ms var(--ease-out) both mo-in; }
.hdr { view-transition-name: site-header; }
::view-transition-group(site-header) { animation: none; }
@keyframes mo-out { to { opacity: 0; } }
@keyframes mo-in { from { opacity: 0; translate: 0 10px; } }

@media (prefers-reduced-motion: reduce) {
  html.mo .mo-title { opacity: 1; animation: none; }
  ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
}
