/* ===== Base & Utilities ===== */
html {
    scroll-behavior: smooth;
}

body {
    overflow-x: hidden;
}

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

/* ===== Scrollbar ===== */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #1a0330;
}
::-webkit-scrollbar-thumb {
    background: #3B0764;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #6d28d9;
}

/* ===== Navbar ===== */
.nav-link {
    position: relative;
}
.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: #F59E0B;
    transition: width 0.3s ease;
}
.nav-link:hover::after {
    width: 100%;
}

nav.scrolled {
    background: rgba(26, 3, 48, 0.95) !important;
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(109, 40, 217, 0.2);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

/* ===== Mobile Menu ===== */
.mobile-link {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s ease, color 0.3s ease;
}

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

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

/* Menu button animation */
.menu-line {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* ===== Floating Stat Cards ===== */
@keyframes float1 {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-12px) rotate(0.5deg); }
}
@keyframes float2 {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-8px) rotate(-0.5deg); }
}
@keyframes float3 {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-15px) rotate(0.3deg); }
}
@keyframes float4 {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-6px); }
}

.float-card-1 { animation: float1 4s ease-in-out infinite; }
.float-card-2 { animation: float2 5s ease-in-out infinite; }
.float-card-3 { animation: float3 4.5s ease-in-out infinite; }
.float-card-4 { animation: float4 3.5s ease-in-out infinite; }

/* ===== Service Cards ===== */
.service-card {
    position: relative;
    overflow: hidden;
}
.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #F59E0B, #D97706);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}
.service-card:hover::before {
    transform: scaleX(1);
}

/* ===== Gallery ===== */
.gallery-item {
    position: relative;
    overflow: hidden;
    cursor: pointer;
}
.gallery-item::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(26, 3, 48, 0.4), transparent);
    opacity: 0;
    transition: opacity 0.4s ease;
}
.gallery-item:hover::after {
    opacity: 1;
}

/* ===== Scroll Reveal ===== */
.reveal {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1), transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* 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 { opacity: 1; transform: none; }
}

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