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

html {
    scroll-behavior: smooth;
}

body {
    overflow-x: hidden;
}

/* Scroll reveal — progressive enhancement, only when JS is enabled */
@media (prefers-reduced-motion: no-preference) {
    .scroll-reveal {
        opacity: 0;
        transform: translateY(24px);
        transition: opacity 0.6s ease, transform 0.6s ease;
    }
    .scroll-reveal.revealed {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Fallback: content always visible if JS is disabled */
.no-js .scroll-reveal {
    opacity: 1;
    transform: none;
}

/* Navbar scroll state */
.nav-scrolled {
    background: rgba(254, 253, 248, 0.95) !important;
    backdrop-filter: blur(12px);
    box-shadow: 0 1px 20px rgba(4, 78, 59, 0.1);
}

.nav-scrolled #navbar > div > a > div > span:first-child,
.nav-scrolled #navbar > div > a > div > span:first-child {
    color: #064e3b !important;
}

.nav-scrolled a[href="#services"],
.nav-scrolled a[href="#about"],
.nav-scrolled a[href="#safety"],
.nav-scrolled a[href="#contact"] {
    color: #064e3b !important;
}

/* Mobile menu transitions */
#mobileOverlay.opening {
    animation: slideIn 0.3s ease forwards;
}

@keyframes slideIn {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}

#mobileOverlay.closing {
    animation: slideOut 0.25s ease forwards;
}

@keyframes slideOut {
    from { transform: translateX(0); }
    to { transform: translateX(100%); }
}

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

/* Subtle pattern for cream sections */
.bg-cream-50 {
    background-color: #fefdf8;
    background-image: radial-gradient(circle at 1px 1px, rgba(16, 185, 129, 0.04) 1px, transparent 0);
    background-size: 24px 24px;
}
