/* Shared material footer for L’app and Methodology. Geometry matches L’app’s reveal. */
footer.site-footer{position:fixed!important;inset:auto 0 0;z-index:0;isolation:isolate;background:var(--saved-material,url('../audit/composition-app/materials/mix3.webp')) 0 -50px/100% calc(100% + 50px) no-repeat!important;padding:28px 24px 20px!important;margin:0;border:0;border-radius:0;font-family:-apple-system,BlinkMacSystemFont,'Helvetica Neue',Arial,sans-serif;line-height:1.55;box-sizing:border-box}
footer.site-footer *{box-sizing:border-box}
.footer-color-extend{position:fixed;left:0;right:0;height:53px;z-index:0;pointer-events:none;isolation:isolate;overflow:hidden;background:var(--saved-material,url('../audit/composition-app/materials/mix3.webp')) 0 0/100% var(--footer-total-h,360px) no-repeat}
footer.site-footer .footer-grid{display:grid;grid-template-columns:2fr 1fr 1fr 1fr;gap:40px;max-width:1080px;margin:0 auto 26px}
footer.site-footer .footer-brand{font:780 1.2rem/1.55 Satoshi,Arial,sans-serif;letter-spacing:-.025em;margin-bottom:8px;font-synthesis:none}
footer.site-footer .footer-brand-text{font-size:.8rem;line-height:1.55;margin-bottom:14px;letter-spacing:-.01em;max-width:320px}
footer.site-footer .footer-socials{display:flex;gap:10px}
footer.site-footer .social-link{width:30px;height:30px;display:flex;align-items:center;justify-content:center}
footer.site-footer .footer-col h4{font-size:.66rem;font-weight:700;line-height:1.55;letter-spacing:.08em;text-transform:uppercase;margin:0 0 10px}
footer.site-footer .footer-col a{display:block;font-size:.8rem;line-height:1.55;margin-bottom:7px;letter-spacing:-.01em;text-decoration:none;transition:opacity 150ms}
footer.site-footer .footer-col a:hover{opacity:.7}
footer.site-footer .footer-bottom{text-align:center;padding-top:16px;border-top:1px solid #ffffff24;font-size:.7rem;line-height:1.55;letter-spacing:-.01em}
footer.site-footer .footer-bottom a{margin:0 4px;text-decoration:none}
@media(max-width:768px){footer.site-footer{position:static!important}.footer-color-extend{display:none}.page-sheet{margin-bottom:0!important}}
@media(max-width:760px){footer.site-footer .footer-grid{grid-template-columns:1fr 1fr;gap:28px}}

/* Mobile curtain reveal only when the complete footer fits on the screen. */
@media(max-width:768px){
 html[data-footer-reveal=true] footer.site-footer{position:fixed!important}
 html[data-footer-reveal=true] .footer-color-extend{display:block}
 html[data-footer-reveal=true] .page-sheet{margin-bottom:var(--mobile-footer-gap,0px)!important}
}

/* Short public pages still occupy a complete first screen before the footer. */
body:has(>nav[data-public-header])>.page-sheet{min-height:100svh;box-sizing:border-box}

/* A light sheet meets the footer without a dark halo under its rounded corners. */
html[data-theme=light] body:has(>nav[data-public-header]) :is(.page-sheet,.sheet-bg){box-shadow:none!important}

/* Paint through the home-indicator area while keeping the final links above it.
   env(safe-area-inset-bottom) covers the gesture bar itself, but Safari's own
   floating/compact toolbar is a separate overlay that isn't represented by any
   safe-area value - it can leave a sliver below the last safe-area-aware pixel
   uncovered. The extra 28px is a fixed buffer against that, not a measured fit. */
@media(max-width:960px){
 footer.site-footer{padding-bottom:calc(20px + env(safe-area-inset-bottom,0px))!important;padding-left:max(24px,env(safe-area-inset-left,0px))!important;padding-right:max(24px,env(safe-area-inset-right,0px))!important}
}

/* Keep the established mobile layout. Position is decided from the stable viewport. */
@media(max-width:768px){
 footer.site-footer{padding-top:30px!important}
 html[data-footer-reveal=false] footer.site-footer{position:relative!important;inset:auto!important}
 html[data-footer-reveal=false] .footer-color-extend{display:none!important}
 html[data-footer-reveal=false] .page-sheet{margin-bottom:0!important}
 footer.site-footer .footer-grid{align-items:start;gap:25px 20px;margin-bottom:22px}
 footer.site-footer .footer-col h4{margin-top:0;line-height:1.55}
 footer.site-footer .footer-brand{margin-top:0;line-height:1.1;font-size:23px}
 footer.site-footer .footer-brand-text{font-size:12px;line-height:1.5;max-width:230px;margin:12px 0}
 footer.site-footer .footer-col a{font-size:12px;margin-bottom:8px}
 footer.site-footer .footer-col h4{font-size:10px;margin-bottom:12px}
 footer.site-footer .footer-bottom{font-size:10px;line-height:1.6}
 footer.site-footer .social-link{width:25px;height:25px}
}

/* Stop third-party/legacy sheet shadows from leaking below the last legal links. */
html[data-footer-reveal=false] footer.site-footer{width:100%}

footer.site-footer.site-footer--static{position:relative!important;inset:auto!important}

/* Continue the footer material behind the rounded sheet, including on mobile. */
html[data-footer-reveal=true] footer.site-footer::before{content:"";position:absolute;left:0;right:0;top:-50px;height:50px;pointer-events:none;background:var(--saved-material,url('../audit/composition-app/materials/mix3.webp')) 0 0/100% var(--footer-total-h,360px) no-repeat;z-index:-1}

/* The extra Safari buffer is phone-only; preserve the original desktop/tablet footer. */
@media(max-width:760px){footer.site-footer{padding-bottom:calc(20px + env(safe-area-inset-bottom,0px) + 28px)!important}}

/* Phone-only visual join to the page/browser backdrop. No new pinned surface.
   Fade only within the bottom padding; all footer text remains above it. */
@media(max-width:760px){
 footer.site-footer{
  background-image:linear-gradient(to bottom,transparent calc(100% - 28px - env(safe-area-inset-bottom,0px)),var(--bg,#080808) 100%),var(--saved-material,url('../audit/composition-app/materials/mix3.webp'))!important;
  background-position:0 0,0 -50px!important;
  background-size:100% 100%,100% calc(100% + 50px)!important;
  background-repeat:no-repeat!important;
 }
}
