/* ── Base ── */
*, *::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: rgba(42, 92, 50, 0.15);
    color: #1a3a2a;
}

/* ── Hero Gradient ── */
.hero-gradient {
    background: linear-gradient(
        145deg,
        #0f2418 0%,
        #1a3a2a 30%,
        #2a5c32 55%,
        #1a3a2a 80%,
        #0f2418 100%
    );
}

.hero-pattern {
    background-image: radial-gradient(circle at 25% 25%, rgba(250, 249, 246, 0.03) 0%, transparent 50%),
                      radial-gradient(circle at 75% 75%, rgba(250, 249, 246, 0.04) 0%, transparent 50%);
}

/* ── Scroll Line Animation ── */
.scroll-line {
    animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {
    0%, 100% { opacity: 0.3; transform: scaleY(1); }
    50% { opacity: 0.7; transform: scaleY(1.2); }
}

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

.hero-badge {
    animation: heroFadeUp 0.8s ease-out 0.2s both;
}

.hero-badge span:first-child {
    animation: heroFadeUp 0.8s ease-out 0.1s both;
}

.hero-badge span:last-child {
    animation: heroFadeUp 0.8s ease-out 0.3s both;
}

.hero-badge svg {
    animation: heroFadeUp 0.8s ease-out 0.15s both;
}

#hero h1 {
    animation: heroFadeUp 1s ease-out 0.4s both;
}

#hero p {
    animation: heroFadeUp 1s ease-out 0.6s both;
}

#hero .flex {
    animation: heroFadeUp 1s ease-out 0.8s both;
}

/* ── Navbar ── */
#navbar {
    background: transparent;
}

#navbar.scrolled {
    background: rgba(250, 249, 246, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 1px 0 rgba(26, 58, 42, 0.06);
}

.nav-link {
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 50%;
    width: 0;
    height: 1px;
    background: currentColor;
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

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

/* ── Mobile Menu ── */
#mobile-menu.open {
    transform: translateX(0);
}

#mobile-menu.closed {
    transform: translateX(-100%);
}

.menu-line {
    display: block;
}

.menu-toggle.active .menu-line:nth-child(1) {
    transform: rotate(45deg) translate(3px, 3px);
}

.menu-toggle.active .menu-line:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active .menu-line:nth-child(3) {
    transform: rotate(-45deg) translate(3px, -3px);
    width: 1.25rem;
}

.mobile-link {
    opacity: 0;
    transform: translateY(20px);
    transition: all 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; }

/* ── Reveal Animations (below fold only) ── */
@media (prefers-reduced-motion: no-preference) {
    .reveal {
        opacity: 0;
        transform: translateY(24px);
        transition: opacity 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                    transform 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    }

    .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; }
}

/* Fallback: ensure content is visible without JS */
.no-js .reveal,
.js-enabled .reveal {
    /* JS will add .revealed class */
}

/* ── Image Hover ── */
.group:hover .group-hover\:scale-105 {
    will-change: transform;
}

/* ── Smooth Focus ── */
a:focus-visible,
button:focus-visible {
    outline: 2px solid #2a5c32;
    outline-offset: 4px;
    border-radius: 4px;
}

/* ── Custom Scrollbar ── */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: #faf9f6;
}

::-webkit-scrollbar-thumb {
    background: #b8d1bb;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #8fb892;
}

/* ── Responsive ── */
@media (max-width: 767px) {
    .hero-gradient {
        background: linear-gradient(
            160deg,
            #0f2418 0%,
            #1a3a2a 40%,
            #2a5c32 65%,
            #1a3a2a 100%
        );
    }
}
