/* =============================================================
   APICALERP.COM — common.css
   Shared MOTION + view-transition layer, loaded on every chromed
   page via partials/head-common.html. Chrome component styling
   (top-bar, header, nav, .nav-open drawer, footer, back-to-top,
   .reveal) already lives in the shared apical-styles.css — this file
   only adds the GSAP/Lenis motion gate, cross-page View Transitions,
   scroll-progress bar, and reduced-motion handling.
   Easing token: --ease-out: cubic-bezier(0.22, 1, 0.36, 1)
   ============================================================= */
:root{--ease-out:cubic-bezier(0.22,1,0.36,1)}

/* Cross-document View Transitions — subtle, fast SPA-like navigation */
@view-transition{navigation:auto}
@media (prefers-reduced-motion: no-preference){
  ::view-transition-old(root){animation:apx-vt-out 220ms var(--ease-out) both}
  ::view-transition-new(root){animation:apx-vt-in 220ms var(--ease-out) both}
  @keyframes apx-vt-out{to{opacity:0;transform:translateY(-8px)}}
  @keyframes apx-vt-in{from{opacity:0;transform:translateY(8px)}}
}

/* Hero pre-hide — only when motion is active (html.motion set in <head>).
   Prevents GSAP flashing un-animated content; absent for reduced-motion or
   if the gate/JS never runs, so the hero is always visible as a fallback. */
html.motion .hero-badge,
html.motion .hero h1,
html.motion .hero-desc,
html.motion .hero-cta,
html.motion .hero-features > *,
html.motion .stat-box{opacity:0}

/* Let GSAP own the hero (neutralise any legacy keyframe entrance) */
.hero-badge,.hero h1,.hero-desc,.hero-cta{animation:none !important}

/* Crisp easing on the shared .reveal scroll-in system (site.js adds .visible) */
.reveal,.reveal-scale,.reveal-left,.reveal-right{transition-timing-function:var(--ease-out) !important}

/* Thin top scroll-progress bar */
#scroll-progress{position:fixed;top:0;left:0;width:100%;height:3px;transform:scaleX(0);transform-origin:0 50%;background:var(--accent);z-index:3000;pointer-events:none;will-change:transform}

/* Global reduced-motion guard */
@media (prefers-reduced-motion: reduce){
  *,*::before,*::after{animation-duration:.01ms !important;animation-iteration-count:1 !important;transition-duration:.01ms !important;scroll-behavior:auto !important}
  html.motion .hero-badge,html.motion .hero h1,html.motion .hero-desc,
  html.motion .hero-cta,html.motion .hero-features > *,html.motion .stat-box{opacity:1}
}
