/* ========================================
   Davis John W Heating Cooling & Refrigeration
   Custom Styles — Editorial / Bold Design
   ======================================== */

/* Base */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

body {
    overflow-x: hidden;
}

/* Selection */
::selection {
    background-color: #14532d;
    color: #fefcf3;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #fefcf3;
}
::-webkit-scrollbar-thumb {
    background: #166534;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #14532d;
}

/* Navbar */
#navbar.scrolled {
    background: rgba(253, 252, 248, 0.95);
    backdrop-filter: blur(12px);
    box-shadow: 0 1px 0 rgba(20, 83, 45, 0.1);
}

#navbar.scrolled .logo-text {
    color: #14532d;
}

/* Mobile Menu */
.mobile-link {
    display: block;
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(20, 83, 45, 0.1);
    transition: color 0.3s ease;
}

.mobile-link:hover {
    color: #16a34a;
}

/* Floating Animation */
@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

@keyframes float-delayed {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-8px); }
}

.animate-float {
    animation: float 4s ease-in-out infinite;
}

.animate-float-delayed {
    animation: float-delayed 4s ease-in-out infinite;
    animation-delay: 1s;
}

/* Scroll Line Animation */
@keyframes scroll-line {
    0% { transform: translateY(-100%); }
    100% { transform: translateY(100%); }
}

.animate-scroll-line {
    animation: scroll-line 1.5s ease-in-out infinite;
}

/* Service Card Hover */
.service-card {
    transform: translateY(0);
    transition: transform 0.4s ease, box-shadow 0.4s ease, background-color 0.4s ease, border-color 0.4s ease;
}

.service-card:hover {
    transform: translateY(-4px);
}

/* Intersection Observer Animations */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }
.reveal-delay-5 { transition-delay: 0.5s; }
.reveal-delay-6 { transition-delay: 0.6s; }

/* Focus styles for accessibility */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid #16a34a;
    outline-offset: 2px;
}

/* Image loading placeholder */
img {
    background-color: #dcfce7;
}

/* Smooth image transitions */
img {
    transition: transform 0.6s ease;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    html {
        scroll-padding-top: 70px;
    }
    
    #hero h1 {
        font-size: 2.75rem;
    }
    
    .animate-float,
    .animate-float-delayed {
        display: none;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    #hero h1 {
        font-size: 4rem;
    }
}

/* Print styles */
@media print {
    #navbar,
    #contactForm,
    .animate-float,
    .animate-float-delayed,
    .animate-scroll-line {
        display: none !important;
    }
    
    body {
        color: #000;
        background: #fff;
    }
}
