/* Custom styles for Ice Cream Island */

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

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #FAFAF5;
}
::-webkit-scrollbar-thumb {
    background: #3d7a3d;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #2d612d;
}

/* Selection color */
::selection {
    background: #dce8dc;
    color: #152e15;
}

/* Navbar scroll state */
.navbar-scrolled {
    background: rgba(254, 253, 248, 0.95) !important;
    backdrop-filter: blur(10px);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* Mobile menu animations */
.mobile-link {
    position: relative;
}

.mobile-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: #3d7a3d;
    transition: width 0.3s ease;
}

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

/* Menu lines animation */
.menu-line {
    transition: all 0.3s ease;
}

#menu-toggle.active .menu-line:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}
#menu-toggle.active .menu-line:nth-child(2) {
    opacity: 0;
}
#menu-toggle.active .menu-line:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* Reveal animations - progressive enhancement */
@media (prefers-reduced-motion: no-preference) {
    .reveal {
        opacity: 0;
        transform: translateY(30px);
        transition: opacity 0.6s ease, transform 0.6s ease;
    }
    
    .reveal.revealed {
        opacity: 1;
        transform: translateY(0);
    }
    
    /* Stagger children */
    .reveal-grid > * {
        opacity: 0;
        transform: translateY(20px);
        transition: opacity 0.5s ease, transform 0.5s ease;
    }
    
    .reveal-grid.revealed > *:nth-child(1) { transition-delay: 0.1s; }
    .reveal-grid.revealed > *:nth-child(2) { transition-delay: 0.2s; }
    .reveal-grid.revealed > *:nth-child(3) { transition-delay: 0.3s; }
    .reveal-grid.revealed > *:nth-child(4) { transition-delay: 0.4s; }
    
    .reveal-grid.revealed > * {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Reduced motion - ensure everything is visible */
@media (prefers-reduced-motion: reduce) {
    .reveal {
        opacity: 1;
        transform: none;
    }
    
    html {
        scroll-behavior: auto;
    }
    
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

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

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

/* Image loading placeholder */
img {
    background: linear-gradient(110deg, #f0f5f0 8%, #e8efe8 18%, #f0f5f0 33%);
    background-size: 200% 100%;
    animation: shimmer 1.5s linear infinite;
}

img[src] {
    animation: none;
    background: none;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Print styles */
@media print {
    nav, #contact-form, .reveal {
        display: none !important;
    }
    
    body {
        color: #000;
        background: #fff;
    }
    
    section {
        page-break-inside: avoid;
    }
}

/* Tablet and up adjustments */
@media (min-width: 768px) {
    .nav-link {
        position: relative;
    }
    
    .nav-link::after {
        content: '';
        position: absolute;
        bottom: -4px;
        left: 50%;
        transform: translateX(-50%);
        width: 0;
        height: 2px;
        background: #3d7a3d;
        transition: width 0.3s ease;
    }
    
    .nav-link:hover::after {
        width: 100%;
    }
}

/* Large screens */
@media (min-width: 1024px) {
    .hero-bg {
        background-attachment: fixed;
    }
}
