*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

body {
    overflow-x: hidden;
}

/* Header transitions */
#header.scrolled {
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(20px);
    box-shadow: 0 1px 0 rgba(10, 31, 68, 0.08);
}

#header.scrolled .header-title {
    color: #0a1f44;
}

#header.scrolled .nav-link {
    color: #0a1f44;
}

/* Scroll reveal animations */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.reveal:nth-child(2) { transition-delay: 0.1s; }
.reveal:nth-child(3) { transition-delay: 0.2s; }

/* Scroll indicator animation */
.scroll-indicator svg {
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(6px); }
    60% { transform: translateY(3px); }
}

/* Mobile menu animations */
.menu-line {
    display: block;
    height: 2px;
    width: 24px;
    background-color: #0a1f44;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

#menu-toggle.active .menu-line:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

#menu-toggle.active .menu-line:nth-child(2) {
    opacity: 0;
}

#menu-toggle.active .menu-line:nth-child(3) {
    width: 24px;
    transform: rotate(-45deg) translate(5px, -5px);
}

/* Mobile link hover */
.mobile-link {
    position: relative;
}

.mobile-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 50%;
    width: 0;
    height: 2px;
    background: #d4af37;
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

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

/* Smooth image loading */
img {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

/* Selection color */
::selection {
    background: #d4af37;
    color: #0a1f44;
}

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

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

::-webkit-scrollbar-track {
    background: #f5f5f5;
}

::-webkit-scrollbar-thumb {
    background: #0a1f44;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #112d5e;
}

/* Menu line mobile */
@media (max-width: 1023px) {
    .menu-line {
        background-color: #0a1f44;
    }
}

/* 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;
    }
    
    .reveal {
        opacity: 1;
        transform: none;
    }
}
