/* Custom styles for Blue Mountain Coffee Company */

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

body {
    font-feature-settings: 'cv02', 'cv03', 'cv04', 'cv11';
    font-synthesis: none;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Selection */
::selection {
    background-color: rgba(245, 158, 11, 0.3);
    color: #1a0d20;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #1a0d20;
}
::-webkit-scrollbar-thumb {
    background: #5B2C6F;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #7d3f84;
}

/* Hero image parallax-like fixed attachment on desktop */
@media (min-width: 1024px) {
    .hero-bg {
        background-attachment: fixed;
    }
}

/* Subtle grain overlay on dark sections */
.grain::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 1;
}

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

/* Smooth image loading */
img {
    loading: lazy;
}

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

/* Nav transition */
header {
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

/* Card hover lift */
article.group {
    will-change: transform;
}

article.group:hover {
    transform: translateY(-4px);
    transition: transform 0.3s ease;
}

/* Decorative line animation */
@keyframes growWidth {
    from { width: 0; }
    to { width: 100%; }
}

/* Mobile menu transition */
#mobile-menu {
    transition: max-height 0.3s ease, opacity 0.3s ease;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
}

#mobile-menu.open {
    max-height: 400px;
    opacity: 1;
}

/* Print styles */
@media print {
    header, footer, .hero-bg, iframe {
        display: none;
    }
    body {
        color: #000;
        background: #fff;
    }
}
