/* ===== Custom Styles for Cornerstone Books & Gifts ===== */

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

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

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

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

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

/* Selection color */
::selection {
    background: #e8644a;
    color: #ffffff;
}

/* ===== Navbar Transition ===== */
#navbar {
    transition: background-color 0.4s ease, box-shadow 0.4s ease, backdrop-filter 0.4s ease;
}

#navbar.scrolled {
    background-color: rgba(250, 250, 248, 0.95);
    backdrop-filter: blur(12px);
    box-shadow: 0 1px 20px rgba(0, 0, 0, 0.06);
}

#navbar.scrolled .font-serif,
#navbar.scrolled .text-charcoal-950 {
    color: #1a1a1a;
}

#navbar.scrolled .text-charcoal-500 {
    color: #6d6d6d;
}

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

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

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

/* Mobile menu button animation */
body.menu-open .menu-line:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}

body.menu-open .menu-line:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

body.menu-open .menu-line:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
    width: 5px;
}

/* ===== Scroll Reveal Animations ===== */
/* Base state: visible (progressive enhancement) */
.reveal {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94), 
                transform 0.7s 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);
    }
    
    .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; }
}

/* ===== Hero floating cards animation ===== */
@keyframes float-slow {
    0%, 100% { transform: translateY(0px) rotate(2deg); }
    50% { transform: translateY(-12px) rotate(2deg); }
}

@keyframes float-slow-reverse {
    0%, 100% { transform: translateY(0px) rotate(-1deg); }
    50% { transform: translateY(-8px) rotate(-1deg); }
}

@keyframes float-medium {
    0%, 100% { transform: translateY(0px) rotate(1deg); }
    50% { transform: translateY(-10px) rotate(1deg); }
}

@keyframes float-accent {
    0%, 100% { transform: translateY(0px) rotate(-2deg); }
    50% { transform: translateY(-6px) rotate(-2deg); }
}

@media (prefers-reduced-motion: no-preference) {
    .hero-card-main {
        animation: float-slow 6s ease-in-out infinite;
    }
    
    .hero-card-stat-1 {
        animation: float-slow-reverse 5s ease-in-out infinite;
    }
    
    .hero-card-stat-2 {
        animation: float-medium 4.5s ease-in-out infinite;
    }
    
    .hero-card-accent {
        animation: float-accent 5.5s ease-in-out infinite;
    }
}

/* ===== Decorative line animations ===== */
@keyframes draw-line {
    from { width: 0; }
    to { width: 2rem; }
}

/* ===== Button hover effects ===== */
a[href^="tel:"],
a[href^="mailto:"] {
    text-decoration: none;
}

/* ===== Image loading placeholder ===== */
img {
    background-color: #e7e7e7;
}

/* ===== Focus styles ===== */
a:focus-visible,
button:focus-visible {
    outline: 2px solid #e8644a;
    outline-offset: 2px;
    border-radius: 4px;
}

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