/* Custom styles for Heritage Roofing Inc */

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #FAF8F5;
}
::-webkit-scrollbar-thumb {
    background: #0D1B2A;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #1B2D45;
}

/* Hero animations */
.hero-subtitle {
    animation: slideUp 0.8s ease forwards;
    opacity: 0;
    transform: translateY(20px);
}
.hero-title {
    animation: slideUp 0.8s ease 0.15s forwards;
    opacity: 0;
    transform: translateY(20px);
}
.hero-text {
    animation: slideUp 0.8s ease 0.3s forwards;
    opacity: 0;
    transform: translateY(20px);
}
.hero-cta {
    animation: slideUp 0.8s ease 0.45s forwards;
    opacity: 0;
    transform: translateY(20px);
}
.hero-image-wrapper {
    animation: fadeIn 1s ease 0.4s forwards;
    opacity: 0;
}
.hero-float-card {
    animation: floatCard 0.6s ease 0.8s forwards;
    opacity: 0;
    transform: translateY(20px);
}

@keyframes slideUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
@keyframes fadeIn {
    to {
        opacity: 1;
    }
}
@keyframes floatCard {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Scroll indicator */
.scroll-line {
    animation: scrollDown 1.5s ease-in-out infinite;
}
@keyframes scrollDown {
    0% { top: -12px; }
    100% { top: 32px; }
}

/* Section animations */
.section-label,
.section-title,
.section-desc {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}
.section-label.visible,
.section-title.visible,
.section-desc.visible {
    opacity: 1;
    transform: translateY(0);
}
.section-label.visible { transition-delay: 0s; }
.section-title.visible { transition-delay: 0.1s; }
.section-desc.visible { transition-delay: 0.2s; }

/* Product cards */
.product-card {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}
.product-card.visible {
    opacity: 1;
    transform: translateY(0);
}
.product-card.visible:nth-child(1) { transition-delay: 0s; }
.product-card.visible:nth-child(2) { transition-delay: 0.1s; }
.product-card.visible:nth-child(3) { transition-delay: 0.2s; }
.product-card.visible:nth-child(4) { transition-delay: 0.3s; }
.product-card.visible:nth-child(5) { transition-delay: 0.4s; }
.product-card.visible:nth-child(6) { transition-delay: 0.5s; }

/* Why us cards */
.text-center.group {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}
.text-center.group.visible {
    opacity: 1;
    transform: translateY(0);
}
.text-center.group.visible:nth-child(1) { transition-delay: 0s; }
.text-center.group.visible:nth-child(2) { transition-delay: 0.1s; }
.text-center.group.visible:nth-child(3) { transition-delay: 0.2s; }
.text-center.group.visible:nth-child(4) { transition-delay: 0.3s; }

/* Navbar scroll state */
nav.scrolled {
    background: rgba(250, 248, 245, 0.95);
    backdrop-filter: blur(12px);
    box-shadow: 0 1px 0 rgba(13, 27, 42, 0.08);
}

/* Mobile menu */
.mobile-link {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}
#mobile-menu.open .mobile-link {
    opacity: 1;
    transform: translateY(0);
}
#mobile-menu.open .mobile-link:nth-child(1) { transition-delay: 0s; }
#mobile-menu.open .mobile-link:nth-child(2) { transition-delay: 0.05s; }
#mobile-menu.open .mobile-link:nth-child(3) { transition-delay: 0.1s; }
#mobile-menu.open .mobile-link:nth-child(4) { transition-delay: 0.15s; }
#mobile-menu.open .mobile-link:nth-child(5) { transition-delay: 0.2s; }

/* Hamburger animation */
#hamburger span:nth-child(1) {
    transform-origin: center;
}
#hamburger span:nth-child(2) {
    transform-origin: center;
}
#hamburger span:nth-child(3) {
    transform-origin: center;
}
body.menu-open #hamburger span:nth-child(1) {
    transform: rotate(45deg) translate(3px, 3px);
}
body.menu-open #hamburger span:nth-child(2) {
    opacity: 0;
}
body.menu-open #hamburger span:nth-child(3) {
    transform: rotate(-45deg) translate(3px, -3px);
    width: 100%;
}

/* Select dropdown styling */
select option {
    background: #0D1B2A;
    color: #FAF8F5;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
    html {
        scroll-behavior: auto;
    }
}
