/* Gramli Sites motion v1 – scroll-driven only (no idle movement). Content is always visible without support, JS or motion. */
html{--m:1}
html[data-motion=subtle]{--m:.45}

@media (prefers-reduced-motion:no-preference){
@supports (animation-timeline:view()){
  html:not([data-motion=off]) [data-reveal]{animation:fx-rise linear both;animation-timeline:view();animation-range:entry 0% entry 70%}
  html:not([data-motion=off]) [data-fx=inner-zoom] img{animation:fx-inner linear both;animation-timeline:view();animation-range:entry 0% exit 100%}
  html:not([data-motion=off]) [data-fx=aperture] .hero-frame{animation:fx-aperture linear both;animation-timeline:view();animation-range:exit 0% exit 100%}
  html:not([data-motion=off]) [data-fx=aperture] .hero-frame img{animation:fx-settle linear both;animation-timeline:view();animation-range:exit 0% exit 100%}
  html:not([data-motion=off]) [data-fx=aperture] .hero-copy{animation:fx-drift linear both;animation-timeline:view();animation-range:exit 0% exit 80%}
  html:not([data-motion=off]) [data-fx=aperture] .hero-note{animation:fx-drift linear both;animation-timeline:view();animation-range:exit 0% exit 35%}
  html:not([data-motion=off]) [data-fx=lift]{animation:fx-drift linear both;animation-timeline:view();animation-range:exit 0% exit 100%}
  html:not([data-motion=off]) [data-fx=depth] .frame{animation:fx-open linear both;animation-timeline:view();animation-range:entry 0% cover 45%}
  html:not([data-motion=off]) [data-fx=depth] img{animation:fx-inner linear both;animation-timeline:view();animation-range:entry 0% exit 100%}
  html:not([data-motion=off]) [data-fx=mask] .mask-title{animation:fx-mask linear both;animation-timeline:view();animation-range:exit 0% exit 70%}
  /* Collage float parallax only for cinematic motion (tiles keep their arranged order under subtle). */
  html[data-motion=cinematic] [data-fx=float-slow]{animation:fx-float linear both;animation-timeline:view();animation-range:cover 0% cover 100%;--f:.5}
  html[data-motion=cinematic] [data-fx=float-mid]{animation:fx-float linear both;animation-timeline:view();animation-range:cover 0% cover 100%;--f:1.1}
  html[data-motion=cinematic] [data-fx=float-fast]{animation:fx-float linear both;animation-timeline:view();animation-range:cover 0% cover 100%;--f:1.7}
  html:not([data-motion=off]) [data-fx=aperture-soft]{animation:fx-open linear both;animation-timeline:view();animation-range:entry 0% cover 40%}
  html:not([data-motion=off]) [data-fx=depth-bg] img{animation:fx-inner linear both;animation-timeline:view();animation-range:entry 0% exit 100%}
  html:not([data-motion=off]) [data-fx=stack]{animation:fx-stack linear both;animation-timeline:view();animation-range:entry 0% entry 100%}
  /* Statement text fills line by line as it crosses the viewport. */
  /* --reveal-fill: filled colour per tone/edition without touching --tc (which also drives eyebrows). */
  html:not([data-motion=off]) [data-fx=fill] span{padding-inline-end:.14em;margin-inline-end:-.14em;background:linear-gradient(90deg,var(--reveal-fill,var(--tc)) 0 50%,color-mix(in srgb,var(--reveal-fill,var(--tc)) var(--reveal-dim,34%),transparent) 50% 100%) 100% 0/200% 100% no-repeat;-webkit-background-clip:text;background-clip:text;color:transparent;-webkit-box-decoration-break:clone;box-decoration-break:clone;animation:fx-fill linear both;animation-timeline:view();animation-range:entry 15% cover 40%}
  /* RTL: the fill runs with the reading direction (right to left). */
  html:not([data-motion=off])[dir=rtl] [data-fx=fill] span{background-image:linear-gradient(270deg,var(--reveal-fill,var(--tc)) 0 50%,color-mix(in srgb,var(--reveal-fill,var(--tc)) var(--reveal-dim,34%),transparent) 50% 100%);background-position:0 0;animation-name:fx-fill-rtl}

  /* Pinned horizontal rail: the section's vertical scroll drives the track sideways (cinematic only, wide screens). */
  @media (min-width:901px){
    html[data-motion=cinematic] [data-fx=rail]{height:calc(100vh + var(--rail-dist,var(--n) * 25vw) * 1.25);view-timeline-name:--rail}
    /* The pinned stage is a full viewport already: no extra section padding above/below it. */
    html[data-motion=cinematic] .s-gallery:has(>[data-fx=rail]){padding-block:0}
    html[data-motion=cinematic] [data-fx=rail] .rail-sticky{position:sticky;top:0;height:100vh;display:grid;grid-template-columns:minmax(0,1fr);align-content:center;overflow:hidden}
    html[data-motion=cinematic] [data-fx=rail] .rail-track{width:max-content;overflow:visible;scroll-snap-type:none;-webkit-mask-image:none;mask-image:none;animation:fx-rail linear both;animation-timeline:--rail;animation-range:contain 0% contain 100%}
    html[data-motion=cinematic] [data-fx=rail] .rail-nav{display:none}
    html[data-motion=cinematic][dir=rtl] [data-fx=rail] .rail-track{animation-name:fx-rail-rtl}
    html[data-motion=cinematic] [data-fx=rail] .rail-item,html[data-motion=cinematic] [data-fx=rail] .rail-item:nth-child(3n+2){width:auto}
    html[data-motion=cinematic] [data-fx=rail] .rail-item img{height:62vh;max-height:62vh;width:auto}
    html[data-motion=cinematic] .ft-stack .ft-card{position:sticky;top:calc(10vh + var(--i) * 22px)}
  }
}
}

