/* ===== Custom Styles for K&A Replacement Windows ===== */

/* --- Global --- */
html {
    scroll-behavior: smooth;
}

body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

::selection {
    background-color: #047857;
    color: #fefdf8;
}

/* --- Navbar --- */
.nav-text {
    transition: color 0.4s ease;
}

.nav-text-sub {
    transition: color 0.4s ease;
}

.nav-link {
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: #047857;
    transition: width 0.3s ease;
}

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

/* Scrolled navbar state */
.navbar-scrolled {
    background: rgba(254, 253, 248, 0.95) !important;
    backdrop-filter: blur(12px);
    box-shadow: 0 1px 20px rgba(0, 0, 0, 0.08);
}

.navbar-scrolled .nav-text {
    color: #111111;
}

.navbar-scrolled .nav-text-sub {
    color: #047857;
}

/* --- Floating Cards --- */
@keyframes float1 {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-12px) rotate(0.5deg); }
}

@keyframes float2 {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-8px) rotate(-0.5deg); }
}

@keyframes float3 {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

@keyframes float4 {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-6px) rotate(0.5deg); }
}

.floating-card:nth-child(1) { animation: float1 5s ease-in-out infinite; }
.floating-card:nth-child(2) { animation: float2 6s ease-in-out infinite; }
.floating-card:nth-child(3) { animation: float3 4.5s ease-in-out infinite; }
.floating-card:nth-child(4) { animation: float4 5.5s ease-in-out infinite; }

/* --- Service Cards --- */
.service-card {
    position: relative;
    overflow: hidden;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 0;
    background: #047857;
    transition: height 0.4s ease;
}

.service-card:hover::before {
    height: 100%;
}

/* --- Gallery --- */
.gallery-item {
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.gallery-item::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(4, 120, 87, 0.3) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.gallery-item:hover::after {
    opacity: 1;
}

/* --- Process Steps --- */
.process-step {
    position: relative;
}

.process-step:hover .w-16 {
    transform: scale(1.1) rotate(5deg);
    transition: transform 0.3s ease;
}

/* --- Scroll Reveal Animations --- */
.reveal {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal[data-reveal] {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal[data-reveal="left"] {
    transform: translateX(-30px);
}

.reveal[data-reveal="right"] {
    transform: translateX(30px);
}

.reveal[data-reveal="scale"] {
    transform: scale(0.95);
}

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

/* --- Mobile Menu --- */
.mobile-nav-link {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

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

#mobileMenu.open .mobile-nav-link:nth-child(1) { transition-delay: 0.05s; }
#mobileMenu.open .mobile-nav-link:nth-child(2) { transition-delay: 0.1s; }
#mobileMenu.open .mobile-nav-link:nth-child(3) { transition-delay: 0.15s; }
#mobileMenu.open .mobile-nav-link:nth-child(4) { transition-delay: 0.2s; }
#mobileMenu.open .mobile-nav-link:nth-child(5) { transition-delay: 0.25s; }
#mobileMenu.open .mobile-nav-link:nth-child(6) { transition-delay: 0.3s; }

/* --- Menu Button --- */
#menuBtn.active .menu-line:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

#menuBtn.active .menu-line:nth-child(2) {
    opacity: 0;
}

#menuBtn.active .menu-line:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* --- Button Hover Effects --- */
a[href="tel:+12566823908"] {
    position: relative;
    overflow: hidden;
}

a[href="tel:+12566823908"]::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

a[href="tel:+12566823908"]:hover::before {
    width: 300px;
    height: 300px;
}

/* --- Form Inputs --- */
input:focus,
select:focus,
textarea:focus {
    box-shadow: 0 0 0 3px rgba(4, 120, 87, 0.1);
}

/* --- Reduced Motion --- */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    html {
        scroll-behavior: auto;
    }
    
    .reveal[data-reveal] {
        opacity: 1;
        transform: none;
    }
}

/* --- Responsive --- */
@media (max-width: 767px) {
    .floating-card {
        display: none;
    }
    
    #hero {
        min-height: auto;
        padding: 80px 0 60px;
    }
}

@media (min-width: 768px) and (max-width: 1023px) {
    .floating-card {
        display: none;
    }
    
    #hero {
        min-height: auto;
        padding: 100px 0 80px;
    }
}
