/* ==========================================================================
   ANIMATIONS - Scroll-based / AOS / Reveal
   ========================================================================== */

/* ---------- Base AOS-like ---------- */
[data-aos] {
    opacity: 0;
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform, opacity;
}

[data-aos="fade-up"] { transform: translateY(60px); }
[data-aos="fade-down"] { transform: translateY(-60px); }
[data-aos="fade-left"] { transform: translateX(60px); }
[data-aos="fade-right"] { transform: translateX(-60px); }
[data-aos="zoom-in"] { transform: scale(0.85); }
[data-aos="zoom-out"] { transform: scale(1.15); }
[data-aos="flip-up"] { transform: perspective(1000px) rotateX(-30deg); transform-origin: center bottom; }
[data-aos="flip-left"] { transform: perspective(1000px) rotateY(-90deg); }
[data-aos="slide-up"] { transform: translateY(100px); }

/* Animated state */
[data-aos].animated {
    opacity: 1;
    transform: translate(0) scale(1) rotate(0) perspective(1000px) rotateX(0) rotateY(0);
}

/* ---------- Reveal text line by line ---------- */
.hero-title .line {
    transform: translateY(100%);
    opacity: 0;
    animation: revealLine 0.9s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
.hero-title .line:nth-child(1) { animation-delay: 0.3s; }
.hero-title .line:nth-child(2) { animation-delay: 0.5s; }

@keyframes revealLine {
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ---------- Particles ---------- */
.particle {
    position: absolute;
    background: var(--gold);
    border-radius: 50%;
    opacity: 0.4;
    pointer-events: none;
    animation: particleFloat linear infinite;
}

@keyframes particleFloat {
    0% {
        transform: translateY(100vh) translateX(0) rotate(0deg);
        opacity: 0;
    }
    10% { opacity: 0.6; }
    90% { opacity: 0.6; }
    100% {
        transform: translateY(-100vh) translateX(100px) rotate(360deg);
        opacity: 0;
    }
}

/* ---------- Counter animation ---------- */
.counter {
    display: inline-block;
    transition: transform 0.3s;
}

/* ---------- Hover Glow ---------- */
.hover-glow {
    transition: all 0.4s;
}
.hover-glow:hover {
    box-shadow: 0 0 30px var(--gold);
}

/* ---------- Skeleton Loader ---------- */
.skeleton {
    background: linear-gradient(90deg, var(--bg-card) 0%, var(--bg-card-light) 50%, var(--bg-card) 100%);
    background-size: 200% 100%;
    animation: skeleton 1.5s infinite;
    border-radius: var(--radius);
    min-height: 200px;
}
@keyframes skeleton {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ---------- Tilt on hover ---------- */
.tilt {
    transform-style: preserve-3d;
    transition: transform 0.3s;
}

/* ---------- Parallax slow elements ---------- */
.parallax-slow {
    will-change: transform;
}

/* ---------- Section transitions ---------- */
.section {
    transition: background 0.5s;
}

/* ---------- Glow text ---------- */
.glow-text {
    text-shadow: 0 0 20px rgba(201, 161, 74, 0.5);
}

/* ---------- Pulse Ring ---------- */
.pulse-ring {
    animation: pulseRing 2s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}
@keyframes pulseRing {
    0% { box-shadow: 0 0 0 0 rgba(201, 161, 74, 0.6); }
    70% { box-shadow: 0 0 0 20px rgba(201, 161, 74, 0); }
    100% { box-shadow: 0 0 0 0 rgba(201, 161, 74, 0); }
}

/* ---------- Underline animation ---------- */
.underline-anim {
    position: relative;
    display: inline-block;
}
.underline-anim::after {
    content: '';
    position: absolute;
    bottom: -4px;
    right: 0;
    width: 0;
    height: 2px;
    background: var(--gold);
    transition: width 0.4s;
}
.underline-anim:hover::after {
    width: 100%;
}

/* ---------- Magnetic effect support ---------- */
.magnetic {
    transition: transform 0.2s;
}

/* ==========================================================================
   HOVER / TOUCH INTERACTIONS
   ========================================================================== */

/* ----- Interactive cards: 3D tilt + shine sweep ----- */
.service-card,
.team-card,
.pricing-card,
.stat-item,
.contact-item,
.info-card {
    transform-style: preserve-3d;
    perspective: 1000px;
}

/* shine sweep on hover */
.service-card,
.pricing-card,
.team-card {
    position: relative;
    overflow: hidden;
}
.service-card::after,
.pricing-card::after,
.team-card::after {
    content: "";
    position: absolute;
    top: -50%;
    left: -75%;
    width: 50%;
    height: 200%;
    background: linear-gradient(
        100deg,
        transparent 0%,
        rgba(255,255,255,0.06) 40%,
        rgba(232,196,118,0.18) 50%,
        rgba(255,255,255,0.06) 60%,
        transparent 100%
    );
    transform: skewX(-20deg);
    transition: left 0.9s cubic-bezier(0.4,0,0.2,1);
    pointer-events: none;
    z-index: 1;
}
.service-card:hover::after,
.pricing-card:hover::after,
.team-card:hover::after,
.service-card.touched::after,
.pricing-card.touched::after,
.team-card.touched::after {
    left: 125%;
}

.service-card > *,
.pricing-card > *,
.team-card > * {
    position: relative;
    z-index: 2;
}

/* ----- Service icon: bouncy rotation ----- */
.service-card .service-icon {
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1),
                background 0.4s, color 0.4s;
}
.service-card:hover .service-icon,
.service-card.touched .service-icon {
    transform: rotate(-10deg) scale(1.15) translateY(-4px);
}

/* ----- Service title gold sweep ----- */
.service-card h3 {
    transition: color 0.35s, transform 0.35s;
    display: inline-block;
}
.service-card:hover h3,
.service-card.touched h3 {
    color: var(--gold);
    transform: translateX(-4px);
}

/* ----- Team card: image zoom + filter ----- */
.team-img img {
    transition: transform 0.7s cubic-bezier(0.4,0,0.2,1),
                filter 0.5s;
    filter: grayscale(15%) brightness(0.95);
}
.team-card:hover .team-img img,
.team-card.touched .team-img img {
    transform: scale(1.12) rotate(-1deg);
    filter: grayscale(0%) brightness(1.05);
}

/* ----- Team overlay slide-up ----- */
.team-overlay {
    transform: translateY(20px);
    transition: opacity var(--transition), transform var(--transition);
}
.team-card:hover .team-overlay,
.team-card.touched .team-overlay {
    transform: translateY(0);
}

/* ----- Team info: name color animation ----- */
.team-info h3 {
    transition: color 0.35s;
}
.team-card:hover .team-info h3,
.team-card.touched .team-info h3 {
    color: var(--gold);
}

/* ----- Pricing card lift + glow ----- */
.pricing-card {
    transition: transform 0.45s cubic-bezier(0.4,0,0.2,1),
                box-shadow 0.45s,
                border-color 0.45s,
                background 0.45s;
}
.pricing-card:hover,
.pricing-card.touched {
    border-color: var(--gold);
    box-shadow: 0 20px 50px rgba(201,161,74,0.35),
                0 0 0 1px var(--gold);
}
.pricing-card.featured {
    animation: featuredPulse 3s ease-in-out infinite;
}
@keyframes featuredPulse {
    0%, 100% { box-shadow: 0 10px 40px rgba(201,161,74,0.25); }
    50%      { box-shadow: 0 15px 60px rgba(201,161,74,0.5); }
}

/* ----- Stat item: number pop ----- */
.stat-item .stat-icon {
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: inline-block;
}
.stat-item:hover .stat-icon,
.stat-item.touched .stat-icon {
    transform: scale(1.25) rotate(15deg);
}
.stat-item h3 {
    transition: text-shadow 0.4s, transform 0.4s;
}
.stat-item:hover h3,
.stat-item.touched h3 {
    text-shadow: 0 0 30px rgba(201,161,74,0.7);
    transform: scale(1.06);
}

/* ----- Contact item icon bounce ----- */
.contact-item .contact-icon {
    transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1),
                background 0.35s, color 0.35s;
}
.contact-item:hover .contact-icon,
.contact-item.touched .contact-icon {
    background: var(--gold);
    color: var(--bg-dark);
    transform: rotate(-8deg) scale(1.1);
}

/* ----- Button ripple & magnetic feel ----- */
.btn {
    overflow: hidden;
    position: relative;
}
.btn .ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255,255,255,0.4);
    transform: scale(0);
    animation: ripple 0.7s linear;
    pointer-events: none;
}
@keyframes ripple {
    to { transform: scale(4); opacity: 0; }
}

