/* === 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.25, 0.46, 0.45, 0.94), transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    }

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

    .reveal:nth-child(2) { transition-delay: 0.1s; }
    .reveal:nth-child(3) { transition-delay: 0.2s; }
}

/* === Floating Cards Animation === */
@media (prefers-reduced-motion: no-preference) {
    .floating-card {
        animation: float-slow 6s ease-in-out infinite;
    }

    .floating-card-2 {
        animation: float-medium 5s ease-in-out infinite 0.5s;
    }

    .floating-card-3 {
        animation: float-slow 7s ease-in-out infinite 1s;
    }

    .floating-card-4 {
        animation: float-medium 5.5s ease-in-out infinite 0.3s;
    }

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

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

/* === Navbar Transition === */
#navbar.scrolled {
    background: rgba(15, 9, 20, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(212, 168, 67, 0.1);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

#navbar.scrolled .font-serif {
    color: #F3EAF7;
}

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

::-webkit-scrollbar-track {
    background: #1A0E22;
}

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

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

/* === Selection === */
::selection {
    background: rgba(212, 168, 67, 0.3);
    color: #F3EAF7;
}

/* === Focus Styles === */
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
    outline: 2px solid #D4A843;
    outline-offset: 2px;
}

/* === Image Optimization === */
img {
    max-width: 100%;
    height: auto;
}

/* === Button Hover Effects === */
button[type="submit"]:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 25px rgba(212, 168, 67, 0.25);
}

button[type="submit"]:active {
    transform: translateY(0);
}

/* === Mobile Menu Transition === */
#mobile-menu {
    animation: slideDown 0.3s ease-out;
}

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

/* === Input Autofill Styling === */
input:-webkit-autofill,
textarea:-webkit-autofill {
    -webkit-box-shadow: 0 0 0 30px #281435 inset !important;
    -webkit-text-fill-color: #F3EAF7 !important;
    caret-color: #F3EAF7;
}

/* === Print Styles === */
@media print {
    #navbar, #mobile-menu, button, form {
        display: none !important;
    }
    
    body {
        background: white !important;
        color: #1A0E22 !important;
    }
    
    .font-serif {
        color: #1A0E22 !important;
    }
}
