/* Design Tokens */
:root {
    /* Primary Colors */
    --color-forest: #15431C;
    --color-navy: #001020;
    --color-white: #FFFFFF;
    
    /* Neutral / Secondary */
    --color-mist-gray: #C0C0C0;
    --color-steel-blue: #29628F;
    --color-warm-brown: #754F44;

    /* Semantic Colors (60/30/10 Rule) */
    --bg-primary: var(--color-white);      /* 60% neutral */
    --bg-neutral: #F4F4F4;                /* 60% neutral */
    --bg-accent: var(--color-forest);     /* 30% brand */
    --text-primary: var(--color-navy);    /* 60% neutral */
    --text-light: var(--color-mist-gray);  /* 60% neutral */
    --accent-steel: var(--color-steel-blue); /* 10% accent */
    --accent-brown: var(--color-warm-brown); /* 10% accent */

    /* Fonts */
    --font-heading: 'Bebas Neue', sans-serif;
    --font-body: 'Montserrat', sans-serif;

    /* Spacing */
    --section-padding: 120px 0;
    --container-max-width: 1400px;
}

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    color: var(--text-primary);
    line-height: 1.6;
    background-color: var(--bg-primary);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    text-transform: uppercase;
    letter-spacing: 0; /* Changed from -0.02em to ensure it looks "straight" */
    font-weight: 700;
    line-height: 1.1; /* Increased from 1 for better visual balance */
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    display: block;
    object-fit: cover;
}

.container {
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 40px;
}

/* Animations */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease-out;
}

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

/* Typography Utility */
.tight-bebas {
    font-family: var(--font-heading);
    text-transform: uppercase;
    letter-spacing: -0.05em;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 16px 40px;
    font-family: var(--font-heading);
    font-size: 1.2rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    border: none;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0.1);
    transition: left 0.3s ease;
    z-index: -1;
}

.btn:hover::after {
    left: 0;
}

.btn-primary {
    background-color: var(--color-forest);
    color: var(--color-white);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0, 157, 72, 0.3);
}

.btn-navy {
    background-color: var(--color-navy);
    color: var(--color-white);
}

.btn-secondary {
    background-color: var(--color-steel-blue);
    color: var(--color-white);
}

.btn-secondary:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(41, 98, 143, 0.3);
}

.btn-outline {
    background-color: transparent;
    color: var(--color-forest);
    border: 2px solid var(--color-forest);
    padding: 14px 38px;
}

.btn-outline:hover {
    background-color: var(--color-forest);
    color: var(--color-white);
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0, 157, 72, 0.2);
}

.btn-outline-white {
    background-color: transparent;
    color: var(--color-white);
    border: 2px solid var(--color-white);
    padding: 14px 38px;
}

.btn-outline-white:hover {
    background-color: var(--color-white);
    color: var(--color-forest);
    transform: translateY(-3px);
}

/* Navigation */
header {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    background: transparent;
    transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1), background 0.4s ease, padding 0.4s ease;
    padding: 20px 0;
}

header.header-hidden {
    transform: translateY(-100%);
}

header.scrolled {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    padding: 10px 0;
    box-shadow: 0 4px 30px rgba(0,0,0,0.05);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 10px; /* Reduced gap for a tighter, more integrated look */
    background: var(--color-white);
    padding: 8px 16px;
    border-radius: 6px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    text-decoration: none;
}

.logo-mark {
    width: 48px; /* Slightly increased for better presence */
    transition: transform 0.3s ease;
}

header.scrolled .logo-text {
    color: var(--color-forest);
    text-shadow: none;
}

.logo-text {
    font-family: var(--font-heading);
    font-size: 1.6rem;
    color: var(--color-forest);
    line-height: 0.85; /* Tighter line-height for the stacked logo text */
    letter-spacing: -0.01em;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-shadow: none;
}

.nav-links {
    display: flex;
    gap: 40px;
}

.nav-links a {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--color-white);
    letter-spacing: 0.05em;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
    transition: color 0.3s ease;
}

.nav-links a.active {
    color: var(--color-white) !important;
    border-bottom: 2px solid var(--color-forest);
    padding-bottom: 4px;
}

header.scrolled .nav-links a {
    color: var(--color-navy);
    text-shadow: none;
}

header.scrolled .nav-links a:hover {
    color: var(--color-forest);
}

header.scrolled .nav-links a.active {
    color: var(--color-forest) !important;
    border-bottom: 2px solid var(--color-forest);
}

/* Hero Section */
.hero {
    min-height: 80vh; /* Changed from height: 100vh for more flexibility */
    display: flex;
    align-items: center;
    background-size: cover;
    background-position: center;
    position: relative;
    color: var(--color-white);
    padding: 100px 0; /* Ensures content doesn't hit edges on smaller screens */
}

/* Specific height for subpage heroes to look better */
body:not(.home-page) .hero {
    min-height: 60vh;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(0,16,32,0.85) 0%, rgba(0,16,32,0.2) 60%, transparent 100%);
}

.hero-content {
    position: relative;
    max-width: 900px;
    padding-top: 100px; /* Increased for better "pacing" from the header */
}

.hero h1 {
    font-size: clamp(4rem, 8vw, 7rem);
    line-height: 1; /* Increased from 0.85 for "straightness" */
    margin-bottom: 25px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

p {
    max-width: 700px; /* Ensures professional line lengths */
}

.hero p {
    max-width: 550px;
    margin-bottom: 40px;
    font-weight: 400;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.6);
}

/* Services Bar */
.services-bar {
    background: var(--color-navy);
    color: var(--color-white);
    padding: 80px 0;
    position: relative;
    z-index: 10;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 60px;
}

