/* ============================================
   The Spruce Design Co. — Custom Styles
   ============================================ */

/* ─── Base & Typography ─── */
html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    overflow-x: hidden;
}

::selection {
    background-color: #166534;
    color: #fefdf8;
}

/* ─── Scrollbar ─── */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #fdf9f0;
}
::-webkit-scrollbar-thumb {
    background: #166534;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #064e3b;
}

/* ─── Navigation ─── */
.nav-link {
    position: relative;
}

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

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

/* ─── Navbar Scroll State ─── */
#navbar.scrolled {
    background: rgba(254, 253, 248, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 1px 0 rgba(6, 78, 59, 0.08);
}

/* ─── Buttons ─── */
.btn-primary {
    display: inline-flex;
    align-items: center;
    background: #166534;
    color: #fefdf8;
    padding: 14px 28px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.9375rem;
    text-decoration: none;
    border: 2px solid #166534;
    transition: all 0.3s ease;
    cursor: pointer;
}

.btn-primary:hover {
    background: #064e3b;
    border-color: #064e3b;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(6, 78, 59, 0.25);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    background: transparent;
    color: #166534;
    padding: 14px 28px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.9375rem;
    text-decoration: none;
    border: 2px solid #166534;
    transition: all 0.3s ease;
    cursor: pointer;
}

.btn-secondary:hover {
    background: #166534;
    color: #fefdf8;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(6, 78, 59, 0.25);
}

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

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 16px;
    border: 1px solid rgba(22, 101, 52, 0.08);
    pointer-events: none;
    transition: border-color 0.5s ease;
}

.service-card:hover::before {
    border-color: transparent;
}

/* ─── Testimonial Cards ─── */
.testimonial-card {
    position: relative;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.testimonial-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 48px rgba(6, 78, 59, 0.1);
}

/* ─── Scroll Reveal (progressive enhancement) ─── */
@media (prefers-reduced-motion: no-preference) {
    .reveal {
        opacity: 0;
        transform: translateY(24px);
        transition: opacity 0.7s ease, transform 0.7s ease;
    }

    .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; }
    .reveal-delay-6 { transition-delay: 0.6s; }
}

/* ─── Mobile Menu ─── */
.mobile-nav-link {
    transition: color 0.2s ease;
}

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

#mobile-menu.closed {
    opacity: 0;
    pointer-events: none;
}

/* ─── Form Focus States ─── */
input:focus,
select:focus,
textarea:focus {
    outline: none;
}

/* ─── Reduced Motion ─── */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    .reveal {
        opacity: 1;
        transform: none;
        transition: none;
    }

    .service-card,
    .testimonial-card {
        transition: none;
    }

    .group:hover img {
        transform: none;
    }
}
