/* ===== BASE ===== */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body { margin: 0; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
img { display: block; max-width: 100%; }

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #0a1f3f; }
::-webkit-scrollbar-thumb { background: #2dd4bf30; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #2dd4bf50; }

/* ===== ANIMATIONS ===== */
@keyframes fade-up {
    from { opacity: 0; transform: translateY(30px); }
    to   { opacity: 1; transform: translateY(0); }
}

.animate-fade-up {
    animation-name: fade-up;
    animation-duration: 0.8s;
    animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
    animation-iteration-count: 1;
}

@keyframes scroll-line {
    0%   { opacity: 0; transform: scaleY(0); transform-origin: top; }
    50%  { opacity: 1; transform: scaleY(1); transform-origin: top; }
    51%  { transform-origin: bottom; }
    100% { opacity: 0; transform: scaleY(0); transform-origin: bottom; }
}

.animate-scroll-line {
    animation: scroll-line 2s ease-in-out infinite;
}

/* ===== REVEAL (scroll-triggered, progressive enhancement) ===== */
.reveal {
    opacity: 1;
    transform: none;
    transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.fade-up {
    opacity: 0;
    transform: translateY(40px);
}

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

/* Respect reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    .reveal { opacity: 1; transform: none; }
    html { scroll-behavior: auto; }
}

/* ===== NAV SCROLL STATE ===== */
#site-header.scrolled {
    background: rgba(6, 18, 38, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 1px 0 rgba(255,255,255,0.05);
}

#site-header.scrolled .nav-link { color: rgba(255,255,255,0.85); }

/* ===== MOBILE MENU ===== */
#mobile-menu.open {
    opacity: 1;
    pointer-events: all;
}

#mobile-menu.open .mobile-link {
    animation: fade-up 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}

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

/* ===== CARD HOVER GLOW ===== */
.group:hover .group-hover\:border-mint-300\/20 {
    border-color: rgba(45, 212, 191, 0.2);
}

/* ===== FOCUS VISIBLE ===== */
:focus-visible {
    outline: 2px solid #2dd4bf;
    outline-offset: 2px;
    border-radius: 4px;
}

/* ===== SELECTION ===== */
::selection {
    background: rgba(45, 212, 191, 0.3);
    color: #f0fdf9;
}
