/* === BASE === */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

body {
    overflow-x: hidden;
}

::selection {
    background: rgba(245, 158, 11, 0.3);
    color: #faf5ff;
}

/* === SCROLLBAR === */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #1a0a2e;
}
::-webkit-scrollbar-thumb {
    background: #5B2C6F;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #7c3aed;
}

/* === REVEAL ANIMATIONS === */
.reveal-up {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-left {
    opacity: 1;
    transform: translateX(0);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-right {
    opacity: 1;
    transform: translateX(0);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Hidden initial state for scroll-reveal — only applied when JS is active */
@media (prefers-reduced-motion: no-preference) {
    .reveal-up {
        opacity: 0;
        transform: translateY(40px);
    }
    .reveal-left {
        opacity: 0;
        transform: translateX(-40px);
    }
    .reveal-right {
        opacity: 0;
        transform: translateX(40px);
    }
}

/* === NAVBAR === */
#navbar {
    background: transparent;
}

#navbar.scrolled {
    background: rgba(26, 10, 46, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

/* === MOBILE MENU === */
.mobile-link {
    opacity: 1;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

#mobile-menu.open .mobile-link {
    animation: fadeSlideIn 0.4s ease forwards;
}

#mobile-menu.open .mobile-link:nth-child(1) { animation-delay: 0.05s; }
#mobile-menu.open .mobile-link:nth-child(2) { animation-delay: 0.1s; }
#mobile-menu.open .mobile-link:nth-child(3) { animation-delay: 0.15s; }
#mobile-menu.open .mobile-link:nth-child(4) { animation-delay: 0.2s; }
#mobile-menu.open .mobile-link:nth-child(5) { animation-delay: 0.25s; }

@keyframes fadeSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* === HERO FLOATING CARDS === */
@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(var(--rotate, 0deg)); }
    50% { transform: translateY(-12px) rotate(var(--rotate, 0deg)); }
}

.hero-card-1 { animation: float 6s ease-in-out infinite; --rotate: 2deg; }
.hero-card-2 { animation: float 7s ease-in-out infinite; --rotate: -1deg; animation-delay: 1s; }
.hero-card-3 { animation: float 5s ease-in-out infinite; --rotate: 1deg; animation-delay: 2s; }

@media (prefers-reduced-motion: reduce) {
    .hero-card-1, .hero-card-2, .hero-card-3 {
        animation: none;
    }
}

/* === BUTTON HOVER GLOW === */
button:hover, a:hover {
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* === INPUT FOCUS === */
input:focus, textarea:focus {
    outline: none;
}

/* === IMAGE PLACEHOLDER FALLBACKS === */
img {
    image-rendering: auto;
}

/* === ACCESSIBILITY === */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* === FOCUS VISIBLE === */
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
    outline: 2px solid #f59e0b;
    outline-offset: 2px;
    border-radius: 4px;
}

/* === RESPONSIVE TWEAKS === */
@media (max-width: 640px) {
    .font-serif {
        line-height: 1.1;
    }
}
