/* ========== BASE & UTILITIES ========== */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

::selection {
    background-color: rgba(26, 95, 63, 0.15);
    color: #1a5f3f;
}

/* ========== NAVBAR ========== */
#navbar {
    background: transparent;
    transition: background-color 0.4s ease, box-shadow 0.4s ease, backdrop-filter 0.4s ease;
}

#navbar.scrolled {
    background: rgba(254, 253, 251, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 1px 20px rgba(26, 95, 63, 0.07);
}

.nav-link {
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 4px;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    width: 20px;
    height: 2px;
    background: #1a5f3f;
    border-radius: 1px;
    transition: transform 0.2s ease, width 0.2s ease;
}

.nav-link:hover::after,
.nav-link:focus::after {
    transform: translateX(-50%) scaleX(1);
    width: 24px;
}

/* ========== FLOATING CARDS ========== */
.floating-card-1 {
    animation: floatA 5s ease-in-out infinite;
}

.floating-card-2 {
    animation: floatB 6s ease-in-out infinite;
}

.floating-card-3 {
    animation: floatC 5.5s ease-in-out infinite;
}

.floating-card-4 {
    animation: floatD 4.5s ease-in-out infinite;
}

@keyframes floatA {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-12px) rotate(0.5deg); }
}

@keyframes floatB {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-16px) rotate(-0.5deg); }
}

@keyframes floatC {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

@keyframes floatD {
    0%, 100% { transform: translateY(0px) scale(1); }
    50% { transform: translateY(-8px) scale(1.02); }
}

/* ========== 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, #1a5f3f, #5f9a6e);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s ease;
    border-radius: 3px 3px 0 0;
}

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

/* ========== SCROLL REVEAL ========== */
.reveal {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal[data-reveal] {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal[data-reveal="left"] {
    transform: translateX(-24px);
}

.reveal[data-reveal="right"] {
    transform: translateX(24px);
}

.reveal[data-reveal="scale"] {
    transform: scale(0.96);
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .reveal[data-reveal] {
        opacity: 1;
        transform: none;
    }
    .floating-card-1,
    .floating-card-2,
    .floating-card-3,
    .floating-card-4 {
        animation: none;
    }
    html {
        scroll-behavior: auto;
    }
    .service-card::before {
        transform: scaleX(1);
    }
}

/* ========== MOBILE MENU ========== */
.mobile-link {
    display: block;
}

#mobileMenu {
    animation: slideDown 0.3s ease;
}

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

/* ========== FORM ========== */
input:focus,
textarea:focus {
    box-shadow: 0 0 0 3px rgba(26, 95, 63, 0.1);
}

/* ========== ACCESSIBILITY ========== */
:focus-visible {
    outline: 2px solid #1a5f3f;
    outline-offset: 2px;
    border-radius: 4px;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 640px) {
    .floating-card-1 {
        position: relative;
        top: auto;
        left: auto;
        margin-bottom: 12px;
        animation: none;
    }
    .floating-card-2 {
        position: relative;
        top: auto;
        right: auto;
        margin-bottom: 12px;
        animation: none;
    }
    .floating-card-3 {
        position: relative;
        bottom: auto;
        left: auto;
        margin-bottom: 12px;
        animation: none;
    }
    .floating-card-4 {
        position: relative;
        bottom: auto;
        right: auto;
        animation: none;
    }
}
