/* === Base & Reset === */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    overflow-x: hidden;
}

/* === Scroll Reveal (Progressive Enhancement) === */
@media (prefers-reduced-motion: no-preference) {
    .reveal {
        opacity: 0;
        transform: translateY(30px);
        transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    }
    
    .reveal.revealed {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Fallback: always visible if JS is disabled */
.no-js .reveal,
.js-loaded .reveal {
    opacity: 1;
    transform: none;
}

@media (prefers-reduced-motion: no-preference) {
    .js-loaded .reveal {
        opacity: 0;
        transform: translateY(30px);
    }
    
    .js-loaded .reveal.revealed {
        opacity: 1;
        transform: translateY(0);
    }
}

/* === Floating Cards Animation === */
@media (prefers-reduced-motion: no-preference) {
    .floating-card {
        animation: float 6s ease-in-out infinite;
    }
    
    .floating-card:nth-child(2) {
        animation-delay: -2s;
        animation-duration: 7s;
    }
    
    .floating-card:nth-child(3) {
        animation-delay: -4s;
        animation-duration: 5s;
    }
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-12px); }
}

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

#navbar.scrolled {
    background: rgba(254, 253, 251, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 1px 20px rgba(123, 45, 59, 0.08);
}

/* === Mobile Menu === */
#mobile-menu {
    animation: slideDown 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* === Custom Select Arrow === */
select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%237B2D3B' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 40px;
}

/* === Selection Color === */
::selection {
    background: rgba(123, 45, 59, 0.15);
    color: #4a1920;
}

/* === Smooth Scroll Offset for Fixed Nav === */
section[id] {
    scroll-margin-top: 80px;
}

/* === Focus Visible === */
:focus-visible {
    outline: 2px solid #7B2D3B;
    outline-offset: 2px;
}

/* === Print Styles === */
@media print {
    nav, #mobile-menu-btn, #contact-form, .floating-card {
        display: none !important;
    }
    
    body {
        color: #000;
        background: #fff;
    }
}
