/* ===== Base & Typography ===== */
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;
}

/* ===== Navbar ===== */
.nav-link {
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background: #fbbf24;
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

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

@keyframes float-2 {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-16px) rotate(-0.5deg); }
}

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

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

/* ===== Scroll Reveal ===== */
@media (prefers-reduced-motion: no-preference) {
    .reveal-up,
    .reveal-left,
    .reveal-right {
        opacity: 1;
        transform: none;
    }

    .reveal-up {
        animation: revealUp 0.8s ease-out forwards;
    }

    .reveal-left {
        animation: revealLeft 0.8s ease-out forwards;
    }

    .reveal-right {
        animation: revealRight 0.8s ease-out forwards;
    }
}

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

@keyframes revealLeft {
    from {
        opacity: 0;
        transform: translateX(-40px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes revealRight {
    from {
        opacity: 0;
        transform: translateX(40px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ===== Image hover shimmer ===== */
.group img {
    will-change: transform;
}

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

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

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

::-webkit-scrollbar-thumb:hover {
    background: #6d28d9;
}

/* ===== Mobile menu transitions ===== */
#mobile-menu {
    max-height: 0;
}

#mobile-menu.open {
    max-height: 400px;
}

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

/* ===== Smooth image loading ===== */
img {
    image-rendering: auto;
}

/* ===== Card border glow on hover ===== */
.group:hover {
    border-color: rgba(245, 158, 11, 0.3) !important;
}

/* ===== 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;
    }

    .floating-card-1,
    .floating-card-2,
    .floating-card-3 {
        animation: none;
    }
}
