/* TBFL / Phase 3 - optional ambient motion, never gates reading content */
@media (prefers-reduced-motion:no-preference){
 @keyframes tbfl-hero-appear { from{opacity:1;transform:translateY(10px)}to{opacity:1;transform:translateY(0)} }
 @keyframes tbfl-art-breathe { from{transform:translateY(4px) rotate(-12deg)}to{transform:translateY(-5px) rotate(-10deg)} }
 @keyframes tbfl-soft-entrance { from{opacity:.6;transform:translateY(12px)}to{opacity:1;transform:translateY(0)} }
 .tbfl-home .tbfl-hero-text{animation:tbfl-hero-appear .85s cubic-bezier(.22,.68,0,1) both}
 .tbfl-home .tbfl-hero-art::before{animation:tbfl-art-breathe 8s ease-in-out infinite alternate}
 .tbfl-root .tbfl-feature,.tbfl-root .tbfl-archive-card,.tbfl-root .tbfl-related-card{transition:transform .32s cubic-bezier(.2,.75,.2,1),border-color .32s,box-shadow .32s}
 .tbfl-root .tbfl-reader-tools button:active,.tbfl-root .tbfl-main-button:active{transform:scale(.97)}
 .tbfl-root .tbfl-part[open]>ol{animation:tbfl-soft-entrance .32s ease-out both}
 .tbfl-root .tbfl-hero-photo img{transition:transform .8s cubic-bezier(.22,.7,.22,1)}
 .tbfl-root .tbfl-hero-photo:hover img{transform:scale(1.018)}
}
@supports (animation-timeline:scroll()) and (animation-range:0% 100%){
 @media (prefers-reduced-motion:no-preference){
   @keyframes tbfl-underline{from{opacity:.30;transform:scaleX(.15)}to{opacity:1;transform:scaleX(1)}}
   .tbfl-contents-section .tbfl-section-head h2::after{
     content:"";display:block;transform-origin:left center;opacity:.7;width:clamp(45px,10vw,100px);height:3px;
     background:linear-gradient(90deg,#8f8bc4,#a8cfbd);margin-top:24px;border-radius:9px;
     animation:tbfl-underline 1ms linear both;
     animation-timeline:view();animation-range:entry 0% cover 45%;
   }
 }
}
@supports (view-transition-name:root){
 @media (prefers-reduced-motion:no-preference){
  @view-transition{navigation:auto}
  ::view-transition-old(root){animation-duration:.14s;animation-timing-function:ease-in}
  ::view-transition-new(root){animation-duration:.24s;animation-timing-function:ease-out}
 }
}
/* A modern open/closed contents transition; old browsers use an instant, readable fallback. */
@media(max-width:780px) and (prefers-reduced-motion:no-preference){
 .tbfl-root .tbfl-reader-toc.tbfl-toc-visible{
   opacity:1;translate:0 0;transition:opacity .25s ease,translate .25s ease,display .25s allow-discrete;
 }
 @starting-style{.tbfl-root .tbfl-reader-toc.tbfl-toc-visible{opacity:0;translate:-18px 0}}
}
@media(prefers-reduced-motion:reduce){
 .tbfl-root *, .tbfl-root *::before,.tbfl-root *::after{animation:none!important;animation-timeline:none!important;scroll-behavior:auto!important;transition:none!important}
}

/* Optional Focus reading: hide the side rails, never the manuscript or navigation controls. */
@media(min-width:781px){
 .tbfl-root.tbfl-focus-mode .tbfl-reader-grid{grid-template-columns:minmax(0,830px);justify-content:center;gap:0}
 .tbfl-root.tbfl-focus-mode .tbfl-reader-toc,.tbfl-root.tbfl-focus-mode .tbfl-reader-rail{display:none}
 .tbfl-root.tbfl-focus-mode .tbfl-reading-main{width:100%;max-width:830px}
}
.tbfl-root .tbfl-reader-tools .tbfl-focus[aria-pressed="true"]{background:#e4e5f3;border-color:#a9abd1;color:#2c365a}
@media(max-width:780px){.tbfl-root .tbfl-reader-tools .tbfl-focus{display:none}}

.tbfl-root .tbfl-search-feedback{font-size:12px;color:#576682;min-height:0;margin:0 0 12px}.tbfl-root .tbfl-search-feedback:not(:empty){background:#edeaf4;padding:9px 14px;border-radius:11px;display:inline-block}
