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

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

body {
    overflow-x: hidden;
}

/* Scroll Reveal - Progressive Enhancement */
@media (prefers-reduced-motion: no-preference) {
    .scroll-reveal {
        opacity: 0;
        transform: translateY(24px);
        transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1), transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
    }
    
    .scroll-reveal.revealed {
        opacity: 1;
        transform: translateY(0);
    }
    
    /* Stagger children */
    .scroll-reveal.revealed ~ .scroll-reveal {
        transition-delay: 0.1s;
    }
}

/* Fallback: ensure content is always visible */
.no-js .scroll-reveal,
.js .scroll-reveal {
    /* JS will add .revealed class; without JS, content is still visible */
    opacity: 1;
    transform: none;
}

/* Navbar Glass Effect */
#navbar.scrolled {
    background: rgba(10, 22, 40, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(52, 212, 181, 0.08);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

/* Mobile Menu Transitions */
#mobile-menu {
    animation: slideDown 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.mobile-link {
    display: block;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(10, 22, 40, 0.5);
}

.mobile-link:last-child {
    border-bottom: none;
}

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

::-webkit-scrollbar-track {
    background: #0A1628;
}

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

::-webkit-scrollbar-thumb:hover {
    background: #34D4B5;
}

/* Selection Color */
::selection {
    background: rgba(52, 212, 181, 0.3);
    color: #F0FBF7;
}

/* Focus Styles */
a:focus-visible,
button:focus-visible {
    outline: 2px solid #34D4B5;
    outline-offset: 2px;
    border-radius: 4px;
}

/* Image Placeholder Fallback */
img {
    background: linear-gradient(135deg, #1F3A5E 0%, #0F1F38 100%);
}

/* Smooth anchor offset for fixed nav */
section[id] {
    scroll-margin-top: 80px;
}

/* Subtle gradient text utility */
.gradient-text {
    background: linear-gradient(135deg, #34D4B5 0%, #7DD4B5 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Pulse animation for hero badge */
@keyframes soft-pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.6;
    }
}

.animate-pulse {
    animation: soft-pulse 2.5s ease-in-out infinite;
}

/* Card hover glow */
.hover-glow:hover {
    box-shadow: 0 0 40px rgba(52, 212, 181, 0.15);
}

/* Responsive typography adjustments */
@media (max-width: 640px) {
    html {
        font-size: 15px;
    }
    
    section[id] {
        scroll-margin-top: 70px;
    }
}

@media (min-width: 1024px) {
    html {
        font-size: 16px;
    }
}
