/* ===== BASE ===== */
*, *::before, *::after {
    box-sizing: border-box;
}

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

body {
    margin: 0;
    overflow-x: hidden;
}

::selection {
    background: rgba(45, 212, 191, 0.3);
    color: #f0fdfa;
}

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

#navbar.scrolled {
    background: rgba(8, 13, 23, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(45, 212, 191, 0.1);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

#navbar.scrolled .line {
    background: white;
}

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

#mobile-menu.closed {
    opacity: 0;
    pointer-events: none;
}

.mobile-link {
    position: relative;
}

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

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

/* ===== REVEAL ANIMATIONS ===== */
/* Default: always visible (no JS required) */
.reveal {
    opacity: 1;
    transform: none;
    transition: none;
}

/* Only enable scroll-reveal when JS is available AND user prefers motion */
@media (prefers-reduced-motion: no-preference) {
    .js .reveal {
        opacity: 0;
        transform: translateY(30px);
        transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
    }

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

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

    /* Grid stagger */
    .reveal-grid > * {
        opacity: 0;
        transform: translateY(20px);
        transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    }

    .reveal-grid.visible > * {
        opacity: 1;
        transform: translateY(0);
    }

    .reveal-grid.visible > *:nth-child(1) { transition-delay: 0ms; }
    .reveal-grid.visible > *:nth-child(2) { transition-delay: 80ms; }
    .reveal-grid.visible > *:nth-child(3) { transition-delay: 160ms; }
    .reveal-grid.visible > *:nth-child(4) { transition-delay: 240ms; }
}

/* ===== GEOMETRIC DECORATIONS ===== */
.geo-diamond {
    position: absolute;
    width: 20px;
    height: 20px;
    background: #2dd4bf;
    transform: rotate(45deg);
    opacity: 0.15;
    pointer-events: none;
}

.geo-circle {
    position: absolute;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: rgba(45, 212, 191, 0.06);
    pointer-events: none;
}

/* ===== BUTTONS ===== */
a {
    text-decoration: none;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #080d17;
}

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

::-webkit-scrollbar-thumb:hover {
    background: #0d9488;
}

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

/* ===== IMAGE HOVER ===== */
img {
    display: block;
    max-width: 100%;
}

/* ===== ACCESSIBILITY ===== */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

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