/* Tech Guardian GSAP — cinematic prep CSS.
 * - Mouse-reactive glow orb (desktop only, mix-blend so it never blocks content)
 * - Floating-depth / glow elements get GPU compositing hints
 * - FOUC release fallback if JS never runs
 * - Optional grid pattern (opt-in via .tg-grid-drift)
 */

/* ---------- 1) Mouse-reactive glow orb ---------- */
/* Wrapper sits on top of everything but never receives pointer events
 * and never paints destructively because of mix-blend-mode: screen.
 * Hidden on touch / coarse-pointer / small viewports.
 */
.tg-glow {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9999;
    overflow: hidden;
    mix-blend-mode: screen;
    opacity: 0;
    transition: opacity 700ms ease;
    contain: strict;
}
html.tg-gsap-ready .tg-glow { opacity: 1; }

.tg-glow-orb {
    position: absolute;
    top: 0;
    left: 0;
    width: 800px;
    height: 800px;
    border-radius: 50%;
    background: radial-gradient(
        circle,
        rgba(10, 132, 255, 0.16) 0%,
        rgba(10, 132, 255, 0.06) 30%,
        rgba(110, 184, 255, 0.02) 55%,
        transparent 72%
    );
    will-change: transform;
    filter: saturate(1.2);
}

/* hide on touch / coarse pointer / small viewports */
@media (max-width: 768px), (pointer: coarse) {
    .tg-glow { display: none !important; }
}

/* ---------- 2) Floating-depth GPU hint (opt-in elements only) ---------- */
[data-tg-float],
.tg-float {
    will-change: transform;
}

/* ---------- 3) FOUC release fallback ---------- */
/* If JS never runs (offline, error), release hero text after 1.5s so the
 * page never sits invisibly waiting.
 */
@keyframes tg-gsap-release { to { opacity: 1; filter: none; } }

html:not(.tg-gsap-ready) h1,
html:not(.tg-gsap-ready) .elementor-heading-title {
    animation: tg-gsap-release 0s linear 1.5s forwards;
}

/* ---------- 4) Optional grid pattern (opt-in) ---------- */
/* Apply .tg-grid-drift to a section background to get a subtle blue grid
 * pattern that drifts slowly via JS. Skip if the section already has its
 * own background-image — this rule won't override it.
 */
.tg-grid-drift {
    background-image:
        linear-gradient(rgba(10, 132, 255, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(10, 132, 255, 0.05) 1px, transparent 1px);
    background-size: 64px 64px;
    background-position: 0 0;
}

/* ---------- 5) Magnetic CTA polish ---------- */
/* Smooth out any inline transition that would fight gsap.quickTo. */
.nav-book,
.footer-cta-btn,
.tg-magnetic,
[data-tg-magnetic] {
    will-change: transform;
}

/* ---------- 6) Reduced motion: kill ambient effects entirely ---------- */
@media (prefers-reduced-motion: reduce) {
    .tg-glow,
    .tg-glow-orb { display: none !important; }
    [data-tg-float],
    .tg-float { will-change: auto; }
}
