/* ── 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: rgba(5, 150, 105, 0.2);
    color: #022c22;
}

/* ── Hero Gradient ───────────────────────────────────── */
.hero-gradient {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        145deg,
        #022c22 0%,
        #064e3b 25%,
        #047857 50%,
        #059669 70%,
        #10b981 100%
    );
    z-index: 0;
}

.hero-pattern {
    position: absolute;
    inset: 0;
    background-image: 
        radial-gradient(ellipse 600px 600px at 20% 50%, rgba(16, 185, 129, 0.15) 0%, transparent 70%),
        radial-gradient(ellipse 400px 400px at 80% 30%, rgba(52, 211, 153, 0.1) 0%, transparent 70%),
        radial-gradient(ellipse 300px 300px at 60% 80%, rgba(6, 78, 59, 0.2) 0%, transparent 70%);
    z-index: 1;
}

/* ── Hero Typography ─────────────────────────────────── */
.hero-eyebrow {
    opacity: 0;
    animation: fadeDown 0.8s ease forwards 0.2s;
}

.hero-headline {
    opacity: 0;
    animation: fadeUp 1s ease forwards 0.4s;
}

.hero-subtitle {
    opacity: 0;
    animation: fadeUp 1s ease forwards 0.6s;
}

.hero-cta {
    opacity: 0;
    animation: fadeUp 1s ease forwards 0.8s;
}

.hero-trust {
    opacity: 0;
    animation: fadeUp 1s ease forwards 1s;
}

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

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

/* ── Scroll Reveal ───────────────────────────────────── */
.reveal {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), 
                transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

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

@media (prefers-reduced-motion: no-preference) {
    .reveal {
        opacity: 0;
        transform: translateY(32px);
    }
    
    .reveal.revealed {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── Navigation ──────────────────────────────────────── */
#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(5, 150, 105, 0.08);
}

#navbar.scrolled .nav-logo-text {
    color: #022c22;
}

#navbar.scrolled .nav-link {
    color: #047857;
}

#navbar.scrolled .nav-link:hover {
    color: #059669;
}

.nav-link {
    color: rgba(2, 44, 34, 0.7);
}

.nav-link:hover {
    color: #059669;
}

/* ── Mobile Menu ─────────────────────────────────────── */
#mobile-menu.open {
    opacity: 1;
    pointer-events: all;
}

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

.mobile-menu-link {
    position: relative;
}

.mobile-menu-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    width: 0;
    height: 1px;
    background: #059669;
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

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

.menu-line {
    display: block;
}

.menu-line.active:nth-child(1) {
    transform: translateY(5px) rotate(45deg);
}

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

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

/* ── Service Cards ───────────────────────────────────── */
.service-card {
    transition: background-color 0.5s ease;
}

/* ── Form Styles ─────────────────────────────────────── */
input:focus,
textarea:focus {
    border-bottom-color: #059669 !important;
}

input::placeholder,
textarea::placeholder {
    color: #a7c4b8;
}

/* ── Button Focus States ─────────────────────────────── */
button:focus-visible,
a:focus-visible {
    outline: 2px solid #059669;
    outline-offset: 2px;
    border-radius: 9999px;
}

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

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

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

::-webkit-scrollbar-thumb:hover {
    background: #059669;
}

/* ── Writing Vertical Utility ────────────────────────── */
.writing-vertical {
    writing-mode: vertical-rl;
    text-orientation: mixed;
}

/* ── Print Styles ────────────────────────────────────── */
@media print {
    #navbar,
    #mobile-menu,
    .hero-gradient,
    .hero-pattern {
        display: none;
    }
    
    body {
        color: #022c22;
        background: white;
    }
    
    .hero-gradient,
    .hero-pattern {
        background: #047857 !important;
    }
}
