/* Base Styles */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

body {
    overflow-x: hidden;
}

::selection {
    background-color: rgba(27, 67, 50, 0.15);
    color: #1B4332;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #fdf9ed;
}
::-webkit-scrollbar-thumb {
    background: #b9d1b8;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #8fb88e;
}

/* Animations */
@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.animate-float {
    animation: float 4s ease-in-out infinite;
}

/* Hero Animations */
.hero-title {
    animation: slideUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    animation-delay: 0.2s;
}

.hero-subtitle {
    animation: slideUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    animation-delay: 0.1s;
}

.hero-desc {
    animation: slideUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    animation-delay: 0.3s;
}

.hero-cta {
    animation: slideUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    animation-delay: 0.4s;
}

.hero-stats {
    animation: slideUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    animation-delay: 0.5s;
}

.hero-img-main {
    animation: fadeInScale 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    animation-delay: 0.3s;
    opacity: 0;
}

.hero-img-accent {
    animation: fadeInScale 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    animation-delay: 0.5s;
    opacity: 0;
}

.hero-badge {
    animation: fadeInScale 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    animation-delay: 0.7s;
    opacity: 0;
}

@keyframes slideUp {
    from {
        transform: translateY(40px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes fadeInScale {
    from {
        transform: scale(0.95);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Reveal on Scroll */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 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; }

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

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

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

/* Navbar scroll state */
nav.scrolled {
    background-color: rgba(254, 253, 248, 0.95);
    backdrop-filter: blur(20px);
    box-shadow: 0 1px 20px rgba(27, 67, 50, 0.06);
}

nav.scrolled .nav-link {
    color: #1B4332;
}

nav.scrolled .nav-link::after {
    background-color: #1B4332;
}

nav.scrolled .menu-line {
    background-color: #1B4332;
}

/* Mobile Menu */
.mobile-link {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

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

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

/* Mobile menu toggle */
#mobile-menu.open .menu-line:nth-child(1) {
    transform: rotate(45deg) translate(4px, 4px);
}
#mobile-menu.open .menu-line:nth-child(2) {
    opacity: 0;
}
#mobile-menu.open .menu-line:nth-child(3) {
    transform: rotate(-45deg) translate(4px, -4px);
    width: 5px;
}

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

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 1.5rem;
    border: 1px solid transparent;
    transition: border-color 0.5s ease;
    pointer-events: none;
}

.service-card:hover::before {
    border-color: rgba(27, 67, 50, 0.1);
}

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

.gallery-item::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(27, 67, 50, 0.2), transparent);
    opacity: 0;
    transition: opacity 0.4s ease;
    border-radius: 0.75rem;
}

.gallery-item:hover::after {
    opacity: 1;
}

/* Section Labels */
.section-label {
    display: block;
}

/* Smooth focus outlines */
*:focus-visible {
    outline: 2px solid #1B4332;
    outline-offset: 2px;
}

/* Responsive */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2.75rem;
    }

    .hero-title br {
        display: none;
    }

    #hero {
        min-height: auto;
        padding: 6rem 0 4rem;
    }

    .hero-img-wrapper {
        height: 400px !important;
    }

    .section-title {
        font-size: 2.25rem !important;
    }
}

@media (max-width: 640px) {
    .hero-title {
        font-size: 2.25rem;
    }

    .hero-stats {
        gap: 6px !important;
    }

    .hero-stats > div > p {
        font-size: 1.5rem !important;
    }
}
