/* Rositsa's Fellnasen — Motion Engine V1.1
   Pure presentation layer. No API/data/dashboard rules. */

:root{
  --rf-motion-ease:cubic-bezier(.16,1,.3,1);
  --rf-motion-soft:cubic-bezier(.22,.61,.36,1);
  --rf-motion-fast:.55s;
  --rf-motion-normal:.9s;
  --rf-motion-slow:1.25s;
}

html.rf-lenis-active{scroll-behavior:auto!important}
html.rf-motion-active{scroll-padding-top:86px}
body.rf-motion-body{overflow-x:clip}

/* Scroll progress */
.rf-motion-progress{
  position:fixed;z-index:2147480000;left:0;top:0;width:100%;height:3px;
  transform:scaleX(0);transform-origin:0 50%;pointer-events:none;
  background:linear-gradient(90deg,var(--clay,#bb5d45),var(--honey,#dfa953),#f3cf88);
  box-shadow:0 2px 12px rgba(187,93,69,.24)
}

/* Hero custom Three.js layer */
.hero-copy.rf-three-host{position:relative;isolation:isolate;overflow:hidden}
.hero-copy.rf-three-host>*:not(.rf-three-layer){position:relative;z-index:2}
.rf-three-layer{
  position:absolute;z-index:0;inset:-8%;pointer-events:none;overflow:hidden;
  opacity:.56;mask-image:linear-gradient(115deg,#000 0%,rgba(0,0,0,.96) 58%,transparent 100%);
  -webkit-mask-image:linear-gradient(115deg,#000 0%,rgba(0,0,0,.96) 58%,transparent 100%)
}
.rf-three-layer canvas{display:block;width:100%!important;height:100%!important;filter:saturate(.78) contrast(.95)}
.hero.rf-motion-hero{isolation:isolate}
.hero-image.rf-motion-depth{transform-origin:50% 50%;will-change:transform}
.hero-image>img{will-change:transform}

/* Section identity + native scroll-driven ambient line */
.rf-motion-section{position:relative;isolation:isolate}
.rf-motion-section::before{
  content:"";position:absolute;z-index:0;left:7vw;right:7vw;top:0;height:1px;pointer-events:none;
  background:linear-gradient(90deg,transparent,rgba(187,93,69,.38),rgba(223,169,83,.32),transparent);
  transform:scaleX(.12);opacity:.28;transform-origin:50% 50%
}
@supports (animation-timeline:view()){
  .rf-motion-section::before{
    animation:rf-native-section-line linear both;
    animation-timeline:view();animation-range:entry 0% cover 42%
  }
  @keyframes rf-native-section-line{from{transform:scaleX(.08);opacity:.05}to{transform:scaleX(1);opacity:.55}}
}

/* Reveal underline on actual headings, without changing copy */
.rf-motion-heading{position:relative}
.rf-motion-heading::after{
  content:"";display:block;width:clamp(52px,8vw,104px);height:2px;margin-top:16px;
  background:linear-gradient(90deg,var(--clay,#bb5d45),rgba(223,169,83,.18));
  transform:scaleX(var(--rf-heading-line,0));transform-origin:left center;
  transition:transform .85s var(--rf-motion-ease)
}
.rf-motion-heading.rf-motion-live::after{--rf-heading-line:1}
.section-head.dark .rf-motion-heading::after,.work .rf-motion-heading::after,.project-feature .rf-motion-heading::after{background:linear-gradient(90deg,var(--honey,#dfa953),rgba(255,255,255,.16))}

/* Editorial depth */
.rf-motion-image{will-change:transform,clip-path,filter}
.rf-motion-card{will-change:transform,opacity}
.rf-motion-glow{position:relative;isolation:isolate}
.rf-motion-glow::after{
  content:"";position:absolute;z-index:-1;pointer-events:none;width:min(46vw,620px);aspect-ratio:1;border-radius:50%;
  top:8%;left:-20%;opacity:0;background:radial-gradient(circle,rgba(223,169,83,.12),rgba(187,93,69,.055) 42%,transparent 72%);
  filter:blur(20px);transform:translate3d(0,60px,0) scale(.78);transition:opacity 1s ease,transform 1.35s var(--rf-motion-ease)
}
.rf-motion-glow.rf-motion-live::after{opacity:1;transform:translate3d(0,0,0) scale(1)}
.rf-motion-glow.rf-motion-right::after{left:auto;right:-20%}

/* Spotlight only on fine pointer */
.rf-motion-spot{position:relative;isolation:isolate}
.rf-motion-spot::before{
  content:"";position:absolute;z-index:10;inset:0;pointer-events:none;opacity:0;
  background:radial-gradient(280px circle at var(--rf-spot-x,50%) var(--rf-spot-y,50%),rgba(255,255,255,.26),rgba(223,169,83,.08) 35%,transparent 72%);
  transition:opacity .24s ease
}
@media (hover:hover) and (pointer:fine){.rf-motion-spot:hover::before{opacity:1}}

/* Team + reports become non-destructive scroll sliders. Children stay in place. */
.rf-motion-slider-wrap{position:relative;margin-top:44px}
.rf-motion-slider-toolbar{display:flex;justify-content:flex-end;align-items:center;gap:9px;margin-bottom:12px}
.rf-motion-slider-status{margin-right:5px;color:var(--muted,#667168);font:800 9px/1 Arial,sans-serif;letter-spacing:.13em;text-transform:uppercase}
.rf-motion-slider-btn{
  appearance:none;border:1px solid rgba(31,58,44,.2);width:44px;height:44px;border-radius:50%;
  background:rgba(255,253,248,.95);color:var(--forest,#1f3a2c);cursor:pointer;
  display:grid;place-items:center;font:400 22px/1 Georgia,serif;box-shadow:0 9px 26px rgba(31,58,44,.09);
  transition:transform .22s ease,box-shadow .22s ease,background .22s ease
}
.rf-motion-slider-btn:hover,.rf-motion-slider-btn:focus-visible{background:#fff;transform:translateY(-3px);box-shadow:0 14px 34px rgba(31,58,44,.15)}
.team-grid.rf-motion-slider,.report-grid.rf-motion-slider{
  display:flex!important;grid-template-columns:none!important;overflow-x:auto!important;overflow-y:hidden!important;
  scroll-snap-type:x mandatory;scrollbar-width:none;overscroll-behavior-x:contain;-webkit-overflow-scrolling:touch;
  gap:16px!important;margin-top:0!important;padding:2px 2px 12px
}
.team-grid.rf-motion-slider::-webkit-scrollbar,.report-grid.rf-motion-slider::-webkit-scrollbar{display:none}
.team-grid.rf-motion-slider>.team-card{flex:0 0 calc((100% - 32px)/3)!important;scroll-snap-align:start;min-width:0}
.report-grid.rf-motion-slider>button{flex:0 0 calc((100% - 32px)/3)!important;scroll-snap-align:start;min-width:0}

/* Daily care scroll-story: only activated by JS on capable desktop */
.daily-care-story.rf-story-active{position:relative}
.daily-care-main.rf-story-pin{will-change:transform}
.daily-care-steps>div.rf-story-step{position:relative}
.daily-care-steps>div.rf-story-step::before{
  content:"";position:absolute;left:-1px;top:0;bottom:0;width:3px;background:var(--honey,#dfa953);
  transform:scaleY(var(--rf-step-progress,0));transform-origin:top center
}

/* Work / castration progression */
.work-grid,.neuter-steps{position:relative}
.work-grid.rf-progress-grid::after,.neuter-steps.rf-progress-grid::after{
  content:"";position:absolute;z-index:4;left:0;top:0;height:2px;width:100%;pointer-events:none;
  background:linear-gradient(90deg,var(--honey,#dfa953),var(--clay,#bb5d45));
  transform:scaleX(var(--rf-grid-progress,0));transform-origin:left center
}

/* Magnetic elements use translate so existing transform hover rules remain intact. */
.rf-motion-magnetic{will-change:translate}

/* V1.1 intentionally does not intercept animal-profile clicks or entrance clicks. */

/* Native fallback only becomes active after JS explicitly enables it. */
.rf-native-ready .rf-native-target{transition:opacity .82s var(--rf-motion-ease),transform .92s var(--rf-motion-ease),filter .92s var(--rf-motion-ease)}
.rf-native-ready .rf-native-target.rf-native-before{opacity:.18;transform:translate3d(var(--rf-native-x,0),var(--rf-native-y,72px),0) scale(.985);filter:blur(7px)}
.rf-native-ready .rf-native-target.rf-native-in{opacity:1;transform:none;filter:none}

@media(max-width:1150px){
  .team-grid.rf-motion-slider>.team-card,.report-grid.rf-motion-slider>button{flex-basis:calc((100% - 16px)/2)!important}
}
@media(max-width:860px){
  html.rf-motion-active{scroll-padding-top:72px}
  .rf-three-layer{display:none!important}
  .rf-motion-section::before{left:22px;right:22px}
  .rf-motion-glow::after{width:360px;opacity:.65}
}
@media(max-width:620px){
  .rf-motion-progress{height:2px}
  .rf-motion-slider-wrap{margin-top:34px}
  .rf-motion-slider-btn{width:40px;height:40px}
  .team-grid.rf-motion-slider,.report-grid.rf-motion-slider{gap:12px!important;padding-right:10vw}
  .team-grid.rf-motion-slider>.team-card,.report-grid.rf-motion-slider>button{flex-basis:88%!important}
  .rf-motion-heading::after{margin-top:12px}
}
@media(prefers-reduced-motion:reduce){
  .rf-motion-progress,.rf-three-layer,.rf-motion-glow::after,.rf-motion-section::before{display:none!important}
  .rf-native-target{opacity:1!important;transform:none!important;filter:none!important;transition:none!important}
  .rf-motion-magnetic{translate:0 0!important}
  .team-grid.rf-motion-slider,.report-grid.rf-motion-slider{scroll-behavior:auto!important}
  ::view-transition-group(*),::view-transition-old(*),::view-transition-new(*){animation-duration:.01ms!important}
}


/* =========================================================
   V1.1 – Team: complete cards again, especially on mobile
   ========================================================= */
#team .team-grid{
  width:100%;
}
@media(max-width:760px){
  #team .team-grid{
    display:grid!important;
    grid-template-columns:1fr!important;
    gap:18px!important;
    overflow:visible!important;
    margin-top:34px!important;
    padding:0!important;
  }
  #team .team-card{
    display:flex!important;
    flex-direction:column!important;
    width:100%!important;
    min-height:0!important;
    border-radius:12px;
    overflow:hidden;
    background:var(--paper,#fffdf8);
    box-shadow:0 12px 34px rgba(31,58,44,.09);
  }
  #team .team-card img{
    width:100%!important;
    height:auto!important;
    min-height:0!important;
    aspect-ratio:4/3!important;
    object-fit:cover!important;
    object-position:center 24%!important;
    filter:saturate(.92)!important;
  }
  #team .team-card>div{
    width:100%!important;
    min-height:0!important;
    padding:22px 22px 25px!important;
    justify-content:flex-start!important;
  }
  #team .team-card h3{
    margin:8px 0 8px!important;
    font-size:29px!important;
  }
  #team .team-card p{
    margin:0!important;
    font-size:12px!important;
    line-height:1.68!important;
  }
  #team .team-card small{
    font-size:8px!important;
  }
}
