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

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

body {
    overflow-x: hidden;
}

::selection {
    background: rgba(168, 85, 247, 0.4);
    color: #faf5ff;
}

/* === Scrollbar === */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: #1a0535;
}
::-webkit-scrollbar-thumb {
    background: rgba(168, 85, 247, 0.4);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(168, 85, 247, 0.7);
}

/* === Hero Animations === */
.hero-element {
    opacity: 0;
    transform: translateY(40px);
    animation: heroReveal 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.hero-element:nth-child(1) { animation-delay: 0.1s; }
.hero-element:nth-child(2) { animation-delay: 0.25s; }
.hero-element:nth-child(3) { animation-delay: 0.4s; }
.hero-element:nth-child(4) { animation-delay: 0.55s; }
.hero-element:nth-child(5) { animation-delay: 0.7s; }
.hero-element:nth-child(6) { animation-delay: 0.85s; }

@keyframes heroReveal {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* === Scroll Dot Animation === */
@keyframes scrollDot {
    0% { top: 0; opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { top: calc(100% - 16px); opacity: 0; }
}

.scroll-dot {
    animation: scrollDot 2s ease-in-out infinite;
}

/* === Service Cards === */
.service-card {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), 
                transform 0.6s cubic-bezier(0.16, 1, 0.3, 1),
                border-color 0.5s ease,
                background 0.5s ease;
}

.service-card.visible {
    opacity: 1;
    transform: translateY(0);
}

/* === Testimonial Cards === */
.testimonial-card {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), 
                transform 0.6s cubic-bezier(0.16, 1, 0.3, 1),
                border-color 0.5s ease;
}

.testimonial-card.visible {
    opacity: 1;
    transform: translateY(0);
}

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

#navbar.scrolled {
    background: rgba(26, 5, 53, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(168, 85, 247, 0.1);
}

.nav-link {
    position: relative;
}

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

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

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

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

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

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

/* === Form Styles === */
select option {
    background: #1a0535;
    color: #f3e8ff;
}

input:focus, textarea:focus, select:focus {
    border-color: rgba(251, 191, 36, 0.5) !important;
    box-shadow: 0 0 0 1px rgba(251, 191, 36, 0.1);
}

/* === Responsive === */
@media (max-width: 767px) {
    .hero-element {
        transform: translateY(30px);
    }
}

@media (min-width: 768px) {
    .service-card {
        transition-delay: calc(var(--card-index, 0) * 0.08s);
    }
    .testimonial-card {
        transition-delay: calc(var(--card-index, 0) * 0.1s);
    }
}

/* === Focus Visible === */
:focus-visible {
    outline: 2px solid rgba(251, 191, 36, 0.6);
    outline-offset: 2px;
}

/* === Print === */
@media print {
    #navbar, .scroll-indicator {
        display: none;
    }
    body {
        background: white;
        color: black;
    }
}
