/* Custom styles and overrides */

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

/* Scroll reveal base - always visible by default */
.scroll-reveal {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

/* Scroll reveal animation - only when JS is active and user prefers motion */
@media (prefers-reduced-motion: no-preference) {
    .scroll-reveal.animated {
        opacity: 1;
        transform: translateY(0);
    }
    
    .scroll-reveal[data-animated="true"] {
        opacity: 0;
        transform: translateY(24px);
        transition: opacity 0.6s ease, transform 0.6s ease;
    }
}

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

/* Mobile menu open state */
#mobile-menu.open {
    display: block;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mobile menu link hover */
.mobile-link:hover {
    padding-left: 8px;
    transition: padding-left 0.2s ease;
}

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

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

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

#menu-toggle.active .menu-line:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}

/* Back to top button */
#back-to-top.visible {
    opacity: 1;
    pointer-events: all;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

#back-to-top:not(.visible) {
    transform: translateY(16px);
}

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

/* Selection color */
::selection {
    background: #f8d0b8;
    color: #913018;
}

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

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

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

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

/* Image aspect ratios to prevent layout shift */
img {
    max-width: 100%;
    height: auto;
}

/* Reduce motion preference */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    html {
        scroll-behavior: auto;
    }
    
    .scroll-reveal {
        opacity: 1;
        transform: none;
    }
}
