/* Base Styles & Overrides */
html {
    scroll-behavior: smooth;
    cursor: none; /* Custom cursor */
}

body {
    overflow-x: hidden;
    /* Safe areas for mobile */
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
}

/* Accessibility Focus States */
*:focus-visible {
    outline: 2px solid #154212;
    outline-offset: 4px;
}

/* Custom Cursor */
.cursor-dot,
.cursor-outline {
    position: fixed;
    top: 0;
    left: 0;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    z-index: 9999;
    pointer-events: none;
    transition: width 0.3s, height 0.3s, background-color 0.3s;
}

.cursor-dot {
    width: 8px;
    height: 8px;
    background-color: #154212; /* Primary */
}

.cursor-outline {
    width: 40px;
    height: 40px;
    border: 1px solid rgba(21, 66, 18, 0.5);
    transition: transform 0.1s ease-out, width 0.3s, height 0.3s, background-color 0.3s;
}

/* Cursor Hover States */
.cursor-hover .cursor-dot {
    width: 0;
    height: 0;
}

.cursor-hover .cursor-outline {
    width: 60px;
    height: 60px;
    background-color: rgba(21, 66, 18, 0.1);
    backdrop-filter: blur(2px);
    border-color: transparent;
}

/* Grain Overlay for Texture */
.grain-overlay {
    position: fixed;
    top: -50%;
    left: -50%;
    right: -50%;
    bottom: -50%;
    width: 200%;
    height: 200%;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.05'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 9998;
    animation: grain 8s steps(10) infinite;
}

@keyframes grain {
    0%, 100% { transform: translate(0, 0); }
    10% { transform: translate(-5%, -10%); }
    20% { transform: translate(-15%, 5%); }
    30% { transform: translate(7%, -25%); }
    40% { transform: translate(-5%, 25%); }
    50% { transform: translate(-15%, 10%); }
    60% { transform: translate(15%, 0%); }
    70% { transform: translate(0%, 15%); }
    80% { transform: translate(3%, 35%); }
    90% { transform: translate(-10%, 10%); }
}

/* Glassmorphism Navbar */
.nav-glass {
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.05);
}

.nav-glass.scrolled {
    background: rgba(252, 249, 248, 0.9);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(114, 121, 110, 0.15);
    height: 70px;
}

/* Nav Links Underline Effect */
.nav-link {
    position: relative;
    padding-bottom: 4px;
}
.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 1px;
    bottom: 0;
    left: 0;
    background-color: currentColor;
    transition: width 0.3s ease;
}
.nav-link:hover::after, .nav-link.active::after {
    width: 100%;
}

/* Button Animations */
.btn-primary {
    background-color: #154212;
    color: #fff;
    position: relative;
    overflow: hidden;
    z-index: 1;
    transition: color 0.4s ease;
}
.btn-primary::before {
    content: '';
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #23501e; /* darker primary variant */
    transition: transform 0.4s cubic-bezier(0.7, 0, 0.3, 1);
    z-index: -1;
}
.btn-primary:hover::before {
    transform: translateY(-100%);
}

.btn-outline {
    position: relative;
    border: 1px solid rgba(21, 66, 18, 0.2);
    overflow: hidden;
    z-index: 1;
    transition: color 0.4s ease, border-color 0.4s ease;
}
.btn-outline::before {
    content: '';
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(21, 66, 18, 0.05);
    transition: transform 0.4s cubic-bezier(0.7, 0, 0.3, 1);
    z-index: -1;
}
.btn-outline:hover {
    border-color: rgba(21, 66, 18, 0.5);
}
.btn-outline:hover::before {
    transform: translateY(-100%);
}

/* Scroll Animations */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: all 0.8s cubic-bezier(0.5, 0, 0, 1);
}

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

.stagger-1 {
    transition-delay: 0.2s;
}

.image-reveal {
    clip-path: inset(100% 0 0 0);
    transition: clip-path 1.2s cubic-bezier(0.7, 0, 0.3, 1);
}
.reveal.active .image-reveal {
    clip-path: inset(0 0 0 0);
}

/* Text Animations */
.animate-text-reveal {
    background: linear-gradient(to right, #154212 50%, transparent 50%);
    background-size: 200% 100%;
    background-position: 100% 0;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    transition: background-position 1.5s cubic-bezier(0.2, 1, 0.3, 1);
}
.reveal.active .animate-text-reveal {
    background-position: 0 0;
}

/* Callout Box Animation */
.line-grow {
    height: 0;
    transition: height 1s ease-out 0.3s;
}
.reveal.active .line-grow {
    height: 4rem; /* h-16 equivalent */
}

/* Badge Hover effect */
.badge-hover {
    transition: all 0.3s ease;
}
.badge-hover:hover {
    background-color: rgba(21, 66, 18, 0.05);
    transform: translateY(-2px);
}

/* General transitions */
.scale-transition {
    transition: transform 0.3s ease;
    display: inline-block;
}
.scale-transition:hover {
    transform: scale(1.05);
}

/* Media Query for Touch Devices (Disable custom cursor) */
@media (hover: none) and (pointer: coarse) {
    .cursor-dot, .cursor-outline {
        display: none;
    }
    html {
        cursor: auto;
    }
}

/* Scroll Sequence Hero Section */
.scroll-sequence-container {
    height: 300vh; /* scroll height */
    position: relative;
    width: 100%;
}

.canvas-container {
    position: sticky;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    height: 100svh; /* Modern Viewport Unit for mobile browser UI handling */
    overflow: hidden;
    background-color: #000;
}

#hero-canvas {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Subtle dark-green horizontal gradient behind left-side copy */
    background: linear-gradient(90deg, rgba(21, 66, 18, 0.85) 0%, rgba(21, 66, 18, 0.4) 40%, transparent 60%);
    display: flex;
    align-items: center;
    z-index: 10;
    pointer-events: none;
}

.hero-content {
    /* 8-10% from the left edge */
    padding-left: 8vw;
    /* Slightly above vertical center */
    transform: translateY(-5%);
    max-width: 600px;
    width: 100%;
    flex-shrink: 0;
    pointer-events: auto; /* Re-enable for the CTA */
    /* Ensure elements start invisible for GSAP */
    opacity: 0;
}

.hero-headline {
    /* Prevent italic swashes from being clipped by bounding boxes */
    padding-right: 0.2em;
}

@media (max-width: 768px) {
    .hero-content {
        padding-left: 5vw;
        padding-right: 5vw;
        /* On mobile, place copy higher up */
        transform: translateY(-20%);
        background: linear-gradient(180deg, rgba(21, 66, 18, 0.8) 0%, transparent 100%);
        margin-top: -10vh; /* Adjust as needed */
        padding-top: 40px;
    }
    .hero-overlay {
        background: none;
        align-items: flex-start;
        padding-top: 20vh;
    }
}

.animate-bounce-restrained {
    animation: bounce-restrained 2s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

@keyframes bounce-restrained {
    0%, 100% {
        transform: translateY(-10%);
        animation-timing-function: cubic-bezier(0.8, 0, 1, 1);
    }
    50% {
        transform: translateY(15%);
        animation-timing-function: cubic-bezier(0, 0, 0.2, 1);
    }
}

@media (prefers-reduced-motion: reduce) {
    .animate-bounce-restrained {
        animation: none;
    }
}
