/* ============================================
   C and J Auto Body and Paint — Custom Styles
   ============================================ */

/* --- Base & Typography --- */
html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    overflow-x: hidden;
}

::selection {
    background-color: rgba(5, 78, 59, 0.15);
    color: #022c22;
}

/* --- Scrollbar --- */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #ecfdf5;
}
::-webkit-scrollbar-thumb {
    background: #a7f3d0;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #6ee7b7;
}

/* --- Navigation --- */
.nav-link {
    position: relative;
}
.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 1px;
    background: #059669;
    transition: width 0.3s ease;
}
.nav-link:hover::after {
    width: 100%;
}

/* Navbar scroll state */
.nav-scrolled {
    background: rgba(254, 253, 248, 0.95) !important;
    backdrop-filter: blur(12px);
    box-shadow: 0 1px 0 rgba(5, 78, 59, 0.08);
}

/* Mobile menu */
.mobile-link {
    position: relative;
    transition: color 0.3s ease;
}
.mobile-link:hover {
    color: #059669;
}
.mobile-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 1px;
    background: #059669;
    transition: width 0.3s ease;
}
.mobile-link:hover::after {
    width: 100%;
}

/* Hamburger animation */
.menu-line {
    transition: transform 0.3s ease, opacity 0.3s ease;
}
#menuBtn.active .menu-line:nth-child(1) {
    transform: translateY(4px) rotate(45deg);
}
#menuBtn.active .menu-line:nth-child(2) {
    opacity: 0;
}
#menuBtn.active .menu-line:nth-child(3) {
    transform: translateY(-4px) rotate(-45deg);
}

/* --- Hero Section --- */
.hero-content {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.hero-image-wrapper {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.8s ease 0.2s, transform 0.8s ease 0.2s;
}

/* Scroll indicator line animation */
.scroll-line {
    animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {
    0%, 100% { opacity: 0.3; transform: scaleY(0.5); transform-origin: top; }
    50% { opacity: 1; transform: scaleY(1); }
}

/* --- Services Section --- */
.services-header {
    opacity: 1;
    transform: translateY(0);
}

.service-card {
    opacity: 1;
    transform: translateY(0);
}

/* --- About Section --- */
.about-content {
    opacity: 1;
    transform: translateY(0);
}

.about-image-wrapper {
    opacity: 1;
    transform: translateY(0);
}

/* --- Gallery Section --- */
.gallery-header {
    opacity: 1;
    transform: translateY(0);
}

.gallery-item {
    opacity: 1;
    transform: translateY(0);
}

/* --- Contact Section --- */
.contact-header {
    opacity: 1;
    transform: translateY(0);
}

/* --- Scroll Reveal Animations --- */
/* These are progressive enhancement — content is visible by default,
   JS adds the hidden state for the animation */
.reveal {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.revealed {
    opacity: 0;
    transform: translateY(24px);
}

/* Only apply animations when user prefers motion */
@media (prefers-reduced-motion: no-preference) {
    .reveal.revealed {
        opacity: 0;
        transform: translateY(24px);
    }
    
    .reveal.revealed.is-visible {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Staggered delays */
.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; }

/* --- Utility --- */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* --- Select dropdown arrow --- */
select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none'%3E%3Cpath d='M3 4.5l3 3 3-3' stroke='%23059669' stroke-width='1.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

/* --- Focus visible for accessibility --- */
:focus-visible {
    outline: 2px solid #059669;
    outline-offset: 2px;
}

/* --- Responsive adjustments --- */
@media (max-width: 767px) {
    .scroll-line {
        display: none;
    }
}
