/* R41 polish (2026-11-05): legibility, header fade, dark footer in dark mode, steady first paint. */
:where(p,li,figcaption,blockquote,dd){text-wrap:pretty}
:where(h1,h2,h3,h4){text-wrap:balance}
@view-transition{navigation:auto}

/* After the first scroll, content fades under the header instead of running under the logo. */
.edge-blur-top::before{content:"";position:absolute;inset:0;pointer-events:none;background:linear-gradient(to bottom,color-mix(in srgb,var(--paper,#f3f3f6) 94%,transparent) 0%,color-mix(in srgb,var(--paper,#f3f3f6) 84%,transparent) 50%,color-mix(in srgb,var(--paper,#f3f3f6) 0%,transparent) 100%);opacity:0;transition:opacity .35s cubic-bezier(.23,1,.32,1)}
html[data-r41-scrolled] .edge-blur-top::before{opacity:1}
@media (prefers-reduced-motion:reduce){.edge-blur-top::before{transition:none}}

/* Mobile menu: a soft fade at the bottom shows that the panel scrolls. */
@media (max-width:900px){.mobile-menu-body{padding-bottom:34px;-webkit-mask-image:linear-gradient(#000 calc(100% - 30px),transparent);mask-image:linear-gradient(#000 calc(100% - 30px),transparent)}}

/* Phones: the footer wordmark ends above the accessibility button. */
@media (max-width:760px){.water-footer .water-wordmark{margin-bottom:76px}}

/* Home: the h1 is visible, centred above the seal. It appears once the tuner layout is known
   (display:none until then), so it never jumps into place. */
html[data-celestial-home]:not([data-r41-tuner-ready]) #hero-title{display:none!important}
html[data-celestial-home][data-r41-tuner-ready] #hero-title{position:absolute!important;left:50%!important;top:calc(var(--tuner-logo-top,30svh) - 28px)!important;translate:-50% -100%;width:max-content!important;max-width:92vw!important;height:auto!important;margin:0!important;padding:0!important;overflow:visible!important;clip:auto!important;clip-path:none!important;white-space:normal!important;border:0!important;font-size:clamp(28px,3vw,46px)!important;font-weight:700!important;line-height:1.1!important;text-align:center!important;z-index:6;pointer-events:none;color:var(--ink);opacity:1!important;transform:none!important}

/* Steady first paint: tuner text appears once its position is known, so nothing jumps. */
html[data-celestial-home]:not([data-r41-tuner-ready]) :is(.tuner-guidance,.tuner-mobile-continuation,.hero-aside){visibility:hidden!important}

/* One hint at a time: the tuner hints wait until the entry gate closes. */
html[data-r41-gate-open] :is(.tuner-guidance,.tuner-mobile-continuation){visibility:hidden!important;opacity:0!important}
