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

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

body {
    margin: 0;
    overflow-x: hidden;
}

img {
    max-width: 100%;
    height: auto;
}

/* ===== Floating Card Animations ===== */
@keyframes float1 {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-12px); }
}

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

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

@keyframes float4 {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-10px) rotate(1deg); }
}

.floating-card {
    animation: float1 6s ease-in-out infinite;
}

.floating-card:nth-child(2) {
    animation: float2 5s ease-in-out infinite;
    animation-delay: -1.5s;
}

.floating-card:nth-child(3) {
    animation: float3 7s ease-in-out infinite;
    animation-delay: -3s;
}

.floating-card:nth-child(4) {
    animation: float4 5.5s ease-in-out infinite;
    animation-delay: -2s;
}

/* ===== Scroll Reveal Animations ===== */
/* Default state: visible (no JS fallback) */
.reveal-up,
.reveal-left,
.reveal-right {
    opacity: 1;
    transform: none;
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-up {
    transform: translateY(0);
}

.reveal-left {
    transform: translateX(0);
}

.reveal-right {
    transform: translateX(0);
}

/* Animated state — applied via JS only */
@media (prefers-reduced-motion: no-preference) {
    .reveal-up.animated {
        transform: translateY(40px);
        opacity: 0;
    }
    .reveal-left.animated {
        transform: translateX(-40px);
        opacity: 0;
    }
    .reveal-right.animated {
        transform: translateX(40px);
        opacity: 0;
    }
}

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

#navbar.scrolled {
    background: rgba(26, 10, 22, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 1px 0 rgba(212, 160, 74, 0.1);
}

/* ===== Mobile Menu ===== */
#mobileMenu.open {
    opacity: 1;
    pointer-events: all;
}

#mobileMenu:not(.open) {
    opacity: 0;
    pointer-events: none;
}

.mobile-link {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.4s ease, transform 0.4s ease, color 0.3s ease;
}

#mobileMenu:not(.open) .mobile-link {
    opacity: 0;
    transform: translateY(20px);
}

/* ===== Menu Button ===== */
#menuBtn.active .menu-line:nth-child(1) {
    transform: rotate(45deg) translate(3px, 3px);
}

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

#menuBtn.active .menu-line:nth-child(3) {
    transform: rotate(-45deg) translate(3px, -3px);
    width: 5px;
}

/* ===== Selection ===== */
::selection {
    background: rgba(212, 160, 74, 0.3);
    color: #f5f0f7;
}

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

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

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

::-webkit-scrollbar-thumb:hover {
    background: #9d72af;
}

/* ===== Focus Styles ===== */
a:focus-visible,
button:focus-visible {
    outline: 2px solid #D4A04A;
    outline-offset: 4px;
    border-radius: 4px;
}

/* ===== 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-up,
    .reveal-left,
    .reveal-right {
        opacity: 1;
        transform: none;
    }
}
