/* Base */
*, *::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: #143D2B;
    color: #FAF8F4;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: #FAF8F4;
}
::-webkit-scrollbar-thumb {
    background: #9cc3a3;
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: #4d805a;
}

/* Reveal Animations - Progressive Enhancement */
@media (prefers-reduced-motion: no-preference) {
    .reveal-up {
        opacity: 0;
        transform: translateY(24px);
        transition: opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                    transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    }

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

    /* Stagger delays handled in JS */
    .reveal-up[data-delay="100"] { transition-delay: 0.1s; }
    .reveal-up[data-delay="200"] { transition-delay: 0.2s; }
    .reveal-up[data-delay="300"] { transition-delay: 0.3s; }
    .reveal-up[data-delay="400"] { transition-delay: 0.4s; }
    .reveal-up[data-delay="500"] { transition-delay: 0.5s; }
}

/* Scroll line animation */
@keyframes scrollLine {
    0% { transform: translateY(-100%); }
    100% { transform: translateY(200%); }
}

.animate-scroll-line {
    animation: scrollLine 1.5s ease-in-out infinite;
}

/* Nav active state */
.nav-link::after {
    content: '';
    display: block;
    width: 0;
    height: 1px;
    background: currentColor;
    transition: width 0.3s ease;
    margin-top: 2px;
}

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

/* Mobile menu transitions */
#mobile-menu {
    backdrop-filter: blur(8px);
}

/* Mobile link hover */
.mobile-link {
    position: relative;
}

.mobile-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 50%;
    width: 0;
    height: 1px;
    background: #143D2B;
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

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

/* Form focus styles */
input:focus, textarea:focus {
    caret-color: #D4C5A9;
}

/* Button press effect */
button:active {
    transform: scale(0.98);
}

/* Image loading placeholder */
img {
    background-color: #EDE5D5;
}

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