/* ============================================
   CR Remodeling — Custom Styles
   ============================================ */

/* Base styles */
html {
    scroll-behavior: smooth;
}

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

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #f6f6f7;
}
::-webkit-scrollbar-thumb {
    background: #c4c5ca;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #9fa2aa;
}

/* ============================================
   Navigation
   ============================================ */
#navbar {
    transition: background-color 0.4s ease, backdrop-filter 0.4s ease, box-shadow 0.4s ease;
}

#navbar.scrolled {
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06);
}

#navbar.scrolled .nav-logo-text {
    color: #1f2530;
}

#navbar.scrolled a:not([class*="bg-"]):not([class*="px-6"]) {
    color: #4a4e58;
}

#navbar.scrolled a:not([class*="bg-"]):not([class*="px-6"]):hover {
    color: #FF6B4A;
}

/* ============================================
   Hero Floating Cards
   ============================================ */
.floating-card {
    animation: float1 4s ease-in-out infinite;
}

.floating-card-2 {
    animation: float2 5s ease-in-out infinite;
}

.floating-card-3 {
    animation: float3 4.5s ease-in-out infinite;
}

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

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

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

/* ============================================
   Service Cards
   ============================================ */
.service-card {
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}

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

/* ============================================
   Project Cards
   ============================================ */
.project-card {
    transition: transform 0.4s ease;
}

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

/* ============================================
   Testimonial Cards
   ============================================ */
.testimonial-card {
    transition: transform 0.4s ease, border-color 0.4s ease;
}

.testimonial-card:hover {
    transform: translateY(-4px);
    border-color: rgba(255, 107, 74, 0.3);
}

/* ============================================
   Reveal Animations
   (progressive enhancement — content visible without JS)
   ============================================ */
@media (prefers-reduced-motion: no-preference) {
    .reveal {
        opacity: 1;
        transform: translateY(0);
        transition: opacity 0.7s ease, transform 0.7s ease;
    }
}

/* When JS is disabled, all content is visible by default */
/* JS adds .revealed class for scroll-triggered animation */
.js-enabled .reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.js-enabled .reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered delays */
.js-enabled .reveal:nth-child(1) { transition-delay: 0.05s; }
.js-enabled .reveal:nth-child(2) { transition-delay: 0.1s; }
.js-enabled .reveal:nth-child(3) { transition-delay: 0.15s; }
.js-enabled .reveal:nth-child(4) { transition-delay: 0.2s; }
.js-enabled .reveal:nth-child(5) { transition-delay: 0.25s; }
.js-enabled .reveal:nth-child(6) { transition-delay: 0.3s; }

/* ============================================
   Back to Top Button
   ============================================ */
#backToTop.visible {
    opacity: 1;
    visibility: visible;
}

#backToTop:not(.visible) {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

#backToTop.visible {
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

/* ============================================
   Mobile Menu
   ============================================ */
.mobile-link {
    display: block;
    padding: 0.5rem 0;
}

/* ============================================
   Form Styles
   ============================================ */
select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1rem;
    padding-right: 2.5rem;
}

select:focus {
    outline: none;
}

/* ============================================
   Responsive adjustments
   ============================================ */
@media (max-width: 768px) {
    .floating-card {
        position: relative;
        top: auto;
        left: auto;
        margin-bottom: 1rem;
        animation: none;
    }
    
    .floating-card-2 {
        position: relative;
        top: auto;
        right: auto;
        bottom: auto;
        animation: none;
    }
    
    .floating-card-3 {
        display: none;
    }
}
