/* Base styles and custom properties */
:root {
    --font-sans: 'DM Sans', sans-serif;
    --font-serif: 'Playfair Display', Georgia, serif;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-sans);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* Hero background animation */
@keyframes heroPan {
    0% { transform: scale(1.05) translate(0, 0); }
    50% { transform: scale(1.1) translate(-1%, -0.5%); }
    100% { transform: scale(1.05) translate(0, 0); }
}

@keyframes heroPanAlt {
    0% { transform: scale(1.05) translate(0, 0); }
    50% { transform: scale(1.12) translate(1%, 0.5%); }
    100% { transform: scale(1.05) translate(0, 0); }
}

.hero-bg {
    animation: heroPan 20s ease-in-out infinite;
}

.hero-bg-alt {
    animation: heroPanAlt 25s ease-in-out infinite;
}

/* Scroll indicator bounce */
@keyframes scrollBounce {
    0%, 100% { transform: translateY(0); opacity: 0.6; }
    50% { transform: translateY(8px); opacity: 1; }
}

.hero-scroll-indicator {
    animation: scrollBounce 2s ease-in-out infinite;
    display: block;
}

/* Scroll reveal */
.reveal {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1), transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Mobile menu */
#mobile-menu:not(.hidden) {
    display: flex;
}

.mobile-menu-link {
    position: relative;
}

.mobile-menu-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    width: 0;
    height: 2px;
    background: #ff5c50;
    transition: width 0.3s ease, left 0.3s ease;
}

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

/* Navbar transition */
#site-header.scrolled {
    background: rgba(10, 10, 15, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.2);
}

/* Back to top button */
#back-to-top.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

/* Custom selection color */
::selection {
    background: #ff5c50;
    color: white;
}

/* Focus styles */
:focus-visible {
    outline: 2px solid #ff5c50;
    outline-offset: 2px;
}

/* Reduced motion */
@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;
    }
    .reveal {
        opacity: 1;
        transform: none;
    }
}

/* Print styles */
@media print {
    #site-header, #mobile-menu, #back-to-top, .hero-scroll-indicator {
        display: none !important;
    }
    body {
        color: #000;
        background: #fff;
    }
}
