/* Google Fonts handled in HTML for performance */


/* Base Variables */
:root {
    --background: 142 10% 2%;
    --foreground: 142 10% 98%;

    --card: 142 10% 5%;
    --card-foreground: 142 10% 98%;

    --popover: 142 10% 5%;
    --popover-foreground: 142 10% 98%;

    --primary: 106 44% 38%;
    /* Rich Forest Green from Logo */
    --primary-foreground: 0 0% 100%;

    --secondary: 142 10% 8%;
    /* Deep Black/Gray */
    --secondary-foreground: 142 10% 98%;

    --muted: 142 10% 12%;
    --muted-foreground: 142 5% 85%;
    /* Lighter for readability */

    --accent: 106 44% 45%;
    --accent-foreground: 0 0% 100%;

    --destructive: 0 84% 60%;
    --destructive-foreground: 0 0% 100%;

    --border: 106 20% 20%;
    --input: 106 20% 20%;
    --ring: 106 44% 38%;

    --radius: 0.5rem;

    /* Custom design tokens */
    --green: 106 44% 38%;
    --dark: 142 10% 2%;
    --gray: 142 5% 75%;
    /* Lighter gray */

    --gradient-hero: linear-gradient(135deg, hsl(142 10% 2%) 0%, hsl(142 10% 5%) 100%);
    --gradient-primary: linear-gradient(135deg, hsl(106 44% 38%) 0%, hsl(106 44% 28%) 100%);
    --gradient-overlay: linear-gradient(180deg, hsla(142 10% 2% / 0.7) 0%, hsla(142 10% 2% / 0.8) 100%);

    --shadow-soft: 0 4px 20px -4px hsla(106 44% 10% / 0.3);
    --shadow-card: 0 8px 30px -8px hsla(106 44% 10% / 0.5);
    --shadow-glow: 0 0 40px hsla(106 44% 38% / 0.2);

    --font-heading: 'Roboto', sans-serif;
    --font-body: 'Roboto', sans-serif;
}

.dark {
    --background: 142 10% 2%;
    --foreground: 142 10% 98%;

    --card: 142 10% 5%;
    --card-foreground: 142 10% 98%;

    --popover: 142 10% 5%;
    --popover-foreground: 142 10% 98%;

    --primary: 106 44% 38%;
    --primary-foreground: 0 0% 100%;

    --secondary: 142 10% 10%;
    --secondary-foreground: 142 10% 98%;

    --muted: 142 10% 15%;
    --muted-foreground: 142 5% 85%;

    --accent: 106 44% 38%;
    --accent-foreground: 0 0% 100%;

    --destructive: 0 62% 30%;
    --destructive-foreground: 142 10% 98%;

    --border: 106 20% 25%;
    --input: 106 20% 25%;
    --ring: 106 44% 38%;
}

/* Base Styles */
* {
    border-color: hsl(var(--border));
}

html,
body {
    overflow-x: hidden;
}

body {
    background-color: hsl(var(--background));
    color: hsl(var(--foreground));
    font-family: var(--font-body);
    cursor: default;
}

/* Smart Header - Hide on scroll down, show on scroll up (mobile only) */
@media (max-width: 1023px) {
    nav {
        transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    }

    nav.nav-hidden {
        transform: translateY(-100%);
    }
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    font-weight: 500;
    /* Less bold as requested */
}

/* Logo text strikethrough 'cut' (matches URG logo style) */
.logo-strikethrough {
    display: inline-block;
    /* This creates a literal 4px transparent gap in the text */
    -webkit-mask-image: linear-gradient(to bottom,
            black 0%,
            black calc(45% - 2px),
            transparent calc(45% - 2px),
            transparent calc(45% + 2px),
            black calc(45% + 2px),
            black 100%);
    mask-image: linear-gradient(to bottom,
            black 0%,
            black calc(45% - 2px),
            transparent calc(45% - 2px),
            transparent calc(45% + 2px),
            black calc(45% + 2px),
            black 100%);
}

/* Card Hover Effects */
.card-hover {
    transition: all 0.3s ease;
}

.card-hover:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-glow);
}

/* Button Shine Animation */
@keyframes btn-shine {
    0% {
        left: -100%;
    }

    20% {
        left: 100%;
    }

    100% {
        left: 100%;
    }
}

/* Base Shine Style for All Buttons */
.btn-shine {
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.btn-shine::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: 0.5s;
    z-index: -1;
}

/* Shine on Hover for Standard Buttons */
.btn-shine:hover::before {
    animation: btn-shine 1s;
}

/* Continuous CTA Animation */
.animate-cta {
    background: var(--primary);
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    z-index: 1;
}

.animate-cta::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: 0.5s;
    z-index: -1;
    animation: btn-shine 3s infinite;
}



.animate-cta:hover {
    opacity: 0.9;
}

/* Base Shine Style for All Primary Green Buttons */
.bg-primary.btn {
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.bg-primary.btn:not(.animate-cta)::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: 0.5s;
    z-index: -1;
}

.bg-primary.btn:not(.animate-cta):hover::before {
    animation: btn-shine 1.5s infinite;
}

/* Before/After Slider */
.ba-slider {
    position: relative;
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    aspect-ratio: 16/9;
    overflow: hidden;
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
    border: 2px solid hsl(var(--border));
    background: #000;
}

.ba-slider .after,
.ba-slider .before {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
}

