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

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #0d0a04;
}
::-webkit-scrollbar-thumb {
    background: #3d2e17;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #5a4320;
}

/* ===== Hero Orb Animations ===== */
@keyframes float-slow {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -30px) scale(1.05); }
    66% { transform: translate(-20px, 20px) scale(0.95); }
}

@keyframes float-medium {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(-25px, 25px) scale(1.03); }
    66% { transform: translate(15px, -15px) scale(0.97); }
}

@keyframes float-fast {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(20px, -20px); }
}

.hero-orb {
    will-change: transform;
}

.orb-1 {
    animation: float-slow 20s ease-in-out infinite;
}
.orb-2 {
    animation: float-medium 15s ease-in-out infinite;
}
.orb-3 {
    animation: float-fast 12s ease-in-out infinite;
}

/* ===== Reveal Animations (progressive enhancement) ===== */
@media (prefers-reduced-motion: no-preference) {
    .reveal {
        opacity: 0;
        transform: translateY(30px);
        transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    }
    
    .reveal.revealed {
        opacity: 1;
        transform: translateY(0);
    }
    
    .reveal:nth-child(2) { transition-delay: 0.1s; }
    .reveal:nth-child(3) { transition-delay: 0.2s; }
    .reveal:nth-child(4) { transition-delay: 0.3s; }
}

/* Default state: always visible for accessibility */
.reveal {
    opacity: 1;
    transform: none;
}

@media (prefers-reduced-motion: no-preference) {
    .reveal {
        opacity: 0;
        transform: translateY(30px);
    }
}

/* ===== Service Card Hover ===== */
.service-card {
    will-change: transform;
}

/* ===== Approach Card Hover ===== */
.approach-card {
    will-change: transform;
}

/* ===== Navbar Transition ===== */
#navbar.scrolled {
    background: rgba(13, 10, 4, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(201, 162, 39, 0.1);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

/* ===== Mobile Menu ===== */
.mobile-link {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.4s ease, transform 0.4s 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 {
    will-change: transform;
}

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

/* ===== Selection ===== */
::selection {
    background: rgba(201, 162, 39, 0.3);
    color: #f2ebd2;
}

/* ===== Focus Visible ===== */
:focus-visible {
    outline: 2px solid #d4af37;
    outline-offset: 2px;
}

/* ===== Input Autofill ===== */
input:-webkit-autofill,
textarea:-webkit-autofill,
select:-webkit-autofill {
    -webkit-box-shadow: 0 0 0 30px #2a1f10 inset !important;
    -webkit-text-fill-color: #f2ebd2 !important;
    caret-color: #f2ebd2;
}

/* ===== Smooth Image Loading ===== */
img {
    display: block;
    max-width: 100%;
}

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

/* ===== Tablet & Up ===== */
@media (min-width: 768px) {
    .service-card {
        transition-delay: 0ms;
    }
    .service-card:nth-child(2) {
        transition-delay: 100ms;
    }
    .service-card:nth-child(3) {
        transition-delay: 200ms;
    }
}

/* ===== Print ===== */
@media print {
    body {
        background: white;
        color: #1a1209;
    }
    
    .hero-orb, #navbar, .reveal {
        display: none !important;
    }
}
