/**
 * Shared site animation system — see .claude/skills/site-animations/SKILL.md
 * Loaded once, site-wide, from includes/header.php.
 */

/* ── Scroll reveal (driven by GSAP + ScrollTrigger in assets/js/animations.js) ──
   GSAP owns the actual transform/opacity tweening (inline styles, highest specificity
   anyway), so this file only needs a pre-hide to avoid a flash of unstyled content
   before the GSAP bundle finishes loading and running. */

@media (prefers-reduced-motion: no-preference) {
    [data-reveal] {
        opacity: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    [data-reveal] {
        opacity: 1;
    }
}

/* ── Hover / micro-interaction utilities ───────────────────────────────────── */

.hover-lift {
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
.hover-lift:hover {
    transform: translateY(-6px);
    box-shadow: 0 24px 40px -20px rgba(0, 0, 0, 0.18);
}

.btn-shimmer {
    position: relative;
    overflow: hidden;
    isolation: isolate;
}
.btn-shimmer::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(115deg, transparent 20%, rgba(255, 255, 255, 0.35) 50%, transparent 80%);
    transform: translateX(-120%);
    transition: transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 1;
    pointer-events: none;
}
.btn-shimmer:hover::after {
    transform: translateX(120%);
}

.underline-grow {
    position: relative;
    text-decoration: none;
}
.underline-grow::after {
    content: "";
    position: absolute;
    left: 50%;
    right: 50%;
    bottom: -2px;
    height: 1px;
    background: currentColor;
    transition: left 0.35s cubic-bezier(0.16, 1, 0.3, 1), right 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
.underline-grow:hover::after {
    left: 0;
    right: 0;
}

/* ── Nav shrink-on-scroll (class toggled by ScrollTrigger in animations.js) ── */

#site-nav.nav-scrolled {
    box-shadow: 0 10px 30px -15px rgba(0, 0, 0, 0.15);
}
#site-nav.nav-scrolled .max-w-\[1440px\] {
    height: 3.5rem;
}

/* ── Continuous idle motion — always visible, not scroll-gated ─────────────── */

@media (prefers-reduced-motion: no-preference) {
    .animate-float-idle {
        animation: float-idle 3.4s ease-in-out infinite;
    }
}
@keyframes float-idle {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-6px); }
}

/* ── 3D mouse-tilt hover (paired with initCardTilt in animations.js) ───────── */

[data-tilt] {
    transform-style: preserve-3d;
    will-change: transform;
}

/* ── Back-to-top button (visibility toggled by GSAP in animations.js) ──────── */

#back-to-top.is-visible {
    opacity: 1;
    pointer-events: auto;
}

/* ── Hero parallax hook (translated via JS on scroll) ──────────────────────── */

@media (prefers-reduced-motion: no-preference) {
    [data-parallax] {
        will-change: transform;
    }
}

/* ── Count-up number hook (see animations.js) ──────────────────────────────── */

[data-count-to] {
    font-variant-numeric: tabular-nums;
}

/* ── Shared keyframes (kept for pages still using the legacy class names) ─── */

@keyframes fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}
.animate-fade-in {
    animation: fade-in 0.8s cubic-bezier(0.2, 0, 0, 1) forwards;
}

@keyframes fade-in-up {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}
.animate-fade-in-up {
    animation: fade-in-up 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
