/* ===== Custom Styles for Pop's Garage ===== */

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

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

/* Selection color */
::selection {
    background-color: rgba(161, 23, 50, 0.15);
    color: #6f182b;
}

/* Smooth image loading */
img {
    opacity: 1;
    transition: opacity 0.3s ease;
}

img[loading="lazy"] {
    opacity: 0;
}

img[loading="lazy"].loaded {
    opacity: 1;
}

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

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

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

/* Mobile menu */
#mobileMenu {
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

#mobileMenu.open {
    opacity: 1;
    pointer-events: all;
}

#mobileMenu.close {
    opacity: 0;
    pointer-events: none;
}

/* Menu button animation */
#menuBtn.active #menuIcon span:nth-child(1) {
    transform: translateY(5px) rotate(45deg);
}

#menuBtn.active #menuIcon span:nth-child(2) {
    opacity: 0;
}

#menuBtn.active #menuIcon span:nth-child(3) {
    transform: translateY(-5px) rotate(-45deg);
    width: 1.5rem;
}

/* Mobile link animation */
.mobile-link {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease, color 0.3s ease;
}

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

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

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

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

/* ===== Scroll Reveal Animations ===== */
/* Default state: visible (progressive enhancement) */
.reveal {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94), 
                transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

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

@media (prefers-reduced-motion: no-preference) {
    .reveal {
        opacity: 0;
        transform: translateY(30px);
    }
    
    .reveal.revealed {
        opacity: 1;
        transform: translateY(0);
    }
}

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

/* ===== Form Styles ===== */
select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23a11732' 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 0 center;
    padding-right: 2rem;
}

select:focus {
    border-color: #a11732;
}

/* ===== Focus visible for accessibility ===== */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
    outline: 2px solid #a11732;
    outline-offset: 2px;
}

/* ===== Subtle hover transitions ===== */
a, button {
    transition: color 0.3s ease, background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

/* ===== Gallery hover effect ===== */
.aspect-square {
    overflow: hidden;
}

.aspect-square img {
    transition: transform 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

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

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

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

::-webkit-scrollbar-thumb:hover {
    background: #c1203c;
}

/* ===== Responsive adjustments ===== */
@media (max-width: 768px) {
    .font-serif {
        line-height: 1.2;
    }
}

/* ===== Print styles ===== */
@media print {
    nav, #contactForm, button, .reveal {
        display: none !important;
    }
    
    body {
        background: white;
        color: black;
    }
}