@keyframes fx-rise{from{opacity:0;transform:translateY(calc(var(--m) * 46px))}to{opacity:1;transform:none}}
@keyframes fx-inner{from{transform:scale(calc(1 + var(--m) * .16))}to{transform:scale(1)}}
@keyframes fx-aperture{from{clip-path:inset(0 0 0 0 round 0)}to{clip-path:inset(calc(var(--m) * 7vh) calc(var(--m) * 6vw) calc(var(--m) * 14vh) round var(--img-radius,0))}}
@keyframes fx-settle{from{transform:scale(1)}to{transform:scale(calc(1 + var(--m) * .14))}}
@keyframes fx-drift{from{transform:none;opacity:1}to{transform:translateY(calc(var(--m) * -18vh));opacity:0}}
@keyframes fx-open{from{clip-path:inset(0 calc(var(--m) * 9%) round var(--img-radius,0))}to{clip-path:inset(var(--clip-out,0px) round var(--img-radius,0))}}
@keyframes fx-mask{from{transform:scale(1);opacity:1}to{transform:scale(calc(1 + var(--m) * .45));opacity:.1}}
@keyframes fx-float{from{transform:translateY(calc(var(--m) * var(--f) * 7vh))}to{transform:translateY(calc(var(--m) * var(--f) * -7vh))}}
@keyframes fx-stack{from{transform:scale(calc(1 - var(--m) * .06))}to{transform:none}}
@keyframes fx-fill{to{background-position:0 0}}
@keyframes fx-fill-rtl{to{background-position:100% 0}}
@keyframes fx-rail{from{transform:translateX(0)}to{transform:translateX(calc(-100% + 100vw))}}
@keyframes fx-rail-rtl{from{transform:translateX(0)}to{transform:translateX(calc(100% - 100vw))}}

/* Fallback without scroll timelines (e.g. Firefox): one-time reveal via IntersectionObserver classes set by sites-v1.js. */
.io [data-reveal]{opacity:0;transform:translateY(calc(var(--m) * 34px));transition:opacity .9s cubic-bezier(.2,.7,.2,1),transform .9s cubic-bezier(.2,.7,.2,1)}
.io [data-reveal].in{opacity:1;transform:none}
.io [data-fx=inner-zoom] img,.io [data-fx=depth] img{transform:scale(calc(1 + var(--m) * .1));transition:transform 1.6s cubic-bezier(.2,.7,.2,1)}
.io [data-fx=inner-zoom].in img,.io [data-fx=depth].in img{transform:none}
.io [data-fx=aperture-soft],.io [data-fx=depth] .frame{clip-path:inset(0 calc(var(--m) * 6%) round var(--img-radius,0));transition:clip-path 1.4s cubic-bezier(.2,.7,.2,1)}
.io [data-fx=aperture-soft].in,.io [data-fx=depth].in .frame{clip-path:inset(var(--clip-out,0px) round var(--img-radius,0))}
@media (prefers-reduced-motion:reduce){.io [data-reveal],.io [data-fx] img,.io [data-fx]{opacity:1!important;transform:none!important;clip-path:none!important;transition:none!important}}

/* engine pass 3 */
/* Drawn hairlines (theme rule_draw): the line length is a registered property, so it animates; without support the
   line is simply complete. */
