/* Base styles & custom properties */
:root {
    --font-serif: 'DM Serif Display', Georgia, serif;
    --font-sans: 'Nunito Sans', system-ui, sans-serif;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    -webkit-font-smoothing: antialiased;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #f2f7f4;
}
::-webkit-scrollbar-thumb {
    background: #96be9a;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #6a9e6e;
}

/* Selection */
::selection {
    background: #c3d9c6;
    color: #1b301f;
}

/* Smooth scroll offset for fixed navbar */
section[id] {
    scroll-margin-top: 80px;
}

/* Service cards */
.service-card {
    position: relative;
    overflow: hidden;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #4a7d4e, #96be9a);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s ease;
}

.service-card:hover::before {
    transform: scaleX(1);
}

/* Gallery */
.gallery-item {
    cursor: pointer;
}

.gallery-item img {
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Testimonials */
.testimonial-card {
    position: relative;
}

.testimonial-card::before {
    content: '\201C';
    position: absolute;
    top: 16px;
    left: 20px;
    font-family: var(--font-serif);
    font-size: 80px;
    line-height: 1;
    color: #c3d9c6;
    pointer-events: none;
}

/* Mobile menu */
#mobile-menu {
    animation: slideDown 0.3s ease;
}

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

/* Nav link underline animation */
.nav-link {
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: #4a7d4e;
    transition: width 0.3s ease;
}

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

/* Mobile links */
.mobile-link {
    position: relative;
    padding-left: 0;
}

.mobile-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 2px;
    background: #4a7d4e;
    transition: width 0.3s ease;
}

.mobile-link:hover::before {
    width: 16px;
}

/* Scroll reveal animations - progressive enhancement only */
.reveal {
    opacity: 1;
    transform: none;
    transition: opacity 0.6s ease, transform 0.6s ease;
}

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

@media (prefers-reduced-motion: no-preference) {
    .reveal {
        opacity: 0;
        transform: translateY(24px);
    }
    .reveal.revealed {
        opacity: 1;
        transform: translateY(0);
    }
    .reveal-delay-1 { transition-delay: 0.1s; }
    .reveal-delay-2 { transition-delay: 0.2s; }
    .reveal-delay-3 { transition-delay: 0.3s; }
    .reveal-delay-4 { transition-delay: 0.4s; }
    .reveal-delay-5 { transition-delay: 0.5s; }
}

/* Navbar background transition */
#navbar.scrolled {
    background: rgba(254, 253, 248, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 1px 20px rgba(44, 78, 49, 0.08);
}

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

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
    .gallery-item img,
    .service-card::before {
        transition: none;
    }
    .service-card:hover::before {
        transform: scaleX(0);
    }
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High contrast support */
@media (prefers-contrast: high) {
    .service-card {
        border: 2px solid #2c4e31;
    }
    .testimonial-card {
        border: 2px solid #2c4e31;
    }
}
