/* Interaction refinements after the apple-design review (2026-09-22).
   Feedback on press, motion that starts where it came from, and the three
   user signals: reduced motion, reduced transparency and more contrast. */

/* Press feedback on pointer-down, not on release. */
.text-link,.hero-founder,.widget-style-controls button,.main-nav a,.mobile-chapter-menu summary,.mobile-chapter-menu>nav a,.site-footer a,.site-footer button{transition:transform .1s ease-out,background-color .15s ease-out,color .15s ease-out}
.text-link:active,.hero-founder:active,.widget-style-controls button:active,.main-nav a:active,.mobile-chapter-menu summary:active,.site-footer a:active,.site-footer button:active{transform:scale(.97)}
.mobile-chapter-menu>nav a:active{background:#f5a85533}
.faq-list summary{transition:color .15s ease-out}
.faq-list summary:active{color:var(--ink-soft)}
.faq-list summary .icon{transition:transform .35s cubic-bezier(.22,1,.36,1)}

/* FAQ answers open with the height instead of a jump (progressive). */
@supports (interpolate-size:allow-keywords) {
  .faq-list details{interpolate-size:allow-keywords}
  .faq-list details::details-content{block-size:0;overflow:clip;transition:block-size .4s cubic-bezier(.22,1,.36,1),content-visibility .4s allow-discrete}
  .faq-list details[open]::details-content{block-size:auto}
}

/* The chapter menu grows out of its own button on phones. */
@media(max-width:767px){
  .mobile-chapter-menu>nav{transform-origin:top right}
  .mobile-chapter-menu[open]>nav{animation:chapter-menu-in .3s cubic-bezier(.22,1,.36,1) both}
}
@keyframes chapter-menu-in{from{opacity:0;transform:translateY(-6px) scale(.96)}to{opacity:1;transform:none}}

@media(prefers-reduced-motion:reduce){
  .text-link:active,.hero-founder:active,.widget-style-controls button:active,.main-nav a:active,.mobile-chapter-menu summary:active,.site-footer a:active,.site-footer button:active{transform:none}
  .faq-list details::details-content{transition:none}
  .mobile-chapter-menu[open]>nav{animation:chapter-menu-fade .2s ease both}
}
@keyframes chapter-menu-fade{from{opacity:0}to{opacity:1}}

/* Reduced transparency: solid paper instead of blurred glass. */
@media(prefers-reduced-transparency:reduce){
  .site-header.has-scroll-surface::before{backdrop-filter:none;-webkit-backdrop-filter:none;background-image:none;background-color:#fffaf3}
  .screen-dialog::backdrop{backdrop-filter:none;background:#261b13e6}
  .mobile-chapter-menu summary{background:#fffaf3}
}

/* More contrast: darker secondary text and defined edges. */
@media(prefers-contrast:more){
  :root{--muted:var(--ink-soft);--border:#a6865f;--line:#b99b76}
  .site-header.has-scroll-surface.is-scrolled{box-shadow:0 1px 0 var(--border)}
  .hero-founder img{box-shadow:0 0 0 2px #fffaf3,0 0 0 3px var(--ink-soft)}
}
