/* ==========================================
   J & S Painting — Custom Styles
   Bold Editorial · Burgundy + Blush
   ========================================== */

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

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    overflow-x: hidden;
}

::selection {
    background-color: #c22252;
    color: #faf7f4;
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #faf7f4;
}
::-webkit-scrollbar-thumb {
    background: #c22252;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #a11540;
}

/* ---- Navigation ---- */
.nav-link {
    position: relative;
}

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

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

.nav-link::after {
    background: #c22252;
}

/* Mobile menu */
.menu-line {
    transition: all 0.3s ease;
}

#menuBtn.active .menu-line:nth-child(1) {
    transform: rotate(45deg) translate(4px, 4px);
}
#menuBtn.active .menu-line:nth-child(2) {
    opacity: 0;
}
#menuBtn.active .menu-line:nth-child(3) {
    width: 1.25rem;
    transform: rotate(-45deg) translate(4px, -4px);
}

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

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

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

/* ---- Hero ---- */
.hero-eyebrow {
    opacity: 0;
    animation: fadeSlideUp 0.8s ease forwards;
    animation-delay: 0.2s;
}

.hero-headline {
    opacity: 0;
    animation: fadeSlideUp 0.8s ease forwards;
    animation-delay: 0.4s;
}

.hero-subhead {
    opacity: 0;
    animation: fadeSlideUp 0.8s ease forwards;
    animation-delay: 0.6s;
}

.hero-ctas {
    opacity: 0;
    animation: fadeSlideUp 0.8s ease forwards;
    animation-delay: 0.8s;
}

.hero-trust {
    opacity: 0;
    animation: fadeSlideUp 0.8s ease forwards;
    animation-delay: 1s;
}

@keyframes fadeSlideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes scrollPulse {
    0%, 100% { opacity: 0.4; height: 3rem; }
    50% { opacity: 1; height: 4.5rem; }
}

/* ---- Buttons ---- */
.cta-primary {
    box-shadow: 0 4px 15px rgba(255, 92, 58, 0.3);
}

.cta-primary:hover {
    box-shadow: 0 8px 30px rgba(255, 92, 58, 0.4);
    transform: translateY(-2px);
}

.cta-secondary:hover {
    transform: translateY(-2px);
}

/* ---- Section Headers ---- */
.section-eyebrow {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.section-title {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.section-subtitle {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.section-eyebrow.visible,
.section-title.visible,
.section-subtitle.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ---- Service Cards ---- */
.service-card {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.6s ease, transform 0.6s ease, box-shadow 0.5s ease;
}

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

.service-card:nth-child(2) { transition-delay: 0.15s; }
.service-card:nth-child(3) { transition-delay: 0.3s; }

/* ---- Gallery ---- */
.gallery-item {
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.gallery-item.visible {
    opacity: 1;
    transform: scale(1);
}

/* ---- Testimonials ---- */
.testimonial-card {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease, box-shadow 0.5s ease;
}

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

.testimonial-card:nth-child(2) { transition-delay: 0.15s; }
.testimonial-card:nth-child(3) { transition-delay: 0.3s; }

/* ---- Contact ---- */
.contact-item {
    opacity: 0;
    transform: translateX(-20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.contact-item.visible {
    opacity: 1;
    transform: translateX(0);
}

.contact-item:nth-child(2) { transition-delay: 0.1s; }
.contact-item:nth-child(3) { transition-delay: 0.2s; }
.contact-item:nth-child(4) { transition-delay: 0.3s; }

/* ---- Form ---- */
.form-submit {
    position: relative;
    overflow: hidden;
}

.form-submit::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    transition: left 0.5s ease;
}

.form-submit:hover::before {
    left: 100%;
}

/* ---- Navbar Scrolled State ---- */
#navbar.scrolled {
    background: rgba(250, 247, 244, 0.95);
    backdrop-filter: blur(20px);
    box-shadow: 0 1px 20px rgba(43, 10, 14, 0.08);
}

#navbar.scrolled .nav-link {
    color: #84163a;
}

#navbar.scrolled .nav-link::after {
    background: #c22252;
}

/* ---- Responsive ---- */
@media (max-width: 767px) {
    .hero-headline {
        font-size: 2.75rem;
    }
    
    .section-title {
        font-size: 2.5rem;
    }
}

@media (min-width: 768px) {
    .hero-headline {
        font-size: 4rem;
    }
}

@media (min-width: 1024px) {
    .hero-headline {
        font-size: 5rem;
    }
}

@media (min-width: 1280px) {
    .hero-headline {
        font-size: 5.5rem;
    }
}

@media (min-width: 1536px) {
    .hero-headline {
        font-size: 6.5rem;
    }
}

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