/* Base & Utilities */
html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

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

/* Selection */
::selection {
    background: #A7F3D0;
    color: #0A2540;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #FFFBF5;
}
::-webkit-scrollbar-thumb {
    background: #0A2540;
    border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover {
    background: #0F3460;
}

/* Reveal Animations */
.reveal {
    opacity: 0;
    transform: translateY(32px);
    transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1), transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

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

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

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .reveal {
        opacity: 1;
        transform: none;
        transition: none;
    }
    .animate-bounce { animation: none; }
}

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

/* Navbar scroll state */
nav.scrolled {
    background: rgba(255, 251, 245, 0.95);
    backdrop-filter: blur(16px);
    box-shadow: 0 1px 0 rgba(10, 37, 64, 0.08);
}

nav.scrolled #navbar a:not([href="tel:"]) {
    color: #0A2540;
}

/* Mobile menu transitions */
#mobile-menu {
    animation: slideDown 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

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

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

/* Subtle grain texture overlay for hero */
#hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 1;
}

#hero > * {
    position: relative;
    z-index: 2;
}
