/* Base styles and custom utilities */
html {
    scroll-behavior: smooth;
}

body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Scroll reveal animations — progressive enhancement, hidden by default */
.scroll-reveal {
    opacity: 1;
    transform: none;
    transition: opacity 0.7s cubic-bezier(0.22, 0.61, 0.36, 1), transform 0.7s cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* Only apply animation when JS is active and user prefers motion */
@media (prefers-reduced-motion: no-preference) {
    .js-enabled .scroll-reveal {
        opacity: 0;
        transform: translateY(30px);
    }
    .js-enabled .scroll-reveal.revealed {
        opacity: 1;
        transform: translateY(0);
    }
    .js-enabled .scroll-reveal.revealed:nth-child(1) { transition-delay: 0ms; }
    .js-enabled .scroll-reveal.revealed:nth-child(2) { transition-delay: 100ms; }
    .js-enabled .scroll-reveal.revealed:nth-child(3) { transition-delay: 200ms; }
    .js-enabled .scroll-reveal.revealed:nth-child(4) { transition-delay: 300ms; }
}

/* Navbar transition states */
.nav-scrolled {
    background: rgba(255, 255, 255, 0.97) !important;
    backdrop-filter: blur(10px);
    box-shadow: 0 1px 20px rgba(0, 0, 0, 0.08);
}

.nav-scrolled .nav-text-color {
    color: #0f172a !important;
}

.nav-scrolled .nav-subtext {
    color: #64748b !important;
}

.nav-scrolled .nav-link {
    color: #334155 !important;
}

/* Hero text color transition */
.nav-hero .nav-text-color {
    color: #0f172a;
}

.nav-hero .nav-subtext {
    color: #64748b;
}

.nav-hero .nav-link {
    color: #475569;
}

/* Selection color */
::selection {
    background-color: #ccfbf1;
    color: #042f2e;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
    background: #94a3b8;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #64748b;
}

/* Ensure images don't overflow */
img {
    max-width: 100%;
    height: auto;
}

/* Print styles */
@media print {
    nav, #contact, .scroll-reveal { display: block; opacity: 1; }
    .scroll-reveal { transform: none; }
}
