/* =============================================
   Steve Law & Associates — Custom Styles
   Classic & Elegant · Forest Green + Off-White
   ============================================= */

/* ---- Reset & Base ---- */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    margin: 0;
    overflow-x: hidden;
}

::selection {
    background-color: rgba(27, 58, 42, 0.2);
    color: #1B3A2A;
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #F5F2EB;
}
::-webkit-scrollbar-thumb {
    background: #aad1b8;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #7bb894;
}

/* ---- Hero Animations ---- */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.reveal-hero {
    opacity: 0;
    animation: fadeInUp 0.8s ease forwards;
}

.reveal-hero:nth-child(1) { animation-delay: 0.1s; }
.reveal-hero:nth-child(2) { animation-delay: 0.3s; }
.reveal-hero:nth-child(3) { animation-delay: 0.5s; }
.reveal-hero:nth-child(4) { animation-delay: 0.7s; }
.reveal-hero:nth-child(5) { animation-delay: 0.9s; }

/* ---- Scroll Indicator Animation ---- */
@keyframes scrollLine {
    0% {
        opacity: 0;
        transform: scaleY(0);
        transform-origin: top;
    }
    50% {
        opacity: 1;
        transform: scaleY(1);
        transform-origin: top;
    }
    100% {
        opacity: 0;
        transform: scaleY(1);
        transform-origin: bottom;
    }
}

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

/* ---- Section Reveal (below fold) ---- */
.section-reveal {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

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

/* ---- Service Card Hover ---- */
.service-card {
    transform: translateY(0);
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.service-card:hover {
    transform: translateY(-6px);
}

/* ---- Nav Link Hover Effect ---- */
.nav-link {
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 1.5px;
    background: #F5F2EB;
    transition: width 0.3s ease, left 0.3s ease;
}

.nav-link:hover::after {
    width: 80%;
    left: 10%;
}

/* ---- Mobile Nav Link ---- */
.mobile-nav-link {
    opacity: 0;
    transform: translateY(15px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

#mobile-menu.is-open .mobile-nav-link {
    opacity: 1;
    transform: translateY(0);
}

#mobile-menu.is-open .mobile-nav-link:nth-child(1) { transition-delay: 0.05s; }
#mobile-menu.is-open .mobile-nav-link:nth-child(2) { transition-delay: 0.1s; }
#mobile-menu.is-open .mobile-nav-link:nth-child(3) { transition-delay: 0.15s; }
#mobile-menu.is-open .mobile-nav-link:nth-child(4) { transition-delay: 0.2s; }
#mobile-menu.is-open .mobile-nav-link:nth-child(5) { transition-delay: 0.25s; }
#mobile-menu.is-open .mobile-nav-link:nth-child(6) { transition-delay: 0.3s; }

/* ---- Back to Top Button ---- */
#back-to-top.is-visible {
    opacity: 1;
    translate: 0 0;
    pointer-events: auto;
}

/* ---- Form Focus States ---- */
input:focus,
select:focus,
textarea:focus {
    background-color: #ffffff;
}

/* ---- Reduced Motion ---- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    html {
        scroll-behavior: auto;
    }

    .reveal-hero {
        opacity: 1;
        animation: none;
    }

    .animate-scroll-line {
        animation: none;
        opacity: 0.5;
    }

    .section-reveal {
        opacity: 1;
        transform: none;
    }

    .service-card:hover {
        transform: none;
    }
}

/* ---- Responsive ---- */
@media (max-width: 639px) {
    .font-serif.text-4xl {
        font-size: 2rem;
    }
}

@media (min-width: 768px) and (max-width: 1023px) {
    .font-serif.text-5xl {
        font-size: 3rem;
    }
}
