/* Semler — motion layer. Pure CSS, no JS. Everything degrades to static content. */
@view-transition{navigation:auto}
::view-transition-old(root){animation:mt-out .38s cubic-bezier(.4,0,.2,1) both}
::view-transition-new(root){animation:mt-in .7s cubic-bezier(.16,.84,.24,1) both}
header{view-transition-name:site-header}
@keyframes mt-out{to{opacity:0;transform:translateY(-6px)}}
@keyframes mt-in{from{opacity:0;transform:translateY(14px)}}

@keyframes mt-fade{from{opacity:0}}
@keyframes mt-rise{from{opacity:0;transform:translateY(26px);filter:blur(5px)}to{opacity:1;transform:none;filter:none}}
@keyframes mt-drop{from{opacity:0;transform:translateY(-100%)}}
@keyframes mt-line{from{transform:scaleX(0)}}
@keyframes mt-unveil{from{clip-path:inset(0 0 100% 0);transform:scale(1.14)}to{clip-path:inset(0);transform:none}}
@keyframes mt-settle{from{transform:scale(1.1)}to{transform:none}}
@keyframes mt-scroll-rise{from{opacity:0;transform:translateY(42px)}to{opacity:1;transform:none}}
@keyframes mt-scroll-img{from{clip-path:inset(14% 6% 0 6%);transform:scale(1.12);opacity:.35}to{clip-path:inset(0);transform:none;opacity:1}}
@keyframes mt-progress{from{transform:scaleX(0)}to{transform:scaleX(1)}}

@media (prefers-reduced-motion:no-preference){
  /* page load */
  header>div{animation:mt-fade .9s ease-out both}
  main h1,main div:has(+h1){animation:mt-rise 1.05s cubic-bezier(.16,.84,.24,1) both}
  main div:has(+h1){animation-delay:.08s}
  main h1{animation-delay:.18s}
  main h1~p{animation:mt-rise 1.05s cubic-bezier(.16,.84,.24,1) .34s both}
  main h1~div,main h1~ul{animation:mt-rise 1.05s cubic-bezier(.16,.84,.24,1) .5s both}
  main div:has(+h1)>span:first-child{transform-origin:left;animation:mt-line 1.1s cubic-bezier(.65,0,.35,1) .45s both}
  main div:has(>img[fetchpriority]){overflow:hidden}
  main img[fetchpriority]{animation:mt-unveil 1.7s cubic-bezier(.77,0,.18,1) .1s both}

  /* scroll progress hairline */
  @supports (animation-timeline:scroll()){
    body::before{content:"";position:fixed;top:0;left:0;right:0;height:2px;z-index:100;background:#5C682F;transform-origin:0 50%;animation:mt-progress linear both;animation-timeline:scroll(root);pointer-events:none}
  }

  /* scroll reveals — JS-driven (motion.js) */
  html.mt-js .mt{opacity:0;transform:translateY(36px);transition:opacity 1.05s cubic-bezier(.16,.84,.24,1),transform 1.25s cubic-bezier(.16,.84,.24,1)}
  html.mt-js .mt.mt-in{opacity:1;transform:none}
  html.mt-js .mt-img{transform:translateY(24px)}
  html.mt-js .mt-img img{clip-path:inset(14% 7% 0 7%);transform:scale(1.14);transition:clip-path 1.5s cubic-bezier(.77,0,.18,1),transform 2s cubic-bezier(.16,.84,.24,1)}
  html.mt-js img.mt-img{clip-path:inset(14% 7% 0 7%);transform:scale(1.14);transition:clip-path 1.5s cubic-bezier(.77,0,.18,1),transform 2s cubic-bezier(.16,.84,.24,1),opacity 1s ease}
  html.mt-js .mt-img.mt-in img,html.mt-js img.mt-img.mt-in{clip-path:inset(0);transform:none}

  /* fallback without JS: CSS scroll-driven reveals where supported */
  @supports (animation-timeline:view()){
    html:not(.mt-js) main section h2,
    html:not(.mt-js) main section h2+p,
    html:not(.mt-js) main section [data-nr],
    html:not(.mt-js) main section blockquote,
    html:not(.mt-js) main section details,
    html:not(.mt-js) main section ol>li,
    html:not(.mt-js) main section ul>li{
      animation:mt-scroll-rise linear both;animation-timeline:view();animation-range:entry 0% entry 85%
    }
  }

  /* hover */
  main a:has(img) img{transition:transform 1.1s cubic-bezier(.16,.84,.24,1),filter .6s ease}
  main a:has(img):hover img{transform:scale(1.045)}
  a[style*="inline-flex"]>span:last-child{display:inline-block;transition:transform .45s cubic-bezier(.16,.84,.24,1)}
  a[style*="inline-flex"]:hover>span:last-child{transform:translateX(5px)}
  a[style*="border-bottom:1.5px"]{background:linear-gradient(currentColor,currentColor) 0 100%/0 1.5px no-repeat;transition:background-size .5s cubic-bezier(.16,.84,.24,1)}
  a[style*="border-bottom:1.5px"]:hover{background-size:100% 1.5px}
}
