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

html { scroll-behavior: smooth; scroll-padding-top: 80px; }

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

.nav-link {
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: currentColor;
    transition: width 0.25s ease;
    border-radius: 1px;
}

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

.mobile-link {
    position: relative;
}

/* Scroll reveal — progressive enhancement, hidden by default */
@media (prefers-reduced-motion: no-preference) {
    .reveal {
        opacity: 0;
        transform: translateY(24px);
        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:nth-child(2) { transition-delay: 0.1s; }
    .reveal:nth-child(3) { transition-delay: 0.2s; }
    .reveal:nth-child(4) { transition-delay: 0.3s; }
}

/* Reduced motion: ensure everything is visible */
@media (prefers-reduced-motion: reduce) {
    .reveal {
        opacity: 1 !important;
        transform: none !important;
    }
}

/* Mobile menu transitions */
#mobile-menu {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

#mobile-menu.open {
    opacity: 1;
    pointer-events: all;
}

/* Scroll to top button */
#scroll-top.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: all;
}

/* Image lazy load fade */
img[loading="lazy"] {
    transition: opacity 0.4s ease;
}

img[loading="lazy"].loaded {
    opacity: 1;
}

img[loading="lazy"] {
    opacity: 0;
}

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

/* Selection color */
::selection {
    background-color: #c6dfc6;
    color: #1e3a1e;
}
