/* Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    overflow-x: hidden;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #081118;
}
::-webkit-scrollbar-thumb {
    background: #1e3656;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #2a4a72;
}

/* Float animations */
@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-12px); }
}

@keyframes float-slow {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-8px) rotate(1deg); }
}

.animate-float {
    animation: float 4s ease-in-out infinite;
}

.animate-float-slow {
    animation: float-slow 5s ease-in-out infinite;
}

/* Scroll reveal - progressive enhancement */
@media (prefers-reduced-motion: no-preference) {
    .reveal {
        opacity: 0;
        transform: translateY(30px);
        transition: opacity 0.6s ease, transform 0.6s ease;
    }

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

    /* Stagger children */
    .reveal-grid > * {
        opacity: 0;
        transform: translateY(20px);
        transition: opacity 0.5s ease, transform 0.5s ease;
    }

    .reveal-grid.revealed > *:nth-child(1) { transition-delay: 0.05s; }
    .reveal-grid.revealed > *:nth-child(2) { transition-delay: 0.1s; }
    .reveal-grid.revealed > *:nth-child(3) { transition-delay: 0.15s; }
    .reveal-grid.revealed > *:nth-child(4) { transition-delay: 0.2s; }
    .reveal-grid.revealed > *:nth-child(5) { transition-delay: 0.25s; }
    .reveal-grid.revealed > *:nth-child(6) { transition-delay: 0.3s; }
}

/* Fallback: ensure content is visible even if JS is disabled */
@media not all and (prefers-reduced-motion: no-preference) {
    .reveal {
        opacity: 1;
        transform: none;
    }
}

/* Nav active state */
nav a.active {
    color: #34d399;
}

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

/* Mobile menu transitions */
#mobile-menu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

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

/* Image aspect ratio helpers */
img {
    max-width: 100%;
    height: auto;
}

/* Selection color */
::selection {
    background: rgba(52, 211, 153, 0.3);
    color: #f0fdf4;
}
