/* Scroll kit (build #70): smooth effects driven by the page's own scroll, plain CSS, no library, no JavaScript.
   Three classes, add them to any Grey House site or command center:
     .scroll-progress  an empty <div class="scroll-progress" aria-hidden="true"></div> right after <body>: a thin bar
                       across the top that fills as the reader moves down the page.
                       Colour: --scroll-progress-color (default currentColor); thickness: --scroll-progress-size.
     .scroll-reveal    on cards, images, list items: each one rises and fades in as it enters the screen.
                       Distance: --scroll-reveal-distance (default 1.5rem).
     .scroll-shadow    on a panel that scrolls up and down; .scroll-shadow-x on one that scrolls sideways (tables).
                       The edge that still has more to see fades softly, so the reader knows to scroll.
                       Fade size: --scroll-shadow-size (default 2.5rem).
   Browsers that do not know scroll-driven animations show everything still and complete (the @supports wall), and
   anyone who asked their phone for less motion gets no reveal (prefers-reduced-motion). Copied, never linked from
   elsewhere: sites/greyhouse-web/build.sh copies this file into public/. */

.scroll-progress{display:none}

@property --scroll-fade-a{syntax:'<length>';inherits:false;initial-value:0px}
@property --scroll-fade-b{syntax:'<length>';inherits:false;initial-value:0px}

@supports (animation-timeline: scroll()){
  .scroll-progress{display:block;position:fixed;inset:0 0 auto 0;z-index:60;height:var(--scroll-progress-size,3px);
    background:var(--scroll-progress-color,currentColor);pointer-events:none;transform-origin:0 50%;
    animation:scroll-kit-fill linear both;animation-timeline:scroll(root block)}
  .scroll-progress:dir(rtl){transform-origin:100% 50%}

  .scroll-reveal{animation:scroll-kit-rise linear both;animation-timeline:view();animation-range:entry 0% entry 80%}

  .scroll-shadow,.scroll-shadow-x{--scroll-fade:var(--scroll-shadow-size,2.5rem);
    animation:scroll-kit-edges linear both;animation-timeline:scroll(self block)}
  .scroll-shadow-x{animation-timeline:scroll(self inline)}
  .scroll-shadow{mask-image:linear-gradient(to bottom,transparent,#000 var(--scroll-fade-a),#000 calc(100% - var(--scroll-fade-b)),transparent)}
  .scroll-shadow-x{mask-image:linear-gradient(to right,transparent,#000 var(--scroll-fade-a),#000 calc(100% - var(--scroll-fade-b)),transparent)}
  .scroll-shadow-x:dir(rtl){mask-image:linear-gradient(to left,transparent,#000 var(--scroll-fade-a),#000 calc(100% - var(--scroll-fade-b)),transparent)}
}

@keyframes scroll-kit-fill{from{transform:scaleX(0)}to{transform:scaleX(1)}}
@keyframes scroll-kit-rise{from{opacity:0;transform:translateY(var(--scroll-reveal-distance,1.5rem))}to{opacity:1;transform:none}}
/* Start: only the far edge fades. Middle: both. End: only the near edge. A panel too short to scroll has no timeline,
   so it keeps the starting values of 0px and shows no fade at all. */
@keyframes scroll-kit-edges{
  0%{--scroll-fade-a:0px;--scroll-fade-b:var(--scroll-fade)}
  8%,92%{--scroll-fade-a:var(--scroll-fade);--scroll-fade-b:var(--scroll-fade)}
  100%{--scroll-fade-a:var(--scroll-fade);--scroll-fade-b:0px}}

@media (prefers-reduced-motion:reduce){
  .scroll-reveal{animation:none;opacity:1;transform:none}
}
@media print{.scroll-progress{display:none!important}.scroll-shadow,.scroll-shadow-x{mask-image:none}}
