/* ------------------------------------------------------------------
   3D effects. Everything here only applies when <html> has the class "fx3d",
   which site.js adds when config.js has  fx3d: true.
   To turn it all off instantly: set  fx3d: false  in config.js.
   Effects only run on hover (no constant animation), so they stay light on the CPU.
   ------------------------------------------------------------------ */

/* Cards and panels tilt toward the mouse, a few degrees at most */
html.fx3d .tilt{
  transform:perspective(1000px) rotateX(calc(var(--bx,0deg) + var(--rx,0deg))) rotateY(calc(var(--by,0deg) + var(--ry,0deg)));
  transition:transform .7s var(--ease),box-shadow .7s var(--ease);
}
html.fx3d .tilt.tilting{transition:transform .14s ease-out,box-shadow .4s ease}

/* The hero console fades in with an animation that would otherwise lock its transform */
html.fx3d .console.tilt{opacity:1;animation:fade3d 1s .35s backwards}
@keyframes fade3d{from{opacity:0;transform:perspective(1000px) translateY(16px) rotateY(-14deg) rotateX(6deg)}}

/* A few showpieces rest at a slight angle, then turn to face you on hover */
html.fx3d .console,
html.fx3d .browser{--by:-6deg;--bx:3deg}
html.fx3d .recents{--by:10deg;--bx:4deg}
html.fx3d .tilt.tilting{--bx:0deg;--by:0deg}

/* Lifted shadow while tilting, so it feels like it rises off the page */
html.fx3d .tilt.tilting{box-shadow:0 50px 90px -45px rgba(0,0,0,.85)}
html.fx3d .recents.tilting{box-shadow:0 50px 90px -40px rgba(22,19,14,.55),0 0 0 1px rgba(22,19,14,.06)}
html.fx3d .console,
html.fx3d .browser{box-shadow:0 60px 120px -50px rgba(0,0,0,.95),0 0 0 1px rgba(243,234,216,.06)}

/* Sections rise into place with a small backward tip instead of a flat slide */
html.fx3d .rv:not(.in){transform:perspective(1000px) translateY(30px) rotateX(9deg)}

/* Problem stats: the big numbers get a stacked, carved-out depth */
html.fx3d .pb-stats b{
  text-shadow:1px 1px 0 #b9ad94,2px 2px 0 #b2a68c,3px 3px 0 #ab9f85,4px 4px 0 #a4987e,5px 5px 0 #9d9177,10px 14px 22px rgba(22,19,14,.28);
}
html.fx3d .pb-stats b span{text-shadow:1px 1px 0 #a8371f,2px 2px 0 #9a311b,3px 3px 0 #8c2c18}

/* Big serif headlines get a soft depth shadow */
html.fx3d .display{text-shadow:0 1px 0 rgba(0,0,0,.35),0 14px 30px rgba(0,0,0,.45)}

@media (prefers-reduced-motion:reduce){
  html.fx3d .tilt,html.fx3d .rv:not(.in){transform:none!important}
}
