html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    overflow-x: hidden;
}

/* --- Navbar --- */
.nav-link {
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: #c62828;
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 70%;
}

.mobile-nav-link {
    transition: all 0.2s ease;
}

.navbar-glass {
    transition: background-color 0.4s ease, backdrop-filter 0.4s ease, box-shadow 0.3s ease;
}

/* --- Scroll Animations (enhanced with blur reveal) --- */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.8s cubic-bezier(0.16, 1, 0.3, 1),
                filter 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    filter: blur(4px);
}

.animate-on-scroll.visible {
    opacity: 1;
    transform: translateY(0) translateX(0) scale(1);
    filter: blur(0);
}

/* Directional entrance variants */
.animate-on-scroll.from-left {
    transform: translateX(-60px);
}

.animate-on-scroll.from-right {
    transform: translateX(60px);
}

.animate-on-scroll.from-scale {
    transform: scale(0.8);
}

/* On mobile/tablet, fall back to vertical entrance (horizontal shift is too aggressive) */
@media (max-width: 1023px) {
    .animate-on-scroll.from-left,
    .animate-on-scroll.from-right {
        transform: translateY(40px);
    }
}

/* --- Gradient Background --- */
@keyframes gradient-shift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.gradient-shift {
    background-size: 200% 200%;
    animation: gradient-shift 8s ease infinite;
}

/* --- Hero Float Animations --- */
@keyframes hero-float-1 { 0%, 100% { transform: translate(0, 0) rotate(0deg); } 50% { transform: translate(15px, -20px) rotate(5deg); } }
@keyframes hero-float-2 { 0%, 100% { transform: translate(0, 0) rotate(0deg); } 50% { transform: translate(-20px, 15px) rotate(-5deg); } }
@keyframes hero-float-3 { 0%, 100% { transform: translate(0, 0) rotate(0deg); } 50% { transform: translate(10px, 10px) rotate(3deg); } }
@keyframes hero-float-4 { 0%, 100% { transform: translate(0, 0) rotate(0deg); } 50% { transform: translate(-15px, -10px) rotate(-3deg); } }
@keyframes hero-float-5 { 0%, 100% { transform: translate(0, 0) rotate(0deg); } 50% { transform: translate(12px, -15px) rotate(4deg); } }
@keyframes hero-float-6 { 0%, 100% { transform: translate(0, 0) rotate(0deg); } 50% { transform: translate(-10px, 12px) rotate(-4deg); } }

.hero-float-1 { animation: hero-float-1 6s ease-in-out infinite; }
.hero-float-2 { animation: hero-float-2 7s ease-in-out infinite; }
.hero-float-3 { animation: hero-float-3 5s ease-in-out infinite; }
.hero-float-4 { animation: hero-float-4 8s ease-in-out infinite; }
.hero-float-5 { animation: hero-float-5 5.5s ease-in-out infinite; }
.hero-float-6 { animation: hero-float-6 6.5s ease-in-out infinite; }

/* --- Hero Card Hover Bounce ---
   Uses `scale` property (independent from `transform`) so it composes
   with the float animation without conflict. Spring cubic-bezier for bounce. */
.hero-card {
    transition: scale 0.5s cubic-bezier(0.34, 1.56, 0.64, 1),
                filter 0.3s ease,
                background-color 0.3s ease,
                border-color 0.3s ease,
                box-shadow 0.3s ease;
    cursor: default;
}

.hero-card:hover {
    scale: 1.12;
    filter: brightness(1.15);
    background-color: rgba(255, 255, 255, 0.22);
    border-color: rgba(255, 255, 255, 0.45);
    box-shadow: 0 8px 32px rgba(198, 40, 40, 0.2);
}

/* --- Shimmer Text (gold light sweep on hero heading) --- */
@keyframes shimmer {
    0% { background-position: 200% center; }
    100% { background-position: -200% center; }
}

.shimmer-text {
    background: linear-gradient(
        90deg,
        #ffffff 0%, #ffffff 35%,
        #d4a017 48%, #ffd54f 52%,
        #ffffff 65%, #ffffff 100%
    );
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmer 5s ease-in-out infinite;
    animation-delay: 1.5s;
}

/* --- Pulse Ring --- */
@keyframes pulse-ring {
    0% { transform: scale(1); opacity: 0.3; }
    50% { transform: scale(1.05); opacity: 0.15; }
    100% { transform: scale(1); opacity: 0.3; }
}

.pulse-ring {
    animation: pulse-ring 3s ease-in-out infinite;
}

/* --- Wave Divider --- */
.wave-divider {
    width: 100%;
    height: 60px;
    overflow: hidden;
}

.wave-divider svg {
    width: 100%;
    height: 100%;
}

/* --- Counter --- */
@keyframes count-up {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.stat-number {
    animation: count-up 0.5s ease-out forwards;
}

/* --- Grain Overlay (premium noise texture on hero) --- */
.grain-overlay::after {
    content: '';
    position: absolute;
    inset: 0;
    opacity: 0.04;
    pointer-events: none;
    z-index: 1;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 256px 256px;
}

/* --- 3D Tilt Card (perspective follows mouse) --- */
.tilt-card {
    transform-style: preserve-3d;
    transition: transform 0.15s ease-out, box-shadow 0.3s ease;
}

.tilt-card:hover {
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
}

/* --- Magnetic Button (follows cursor subtly) --- */
.magnetic-btn {
    transition: transform 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* --- Parallax Layer --- */
[data-parallax] {
    will-change: translate;
}

/* --- Reduced Motion (respect user preference) --- */
@media (prefers-reduced-motion: reduce) {
    .animate-on-scroll {
        opacity: 1;
        transform: none;
        filter: none;
        transition: none;
    }

    .shimmer-text {
        animation: none;
        -webkit-text-fill-color: white;
    }

    .hero-float-1, .hero-float-2, .hero-float-3,
    .hero-float-4, .hero-float-5, .hero-float-6 {
        animation: none;
    }

    .pulse-ring {
        animation: none;
    }

    .gradient-shift {
        animation: none;
    }

    .hero-card {
        transition: background-color 0.3s ease, border-color 0.3s ease;
    }

    .tilt-card {
        transition: box-shadow 0.3s ease;
    }

    [data-parallax] {
        will-change: auto;
    }
}
