/* === BASE & RESET === */
*, *::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(95, 196, 163, 0.3);
    color: #ffffff;
}

/* === NAVBAR === */
#navbar {
    background: transparent;
    transition: background 0.5s ease, box-shadow 0.5s ease, backdrop-filter 0.5s ease;
}

#navbar.scrolled {
    background: rgba(4, 11, 22, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.05);
}

.nav-link {
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 1px;
    background: #5fc4a3;
    transition: width 0.3s ease;
}

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

.nav-link:hover {
    color: #ffffff !important;
}

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

.mobile-nav-link {
    position: relative;
}

.mobile-nav-link::after {
    content: '';
    display: block;
    width: 0;
    height: 1px;
    background: #5fc4a3;
    transition: width 0.3s ease;
    margin: 0 auto;
}

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

/* === HERO FLOATING CARDS === */
.floating-card {
    will-change: transform;
}

.card-1 {
    animation: float1 6s ease-in-out infinite;
}

.card-2 {
    animation: float2 7s ease-in-out infinite;
}

.card-3 {
    animation: float3 5.5s ease-in-out infinite;
}

.card-4 {
    animation: float4 6.5s ease-in-out infinite;
}

@keyframes float1 {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-12px); }
}

@keyframes float2 {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-16px); }
}

@keyframes float3 {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

@keyframes float4 {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-14px); }
}

/* === MATERIAL CARDS === */
.material-card {
    transition: transform 0.4s ease, box-shadow 0.4s ease;
    transform: translateY(0);
}

.material-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(95, 196, 163, 0.15);
}

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

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

    .reveal-delay-1 { transition-delay: 0.1s; }
    .reveal-delay-2 { transition-delay: 0.2s; }
    .reveal-delay-3 { transition-delay: 0.3s; }
    .reveal-delay-4 { transition-delay: 0.4s; }
    .reveal-delay-5 { transition-delay: 0.5s; }
    .reveal-delay-6 { transition-delay: 0.6s; }
}

/* Fallback: content always visible if JS is disabled or prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
    .reveal {
        opacity: 1;
        transform: none;
    }
}

/* === BUTTONS === */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
    outline: 2px solid rgba(95, 196, 163, 0.6);
    outline-offset: 2px;
}

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

::-webkit-scrollbar-track {
    background: #040B16;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* === RESPONSIVE === */
@media (max-width: 767px) {
    .font-serif {
        word-spacing: -0.02em;
    }
}