/* ----- Nav link hover lift ----- */
.nav-link {
    transition: color var(--transition), transform 0.25s, background 0.25s;
}
.nav-link:hover {
    transform: translateY(-2px);
}

/* ----- Logo subtle rotation on hover ----- */
.logo-img {
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1),
                box-shadow 0.4s;
}
.logo-link:hover .logo-img {
    transform: rotate(360deg) scale(1.08);
    box-shadow: 0 0 35px rgba(201,161,74,0.7);
}

/* ----- Form inputs: glow + lift on focus ----- */
.form-group input,
.form-group select,
.form-group textarea {
    transition: border-color 0.3s, box-shadow 0.3s, transform 0.25s, background 0.3s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    transform: translateY(-2px);
    background: #0e0e0e;
}

/* ----- Form group label float effect ----- */
.form-group {
    position: relative;
}
.form-group label {
    transition: color 0.3s, transform 0.3s;
}
.form-group:focus-within label {
    color: var(--gold-light);
    transform: translateX(-4px);
}

/* ----- Footer links: arrow appear ----- */
.footer-col ul li a {
    position: relative;
    display: inline-block;
    padding-right: 0;
}
.footer-col ul li a::before {
    content: "›";
    position: absolute;
    right: -14px;
    opacity: 0;
    color: var(--gold);
    font-weight: 800;
    transition: opacity 0.3s, right 0.3s;
}
.footer-col ul li a:hover::before {
    opacity: 1;
    right: -10px;
}

/* ----- Back to top: pulse on hover ----- */
#backToTop {
    transition: transform 0.35s, box-shadow 0.35s;
}
#backToTop:hover {
    transform: translateY(-6px) scale(1.1);
    box-shadow: 0 20px 50px rgba(201,161,74,0.6);
    animation: btnPulse 1.2s ease-in-out infinite;
}
@keyframes btnPulse {
    0%, 100% { box-shadow: 0 20px 50px rgba(201,161,74,0.6); }
    50%      { box-shadow: 0 20px 50px rgba(201,161,74,0.9), 0 0 0 8px rgba(201,161,74,0.15); }
}

/* ----- Touch device: explicit .touched class will show hover state briefly ----- */
@media (hover: none) and (pointer: coarse) {
    .service-card:active,
    .team-card:active,
    .pricing-card:active,
    .stat-item:active,
    .contact-item:active {
        transform: scale(0.98);
    }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