@property --rd{syntax:'<percentage>';inherits:false;initial-value:100%}
@media (prefers-reduced-motion:no-preference){
@supports (animation-timeline:view()){
  /* Row stagger: grid items carry their column (--d), so a row settles from the reading start instead of all at once. */
  @media (min-width:701px){
    html:not([data-motion=off]) [data-reveal]{animation-range:entry calc(var(--d,var(--di,0)) * 7%) entry calc(70% + var(--d,var(--di,0)) * 7%)}
  }
  html[data-rules=draw]:not([data-motion=off]) :is(.ft-rows,.tl:not(.v-rail .tl),.pj-index,.pj-list,.hr-list,.fq-list,.v-list .jr,.stats,.pd-details,.story-chapter,.pj-link,.hr-list>div,.fq-item,.mn-group h3,.sk-group,.ft-row,.tl-row:not(.v-rail .tl-row),.pj-item,.v-list .jr-item){border-image:linear-gradient(to right,var(--rule-color,var(--line)) var(--rd),transparent 0) 1}
  html[data-rules=draw][dir=rtl]:not([data-motion=off]) :is(.ft-rows,.tl:not(.v-rail .tl),.pj-index,.pj-list,.hr-list,.fq-list,.v-list .jr,.stats,.pd-details,.story-chapter,.pj-link,.hr-list>div,.fq-item,.mn-group h3,.sk-group,.ft-row,.tl-row:not(.v-rail .tl-row),.pj-item,.v-list .jr-item){border-image-source:linear-gradient(to left,var(--rule-color,var(--line)) var(--rd),transparent 0)}
  html[data-rules=draw]:not([data-motion=off]) :is(.ft-rows,.tl,.pj-index,.pj-list,.hr-list,.fq-list,.v-list .jr,.stats,.pd-details,.story-chapter,.pj-link,.hr-list>div,.fq-item,.mn-group h3):not([data-reveal]){animation:fx-rule linear both;animation-timeline:view();animation-range:entry 0% cover 32%}
  html[data-rules=draw]:not([data-motion=off]) :is(.sk-group,.ft-row,.tl-row,.pj-item,.v-list .jr-item)[data-reveal]{animation:fx-rise linear both,fx-rule linear both;animation-timeline:view(),view();animation-range:entry 0% entry 70%,entry 10% cover 34%}
  /* Timeline rail: the stem grows with the reading position. */
  html:not([data-motion=off]) .v-rail .tl{view-timeline-name:--tl-stem}
  html:not([data-motion=off]) .v-rail .tl::before{animation:fx-stem linear both;animation-timeline:--tl-stem;animation-range:entry 15% cover 55%}
}
  /* Hero reveal (theme hero_reveal = develop): once on load, the first hero's photo develops from a slightly inset clip
     and the copy settles line by line. Transform/clip only – the title is never invisible. */
  html[data-hero-reveal=develop]:not([data-motion=off]) main>.s-hero:first-child :is(.hero-stage,.hero-split-media,.hero-depth-media,.hero-collage-art,.hero-mask-sticky){animation:hx-develop 1.3s cubic-bezier(.2,.7,.2,1) backwards}
  html[data-hero-reveal=develop]:not([data-motion=off]) main>.s-hero:first-child :is(.hero-copy,.hero-split-copy,.hero-depth-copy,.hero-collage-copy,.hero-mask-copy)>*{animation:hx-settle 1s cubic-bezier(.2,.7,.2,1) both;animation-delay:.12s}
  html[data-hero-reveal=develop]:not([data-motion=off]) main>.s-hero:first-child :is(.hero-copy,.hero-split-copy,.hero-depth-copy,.hero-collage-copy,.hero-mask-copy)>:nth-child(2){animation-delay:.2s}
  html[data-hero-reveal=develop]:not([data-motion=off]) main>.s-hero:first-child :is(.hero-copy,.hero-split-copy,.hero-depth-copy,.hero-collage-copy,.hero-mask-copy)>:nth-child(n+3){animation-delay:.3s}
}
@keyframes fx-rule{from{--rd:0%}to{--rd:100%}}
@keyframes fx-stem{from{transform:scaleY(0)}to{transform:scaleY(1)}}
@keyframes hx-develop{from{clip-path:inset(3.5% 3.5% 3.5% 3.5% round var(--img-radius,0))}to{clip-path:inset(0 round 0)}}
@keyframes hx-settle{from{translate:0 calc(var(--m) * 22px)}to{translate:none}}
/* Stagger without scroll timelines (IntersectionObserver fallback). */
@media (min-width:701px){.io [data-reveal]{transition-delay:calc(var(--d,var(--di,0)) * 90ms)}}
/* end engine pass 3 */
