/* === Base & Utilities === */
*, *::before, *::after {
    box-sizing: border-box;
}

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

body {
    overflow-x: hidden;
}

::selection {
    background: rgba(255, 107, 53, 0.3);
    color: #f7f7f8;
}

/* === Scrollbar === */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #0f0f16;
}
::-webkit-scrollbar-thumb {
    background: #3d3d4d;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #545466;
}

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

@keyframes float-delayed {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-8px); }
}

@keyframes marquee {
    0% { transform: translateX(0%); }
    100% { transform: translateX(-50%); }
}

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

.animate-float-delayed {
    animation: float-delayed 4.5s ease-in-out infinite;
    animation-delay: 1s;
}

.animate-marquee {
    animation: marquee 25s linear infinite;
}

/* === Reveal on Scroll === */
.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.visible {
    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; }

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

#navbar.scrolled {
    background: rgba(15, 15, 22, 0.92);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(61, 61, 77, 0.5);
    box-shadow: 0 1px 40px rgba(0, 0, 0, 0.3);
}

/* === Mobile Menu === */
.mobile-link {
    display: block;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(61, 61, 77, 0.3);
}

.mobile-link:last-child {
    border-bottom: none;
}

/* === Focus Styles === */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
    outline: 2px solid #ff8a56;
    outline-offset: 2px;
}

/* === Image Optimization === */
img {
    max-width: 100%;
    height: auto;
}

/* === Responsive Typography === */
@media (max-width: 640px) {
    .font-serif {
        line-height: 1.1;
    }
}

/* === Print Styles === */
@media print {
    #navbar, .animate-marquee, .animate-float, .animate-float-delayed {
        display: none;
    }
    body {
        background: white;
        color: black;
    }
}