.ba-slider .after {
    background-image: url('images/snowremoval-after.png');
    z-index: 1;
}

.ba-slider .before {
    background-image: url('images/snowremoval-before.png');
    z-index: 2;
    /* This will be controlled by JavaScript via CSS variable */
    clip-path: inset(0 calc(100% - var(--exposure, 50%)) 0 0);
}

/* Vertical line for the slider edge */
.ba-slider::after {
    content: '';
    position: absolute;
    top: 0;
    left: var(--exposure, 50%);
    width: 4px;
    height: 100%;
    background: hsl(var(--primary));
    z-index: 3;
    transform: translateX(-50%);
    pointer-events: none;
}

.ba-slider input[type="range"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    appearance: none;
    -webkit-appearance: none;
    z-index: 4;
    outline: none;
    margin: 0;
    cursor: ew-resize;
    touch-action: none;
}

.ba-slider input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 48px;
    height: 48px;
    background: hsl(var(--primary));
    border: 4px solid white;
    border-radius: 50%;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m18 8 4 4-4 4'/%3E%3Cpath d='m6 8-4 4 4 4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    cursor: ew-resize;
}

.ba-slider input[type="range"]::-moz-range-thumb {
    width: 48px;
    height: 48px;
    background: hsl(var(--primary));
    border: 4px solid white;
    border-radius: 50%;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m18 8 4 4-4 4'/%3E%3Cpath d='m6 8-4 4 4 4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    cursor: ew-resize;
}

.ba-label {
    position: absolute;
    top: 20px;
    padding: 8px 16px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    border-radius: 4px;
    z-index: 2;
    pointer-events: none;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.ba-label.before-label {
    left: 20px;
}

.ba-label.after-label {
    right: 20px;
}

/* Gallery Shuffle Entrance Animation */
@keyframes shuffleIn {
    0% {
        opacity: 0;
        transform: translateY(30px) scale(0.9) rotate(-3deg);
    }

    100% {
        opacity: 1;
        transform: translateY(0) scale(1) rotate(0);
    }
}

.gallery-item {
    opacity: 0;
}

.gallery-item.visible {
    animation: shuffleIn 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Mobile Optimizations */
@media (max-width: 768px) {

    /* Mobile Menu Interactive Animations */
    #mobile-menu {
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1),
            opacity 0.3s ease;
        opacity: 0;
        padding: 0 !important;
        border-top: none !important;
    }

    #mobile-menu.active {
        max-height: 500px;
        opacity: 1;
        padding-bottom: 1rem !important;
        border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
    }

    /* ID selector + !important beats Tailwind's .transition-colors */
    #mobile-menu .mobile-nav-link {
        opacity: 0;
        transform: translateY(15px);
        transition: opacity 0.35s ease-out, transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
    }

    #mobile-menu.active .mobile-nav-link {
        opacity: 1;
        transform: translateY(0);
    }

    /* Staggered Delays - Top-Down Drop Cascade */
    #mobile-menu.active .mobile-nav-link:nth-child(1) {
        transition-delay: 0.08s;
    }

    #mobile-menu.active .mobile-nav-link:nth-child(2) {
        transition-delay: 0.13s;
    }

    #mobile-menu.active .mobile-nav-link:nth-child(3) {
        transition-delay: 0.18s;
    }

    #mobile-menu.active .mobile-nav-link:nth-child(4) {
        transition-delay: 0.23s;
    }

    #mobile-menu.active .mobile-nav-link:nth-child(5) {
        transition-delay: 0.28s;
    }

    #mobile-menu.active .mobile-nav-link:nth-child(6) {
        transition-delay: 0.35s;
    }

    #mobile-menu.active .mobile-nav-link:nth-child(7) {
        transition-delay: 0.42s;
    }

    /* Icon Physics */
    #mobile-menu-btn {
        position: relative;
        width: 48px;
        height: 48px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    #mobile-menu-btn .menu-icon,
    #mobile-menu-btn .close-icon {
        position: absolute;
        transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    }

    #mobile-menu-btn.active .menu-icon {
        transform: rotate(90deg) scale(0);
        opacity: 0;
    }

    #mobile-menu-btn.active .close-icon {
        transform: rotate(0) scale(1);
        opacity: 1;
    }

    #mobile-menu-btn .close-icon {
        transform: rotate(-90deg) scale(0);
        opacity: 0;
    }

    /* Hero Section Adjustments */
    .mobile-hero-height {
        min-height: 85vh !important;
        display: flex;
        align-items: center !important;
        padding-top: 50px !important;
        /* Minimal offset for the fixed header */
        padding-bottom: 50px !important;
    }

    /* Before/After Slider Mobile Fix */
    .ba-slider {
        height: 250px !important;
        aspect-ratio: auto !important;
    }

    /* Restoring Excellence Image Adjustment */
    .mobile-about-image {
        height: 350px !important;
    }

    /* General hero text sizing for mobile if needed */
    .mobile-hero-title {
        font-size: 3.5rem !important;
        line-height: 1.1 !important;
    }

    /* Testimonials Mobile Optimization */
    .testimonial-card {
        padding: 1.5rem !important;
    }

    .testimonial-card p {
        font-size: 0.95rem !important;
        margin-bottom: 1rem !important;
    }

    .testimonial-card+.testimonial-card {
        margin-top: 0 !important;
    }

    #testimonials-section {
        padding-top: 3rem !important;
        padding-bottom: 3rem !important;
    }
}