/* ===== Custom Styles for Martinez Custom Granite ===== */

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

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #fdf8f0;
}

::-webkit-scrollbar-thumb {
    background: #d9e2ec;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #9fb3cc;
}

/* Selection color */
::selection {
    background: #fbbf24;
    color: #102a43;
}

/* ===== Navigation ===== */
#navbar {
    background: transparent;
    transition: background 0.4s ease, box-shadow 0.4s ease, padding 0.4s ease;
}

#navbar.scrolled {
    background: rgba(253, 248, 240, 0.95);
    backdrop-filter: blur(20px);
    box-shadow: 0 1px 20px rgba(16, 42, 67, 0.08);
}

/* ===== Mobile Menu ===== */
#mobileMenu.open {
    opacity: 1;
    pointer-events: all;
}

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

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

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

/* Mobile menu button animation */
.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: 20px;
    transform: rotate(-45deg) translate(4px, -4px);
}

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

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

/* ===== Gallery Items ===== */
.gallery-item {
    height: 300px;
}

@media (min-width: 640px) {
    .gallery-item {
        height: 350px;
    }
}

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

@media (prefers-reduced-motion: no-preference) {
    .reveal {
        opacity: 0;
        transform: translateY(30px);
    }
    
    .reveal.visible {
        opacity: 1;
        transform: translateY(0);
    }
    
    .reveal-left {
        opacity: 0;
        transform: translateX(-30px);
    }
    
    .reveal-left.visible {
        opacity: 1;
        transform: translateX(0);
    }
    
    .reveal-right {
        opacity: 0;
        transform: translateX(30px);
    }
    
    .reveal-right.visible {
        opacity: 1;
        transform: translateX(0);
    }
    
    .reveal-scale {
        opacity: 0;
        transform: scale(0.95);
    }
    
    .reveal-scale.visible {
        opacity: 1;
        transform: scale(1);
    }
}

/* Stagger children */
.reveal-stagger > * {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.reveal-stagger.visible > *:nth-child(1) { transition-delay: 0s; }
.reveal-stagger.visible > *:nth-child(2) { transition-delay: 0.1s; }
.reveal-stagger.visible > *:nth-child(3) { transition-delay: 0.2s; }
.reveal-stagger.visible > *:nth-child(4) { transition-delay: 0.3s; }
.reveal-stagger.visible > *:nth-child(5) { transition-delay: 0.4s; }
.reveal-stagger.visible > *:nth-child(6) { transition-delay: 0.5s; }

.reveal-stagger.visible > * {
    opacity: 1;
    transform: translateY(0);
}

/* ===== Button hover effects ===== */
a, button {
    -webkit-tap-highlight-color: transparent;
}

/* ===== Focus styles ===== */
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible {
    outline: 2px solid #fbbf24;
    outline-offset: 2px;
    border-radius: 0.5rem;
}

/* ===== Hero parallax-like effect ===== */
#hero {
    background-attachment: fixed;
}

@media (max-width: 768px) {
    #hero {
        background-attachment: scroll;
    }
}

/* ===== Floating badge animation ===== */
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* ===== Pulse animation for hero dot ===== */
@keyframes pulse-ring {
    0% { transform: scale(0.8); opacity: 1; }
    100% { transform: scale(2); opacity: 0; }
}

/* ===== Fade-in for hero elements ===== */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-badge {
    animation: fadeUp 0.6s ease forwards;
}

.hero-headline {
    animation: fadeUp 0.6s ease 0.15s forwards;
    opacity: 0;
}

.hero-subheadline {
    animation: fadeUp 0.6s ease 0.3s forwards;
    opacity: 0;
}

.hero-ctas {
    animation: fadeUp 0.6s ease 0.45s forwards;
    opacity: 0;
}

.hero-trust {
    animation: fadeUp 0.6s ease 0.6s forwards;
    opacity: 0;
}

/* ===== Responsive adjustments ===== */
@media (max-width: 640px) {
    .font-serif {
        font-size: clamp(1.75rem, 8vw, 2.5rem);
    }
    
    #hero h1 {
        font-size: clamp(1.75rem, 7vw, 3rem);
    }
}

/* ===== Print styles ===== */
@media print {
    #navbar, #mobileMenu, .reveal {
        display: none !important;
    }
    
    body {
        color: #000;
        background: #fff;
    }
}