.service-card h3 {
    font-size: 2.5rem;
    margin-bottom: 20px;
    color: var(--color-mist-gray);
}

.service-card p {
    font-size: 1rem;
    margin-bottom: 25px;
    opacity: 0.7;
    font-weight: 300;
}

.learn-more {
    font-family: var(--font-heading);
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.1rem;
    color: var(--color-white);
}

.learn-more:hover {
    gap: 20px;
    color: var(--color-mist-gray);
}

/* Feature Bar */
.feature-bar {
    background: var(--color-forest);
    color: var(--color-white);
    padding: 40px 0;
}

.feature-list {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.feature-item span {
    font-size: 1.5rem;
    color: var(--color-mist-gray);
}

/* Image Grid */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.gallery-grid img {
    width: 100%;
    aspect-ratio: 1;
    transition: transform 0.5s ease;
}

.gallery-grid img:hover {
    transform: scale(1.05);
}

/* Footer */
footer h3 {
    color: var(--color-white);
}

/* Mobile Navigation Toggle */
.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 6px;
    cursor: pointer;
    z-index: 1001;
}

.menu-toggle span {
    width: 30px;
    height: 2px;
    background: var(--color-navy);
    transition: all 0.3s ease;
}

header:not(.scrolled) .menu-toggle span {
    background: var(--color-white);
}

@media (max-width: 992px) {
    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        height: 100dvh; /* Use dynamic viewport height for mobile browsers */
        background: var(--color-white);
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 50px; /* Increased for better touch targets */
        padding: 0;
        margin: 0;
        transition: 0.5s cubic-bezier(0.165, 0.84, 0.44, 1);
        box-shadow: -10px 0 30px rgba(0,0,0,0.1);
        z-index: 1000;
    }

    .nav-links.active {
        right: 0;
    }

    .nav-links li a {
        color: var(--color-navy) !important;
        font-size: 1.5rem;
        text-shadow: none !important;
    }

    .menu-toggle {
        display: flex;
    }

    .menu-toggle.active span:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
        background: var(--color-navy) !important;
    }
    .menu-toggle.active span:nth-child(2) {
        opacity: 0;
    }
    .menu-toggle.active span:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
        background: var(--color-navy) !important;
    }

    header nav .btn-primary {
        display: none;
    }

    /* Mobile Logo refinement */
    .logo-container {
        padding: 6px 12px;
    }
    .logo-mark {
        width: 38px;
    }
    .logo-text {
        font-size: 1.2rem;
    }
}

/* Global Overflow Fix */
html, body {
    overflow-x: hidden;
    width: 100%;
    position: relative;
}

img {
    max-width: 100%;
    height: auto;
}

@media (max-width: 992px) {
    /* Existing mobile nav styles... */
}

@media (max-width: 768px) {
    .hero { min-height: 60vh; padding: 40px 0; }
    .hero-content { padding-top: 60px; }
    .hero-content h1, h1 { font-size: 3.2rem !important; line-height: 1.1; margin-bottom: 20px; }
    h2 { font-size: 2.4rem !important; margin-bottom: 20px !important; }
    p { font-size: 0.95rem; }
    
    .container { 
        padding: 0 20px; 
        width: 100%;
        overflow: hidden; /* Prevent children from leaking out */
    }

    /* Universal Grid Stacking - Robust Fix */
    section div[style*="display: grid"],
    section .gallery-grid,
    section .services-grid {
        grid-template-columns: 1fr !important;
        gap: 30px !important;
        width: 100% !important;
    }

    /* Reduce huge section padding on mobile */
    section[style*="padding: 120px 0"] {
        padding: 80px 0 !important;
    }
    section[style*="padding: 100px 0"] {
        padding: 60px 0 !important;
    }
    
    /* Partner logos optimization */
    div[style*="flex-wrap: wrap"] img {
        height: auto !important;
        width: 120px !important;
        max-width: 40% !important;
    }

    .services-bar { margin-top: 0; padding: 40px 0; }
    .services-grid { background: none; box-shadow: none; padding: 0; }
    .service-card { 
        border-bottom: 1px solid rgba(0,0,0,0.05); 
        padding: 30px 0;
        width: 100%;
    }

    .feature-list { 
        flex-direction: column; 
        gap: 20px; 
        align-items: flex-start; 
        text-align: left;
        width: 100%;
    }

    /* Fix About page overlapping boxes */
    #about [style*="margin-top: -60px"] {
        margin-top: 0 !important;
        margin-left: 0 !important;
        padding: 40px 20px !important;
        width: 100% !important;
        box-sizing: border-box;
    }

    /* Ensure forms don't overflow */
    #contact form {
        padding: 30px 20px !important;
        width: 100% !important;
        box-sizing: border-box;
    }

    #contact input, #contact select, #contact textarea {
        width: 100% !important;
        box-sizing: border-box;
    }

    #contact [style*="display: grid"] {
        grid-template-columns: 1fr !important;
    }

    footer .container > div:first-child {
        flex-direction: column !important;
        gap: 40px !important;
        align-items: flex-start !important;
    }
    footer .container > div:first-child > div:last-child {
        flex-direction: column !important;
        gap: 30px !important;
    }
    footer .container > div:last-child {
        flex-direction: column !important;
        gap: 20px !important;
        align-items: center !important;
    }
    
    .logo-text {
        font-size: 1.2rem;
    }
}


/* Toast Animations */
@keyframes slideDown {
    from {
        transform: translate(-50%, -20px);
        opacity: 0;
    }
    to {
        transform: translate(-50%, 0);
        opacity: 1;
    }
}
