/* === Custom Styles for Hudson Booksellers === */

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

body {
    background-color: #0a0f0d;
}

/* Selection color */
::selection {
    background-color: rgba(212, 168, 83, 0.3);
    color: #faf8f0;
}

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

::-webkit-scrollbar-track {
    background: #0a0f0d;
}

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

::-webkit-scrollbar-thumb:hover {
    background: #065f46;
}

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

#navbar.scrolled {
    background: rgba(10, 15, 13, 0.92);
    backdrop-filter: blur(20px);
    box-shadow: 0 1px 0 rgba(212, 168, 83, 0.1);
}

/* === Mobile menu animation === */
.menu-line {
    transition: transform 0.3s ease, opacity 0.3s ease;
}

#menuBtn.active .menu-line:nth-child(1) {
    transform: translateY(4px) rotate(45deg);
}

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

#menuBtn.active .menu-line:nth-child(3) {
    transform: translateY(-4px) rotate(-45deg);
    width: 1.25rem;
}

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

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

.mobile-link {
    opacity: 0;
    transform: translateY(10px);
    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.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; }

/* === Scroll reveal animations === */
.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: 1;
    transform: translateY(0);
}

/* Default state for reveal elements — visible before JS runs */
.reveal {
    opacity: 1;
    transform: translateY(0);
}

/* Progressive enhancement: animate only when JS adds the class */
.reveal.animate-in {
    opacity: 0;
    transform: translateY(30px);
    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.animate-in.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    .reveal,
    .reveal.animate-in,
    .reveal.revealed,
    .reveal-row img,
    #backToTop {
        transition: none;
        animation: none;
        opacity: 1;
        transform: none;
    }
}

/* === Gold shimmer effect on hover === */
.group:hover .group-hover\:scale-110 {
    transition-timing-function: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* === Card hover glow === */
.reveal:hover {
    box-shadow: 0 0 60px rgba(212, 168, 83, 0.08);
}

/* === Form styles === */
select option {
    background-color: #111a15;
    color: #faf8f0;
}

/* === Back to top button === */
#backToTop.visible {
    opacity: 1;
    pointer-events: all;
}

/* === Hero text animation (subtle, no blocking) === */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#hero h1 {
    animation: fadeInUp 1s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

#hero p {
    animation: fadeInUp 1s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.2s forwards;
    opacity: 0;
}

#hero .flex-col,
#hero .flex-row {
    animation: fadeInUp 1s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.4s forwards;
    opacity: 0;
}

#hero .mb-6 {
    animation: fadeInUp 1s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.1s forwards;
    opacity: 0;
}

/* === Responsive adjustments === */
@media (max-width: 768px) {
    #hero h1 {
        font-size: 2.75rem;
    }

    .reveal:hover {
        box-shadow: none;
    }
}

@media (min-width: 769px) and (max-width: 1023px) {
    #hero h1 {
        font-size: 4.5rem;
    }
}

@media (min-width: 1024px) {
    #hero h1 {
        font-size: 5.5rem;
    }
}

/* === Image loading placeholder === */
img {
    background: linear-gradient(135deg, #111a15 0%, #162019 100%);
}

/* === Focus visible for accessibility === */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
    outline: 2px solid rgba(212, 168, 83, 0.6);
    outline-offset: 2px;
}
