/* Speed layer, loaded last on every public page. Keeps the look, swaps the expensive effects for cheap ones
   (big blurs and frosted glass are what made scrolling and hovering lag, especially on Windows laptops). */

/* 1. Soft glow shapes: a radial mask instead of filter: blur() (blur re-renders huge areas on every frame) */
.fq-orb, .bl-hero-orb, .hl-blob, .hl-cta-orb, .hw-orb, .maf-aurora, .rc-process-glow, .ab-duo-orb,
.hero-orb, .section-glow, .leadership-glow, .rv-blob, .auth-orb {
    filter: none !important;
    -webkit-mask-image: radial-gradient(closest-side, #000 0%, rgba(0, 0, 0, .55) 50%, transparent 100%);
            mask-image: radial-gradient(closest-side, #000 0%, rgba(0, 0, 0, .55) 50%, transparent 100%);
    will-change: transform;
}
.ask-rachy-card::before { display: none; }
.ask-rachy-card { box-shadow: 0 40px 90px -40px rgba(123, 60, 245, .75), 0 0 0 1px rgba(255, 255, 255, .06), inset 0 1px 0 rgba(255, 255, 255, .1); }

/* 2. Frosted glass: solid-enough backgrounds instead of backdrop-filter */
*, *::before, *::after { -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }
.navbar::before { background: rgba(255, 255, 255, .985) !important; }

/* 3. Word-by-word text reveals: fade and slide only (animating blur on hundreds of words is costly) */
.rachy-w, .rv-w, .rv-sc-slide.is-leaving > * { filter: none !important; }

/* 4. Navbar cursor light: the position doesn't need to be inherited by the whole menu */
@property --gx { syntax: '<length-percentage>'; inherits: false; initial-value: 50%; }
@property --gy { syntax: '<length-percentage>'; inherits: false; initial-value: 50%; }

/* 5. Rachy (on every page): float the whole robot as one GPU layer, without glow filters re-drawn every frame */
.rachy-float, .rachy-eye { filter: none !important; }
.rachy-float { animation: none !important; }
.rachy-launch .rachy-bot, .ask-rachy-bot, .hm-ask-bot { animation: rachyFloat 3.4s ease-in-out infinite; will-change: transform; }
.ab-story-glow { filter: none !important; -webkit-mask-image: radial-gradient(closest-side, #000, transparent); mask-image: radial-gradient(closest-side, #000, transparent); will-change: transform; }
@media (prefers-reduced-motion: reduce) { .rachy-launch .rachy-bot, .ask-rachy-bot { animation: none; } }

/* 6. Glow shadows on always-visible or moving icons: drawn as a soft halo instead of a filter */
.nm-orbit, .nm-clock-ring, .ab-story-mark, .hm-ring-bar { filter: none !important; }

/* 6. Sections off-screen: pause their looping animations (main.js adds .is-offscreen) */
.is-offscreen, .is-offscreen *, .is-offscreen *::before, .is-offscreen *::after { animation-play-state: paused !important; }

/* 7. Endless navbar effects (flowing gradients, shimmer, orbiting ring) repaint the fixed navbar 60 times a second
   on every page: the main cause of scroll lag on Windows laptops. They now play only while the pointer is over the
   navbar. The CTA's entrance animation is listed first, so only its second (endless) animation is paused. */
@media (min-width: 1025px) {
    .btn-navbar-cta { animation-play-state: paused !important; }
    html.nav-intro .navbar-right > .btn-navbar-cta { animation-play-state: running, paused !important; }
    .btn-navbar-cta::before, .btn-navbar-cta::after, .nav-link.active::after,
    .nm-bar-line, .nm-cta-ring, .nm-orbit > span { animation-play-state: paused !important; }
    .navbar:hover .btn-navbar-cta, .navbar:hover .btn-navbar-cta::before, .navbar:hover .btn-navbar-cta::after,
    .navbar:hover .nav-link.active::after, .navbar:hover .nm-bar-line, .navbar:hover .nm-cta-ring,
    .navbar:hover .nm-orbit > span { animation-play-state: running !important; }
    html.nav-intro .navbar:hover .navbar-right > .btn-navbar-cta { animation-play-state: running, running !important; }
}

/* 8. Animations nobody can see: the page loader once it is hidden, Rachy's chat header while the chat is closed */
.page-loader:not(.is-on):not(.is-slow) *, .rachy:not(.is-open) .rachy-panel * { animation-play-state: paused !important; }

/* 9. Floating buttons step above the cookie banner with a translate, not by changing "bottom":
   moving fixed elements by position counted as layout shift (CLS 0.17 on mobile tests). */
.wa-float, .back-to-top, .rachy-launch, .rachy-nudge, .bl-player, .rc-resume { translate: 0 calc(-1 * var(--wa-shift, 0px)); }


/* 11. The cookie banner is on screen from the first paint, so it uses the device's own font: when the web font
   arrived later the text re-wrapped, the banner grew and that counted as layout shift (CLS 0.18 in some tests). */
.cookie-notice, .cookie-notice * { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif !important; }

