:root {
    --mexican-green: #006847;
    --mexican-green-light: #00a868;
    --mexican-white: #ffffff;
    --mexican-red: #ce1126;
    --dark-bg: #1a1a1a;
    --light-bg: #f4f4f4;
    --text-primary: #333333;
    --text-light: #ffffff;
    --accent-red: #ff4d4d;
    --transition-speed: 0.3s;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    cursor: none;
}

h1, h2, h3 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* ============================================================
   Custom Cursor
   ============================================================ */
#cursor-dot {
    width: 8px;
    height: 8px;
    background: var(--mexican-green);
    border-radius: 50%;
    position: fixed;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
    transition: width 0.2s, height 0.2s, background 0.2s;
}

#cursor-ring {
    width: 36px;
    height: 36px;
    border: 2px solid rgba(0, 104, 71, 0.7);
    border-radius: 50%;
    position: fixed;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 9998;
    transform: translate(-50%, -50%);
    transition: width 0.3s, height 0.3s, border-color 0.3s;
}

body.cursor-hover #cursor-dot {
    width: 14px;
    height: 14px;
    background: var(--mexican-red);
}

body.cursor-hover #cursor-ring {
    width: 52px;
    height: 52px;
    border-color: rgba(206, 17, 38, 0.5);
}

@media (hover: none) {
    #cursor-dot, #cursor-ring { display: none; }
    body { cursor: auto; }
}

/* ============================================================
   Scroll Progress Bar
   ============================================================ */
#scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    width: 0%;
    background: linear-gradient(90deg, var(--mexican-green), var(--mexican-red));
    z-index: 10000;
    pointer-events: none;
}

/* ============================================================
   Header & Nav
   ============================================================ */
header {
    background: var(--dark-bg);
    padding: 1.5rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: background 0.4s ease, backdrop-filter 0.4s ease, border-bottom 0.4s ease;
    border-bottom: 1px solid transparent;
}

header.scrolled {
    background: rgba(26, 26, 26, 0.75);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(0, 104, 71, 0.3);
}

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

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -1px;
    white-space: nowrap;
}

.logo .green { color: var(--mexican-green); }
.logo .white { color: var(--mexican-white); }

.nav-links {
    list-style: none;
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-light);
    font-weight: 600;
    font-size: 0.9rem;
    transition: color var(--transition-speed);
}

.nav-links a:hover { color: var(--mexican-green); }

.cta-button-small {
    background: var(--mexican-green);
    padding: 0.5rem 1.2rem;
    border-radius: 4px;
    color: white !important;
}

.cta-button-small:hover {
    background: var(--mexican-red) !important;
}

/* ============================================================
   Hamburger Button
   ============================================================ */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    background: transparent;
    border: 1px solid rgba(0, 104, 71, 0.4);
    border-radius: 4px;
    cursor: pointer;
    padding: 0;
    z-index: 1200;
    position: relative;
    transition: border-color 0.3s;
}
.hamburger:hover { border-color: var(--mexican-green); }
.hamburger:focus-visible { outline: 2px solid var(--mexican-green); outline-offset: 3px; }

.ham-bar {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--mexican-white);
    border-radius: 2px;
    transform-origin: center;
}

/* ============================================================
   Mobile Nav Overlay
   ============================================================ */
.mobile-nav-overlay {
    position: fixed;
    inset: 0;
    z-index: 1100;
    display: none;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    padding: 6rem 3rem 4rem;
    background: rgba(10, 10, 10, 0.97);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
}
.mobile-nav-overlay.is-open {
    display: flex;
}

.mno-flag-bars {
    position: absolute; top: 0; right: 0; bottom: 0; width: 18%;
    display: flex; pointer-events: none;
}
.mno-flag-bar { flex: 1; }
.mno-flag-bar--green { background: var(--mexican-green); opacity: 0.18; }
.mno-flag-bar--white { background: var(--mexican-white); opacity: 0.05; }
.mno-flag-bar--red   { background: var(--mexican-red);   opacity: 0.18; }

.mno-grid {
    position: absolute; inset: 0; pointer-events: none;
    background-image:
        linear-gradient(rgba(0, 104, 71, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 104, 71, 0.03) 1px, transparent 1px);
    background-size: 36px 36px;
}

.mno-close {
    position: absolute; top: 1.5rem; right: 1.5rem;
    width: 44px; height: 44px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 1.6rem; line-height: 1;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: border-color 0.3s, color 0.3s;
    opacity: 0;
}
.mno-close:hover { border-color: var(--mexican-red); color: var(--mexican-red); }
.mno-close:focus-visible { outline: 2px solid var(--mexican-green); outline-offset: 3px; }

.mno-nav { width: 100%; max-width: 82%; }
.mno-links { list-style: none; padding: 0; margin: 0; }
.mno-item {
    overflow: hidden;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.mno-item:first-child { border-top: 1px solid rgba(255, 255, 255, 0.05); }
.mno-link {
    display: block;
    padding: 1.1rem 0;
    font-family: 'Montserrat', sans-serif;
    font-weight: 900;
    font-size: clamp(1.6rem, 5vw, 2.8rem);
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    letter-spacing: -0.5px;
    transition: color 0.25s, padding-left 0.25s;
    transform: translateY(100%);
}
.mno-link:hover { color: var(--mexican-green); padding-left: 0.5rem; }
.mno-link.active { color: var(--mexican-green); }
.mno-link--cta {
    color: var(--mexican-green) !important;
    font-size: clamp(1rem, 3vw, 1.25rem) !important;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-top: 1.5rem;
}
.mno-item:has(.mno-link--cta) { border-bottom: none; }

.mno-tagline {
    position: absolute; bottom: 2rem; left: 3rem;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.75rem; font-weight: 700;
    letter-spacing: 3px; text-transform: uppercase;
    opacity: 0;
}
.mno-tagline-green { color: var(--mexican-green); }
.mno-tagline-white { color: rgba(255, 255, 255, 0.25); }

@media (max-width: 992px) {
    .hamburger { display: flex; }
}

/* ============================================================
   Hero Section
   ============================================================ */
.hero {
    position: relative;
    padding: 10rem 0;
    background: linear-gradient(135deg, #0d0d0d 0%, #000 100%);
    color: white;
    overflow: hidden;
    min-height: 100vh;
    display: flex;
    align-items: center;
}

#hero-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
}

.hero-eyebrow {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: var(--mexican-green);
    margin-bottom: 1.5rem;
    font-weight: 600;
}

.hero h1 {
    font-size: 5.5rem;
    line-height: 1.05;
    margin-bottom: 2rem;
    letter-spacing: -3px;
    font-weight: 900;
}

.highlight {
    background: linear-gradient(135deg, var(--mexican-green) 0%, var(--mexican-green-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Glitch animation for the highlight span */
@keyframes glitch {
    0%, 90%, 100% { filter: none; }
    91% { filter: blur(0.5px); transform: skewX(-2deg); }
    92% { filter: blur(0); transform: skewX(1deg); }
    93% { filter: blur(0.5px); transform: skewX(-1deg); }
    94% { filter: blur(0); transform: skewX(0); }
}
.highlight { animation: glitch 6s infinite; }

.hero p {
    font-size: 1.25rem;
    max-width: 560px;
    margin-bottom: 3rem;
    color: #aaaaaa;
    line-height: 1.8;
}

.hero-actions {
    display: flex;
    gap: 1.5rem;
}

.cta-button {
    text-decoration: none;
    padding: 1rem 2.5rem;
    font-weight: 700;
    font-size: 1rem;
    border-radius: 4px;
    transition: background var(--transition-speed), color var(--transition-speed), box-shadow var(--transition-speed);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    display: inline-block;
    will-change: transform;
}

.cta-button.primary {
    background: var(--mexican-green);
    color: white;
}

.cta-button.primary:hover {
    background: var(--mexican-red);
    box-shadow: 0 12px 30px rgba(206, 17, 38, 0.4);
}

.cta-button.secondary {
    border: 2px solid rgba(255, 255, 255, 0.5);
    color: white;
}

.cta-button.secondary:hover {
    background: white;
    color: black;
    border-color: white;
}

.hero-decoration {
    position: absolute;
    top: 0;
    right: -10%;
    height: 100%;
    width: 40%;
    transform: skewX(-20deg);
    display: flex;
}

.stripe { flex: 1; }
.green-stripe { background: var(--mexican-green); opacity: 0.25; }
.white-stripe { background: var(--mexican-white); opacity: 0.07; }
.red-stripe   { background: var(--mexican-red);   opacity: 0.25; }

/* ============================================================
   General Section Styles
   ============================================================ */
section {
    padding: 8rem 0;
}

.section-title {
    font-size: 2.5rem;
    margin-bottom: 2.5rem;
    position: relative;
}

.red-line {
    display: block;
    width: 50px;
    height: 4px;
    background: var(--mexican-red);
    margin-bottom: 1rem;
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
}

/* ============================================================
   Vision Section
   ============================================================ */
.vision-section {
    background: white;
}

.stats {
    list-style: none;
    margin-top: 2rem;
    display: flex;
    gap: 2rem;
}

.stats strong {
    display: block;
    font-size: 2rem;
    color: var(--mexican-green);
    font-family: 'Montserrat', sans-serif;
}

.vision-graphic {
    background: var(--light-bg);
    padding: 4rem;
    border-left: 10px solid var(--mexican-green);
    border-bottom: 10px solid var(--mexican-red);
}

.tech-card { text-align: center; }

.tech-card .icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 1rem;
}

/* ============================================================
   Capabilities Section
   ============================================================ */
.capabilities-section.dark {
    background: var(--dark-bg);
    color: white;
    background-image:
        linear-gradient(rgba(0,104,71,0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0,104,71,0.04) 1px, transparent 1px);
    background-size: 40px 40px;
}

.center { text-align: center; }

.capability-card {
    background: rgba(255, 255, 255, 0.04);
    padding: 2.5rem 2rem;
    border-top: 4px solid var(--mexican-green);
    transition: background var(--transition-speed), box-shadow var(--transition-speed);
    transform-style: preserve-3d;
    will-change: transform;
    position: relative;
    overflow: hidden;
}

.capability-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: radial-gradient(circle at var(--mx, 50%) var(--my, 50%), rgba(0,104,71,0.12), transparent 60%);
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

.capability-card:hover::before {
    opacity: 1;
}

.capability-card:hover {
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.capability-icon {
    font-size: 2.2rem;
    color: var(--mexican-green);
    margin-bottom: 1.2rem;
    display: block;
}

.capability-card h3 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
    color: var(--mexican-green);
}

/* ============================================================
   Marquee Strip
   ============================================================ */
.marquee-section {
    background: #000;
    padding: 1.4rem 0;
    overflow: hidden;
    border-top: 1px solid rgba(0, 104, 71, 0.5);
    border-bottom: 1px solid rgba(0, 104, 71, 0.5);
}

.marquee-track {
    display: flex;
    gap: 3rem;
    white-space: nowrap;
    animation: marquee 28s linear infinite;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 0.8rem;
    font-weight: 600;
    align-items: center;
    width: max-content;
}

.marquee-track .accent { color: var(--mexican-green); }
.marquee-track .dot    { color: var(--mexican-red); font-size: 0.6rem; }

@keyframes marquee {
    from { transform: translateX(0); }
    to   { transform: translateX(-50%); }
}

/* ============================================================
   Heritage Section
   ============================================================ */
.heritage-section {
    background: var(--light-bg);
}

.mexican-flag-accent {
    height: 400px;
    width: 100%;
    background: linear-gradient(to right,
        var(--mexican-green) 33.33%,
        var(--mexican-white) 33.33%,
        var(--mexican-white) 66.66%,
        var(--mexican-red) 66.66%
    );
    border: 1px solid #ddd;
    box-shadow: 20px 20px 0px var(--dark-bg);
}

/* ============================================================
   Contact Section
   ============================================================ */
.contact-section {
    background: radial-gradient(ellipse at center, #111 0%, #0a0a0a 100%);
    color: white;
    position: relative;
    overflow: hidden;
}

.contact-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 600px;
    height: 300px;
    background: radial-gradient(ellipse, rgba(0, 104, 71, 0.2) 0%, transparent 70%);
    pointer-events: none;
}

.contact-manifesto {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.35);
    letter-spacing: 1px;
    margin-bottom: 1.5rem;
    font-style: italic;
}

.contact-section h2 {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
    color: white;
    letter-spacing: -1px;
}

.contact-section > .container > p {
    color: #888;
    font-size: 1.1rem;
}

.large-green {
    background: var(--mexican-green);
    color: white;
    display: inline-block;
    margin-top: 2rem;
    box-shadow: 0 0 40px rgba(0, 104, 71, 0.4);
}

.large-green:hover {
    background: var(--mexican-red);
    box-shadow: 0 0 40px rgba(206, 17, 38, 0.4);
}

/* ============================================================
   Footer
   ============================================================ */
footer {
    background: #000;
    color: #666;
    padding: 4rem 0;
    border-top: 1px solid #1a1a1a;
}

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

.footer-links a {
    color: #666;
    margin-left: 1.5rem;
    text-decoration: none;
    font-size: 0.9rem;
}

/* ============================================================
   JS Animation Initial States
   Scroll-triggered elements start hidden; page-load elements
   (logo, nav, hero) are reset by anime.set() in main.js.
   ============================================================ */
.vision-text .red-line               { width: 0; }
.vision-text h2                      { opacity: 0; transform: translateX(-40px); }
.vision-text p                       { opacity: 0; }
.stats li                            { opacity: 0; transform: translateY(20px); }
.vision-graphic                      { opacity: 0; transform: scale(0.85); }
.capabilities-section .section-title { opacity: 0; transform: scale(0.9); }
.capability-card                     { opacity: 0; transform: translateY(60px); }
.heritage-text h2                    { opacity: 0; transform: translateX(40px); }
.heritage-text p                     { opacity: 0; transform: translateX(40px); }
.mexican-flag-accent                 { clip-path: inset(0 100% 0 0); }
.contact-section h2                  { opacity: 0; transform: scale(0.8); }
.contact-section .container > p      { opacity: 0; }
.contact-manifesto                   { opacity: 0; }
.cta-button.large-green              { opacity: 0; transform: scale(0.5); }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 1100px) {
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 992px) {
    .grid-2 {
        grid-template-columns: 1fr;
    }

    .hero {
        min-height: auto;
        padding: 8rem 0 6rem;
    }

    .hero h1 {
        font-size: 3.2rem;
        letter-spacing: -1px;
    }

    .hero-decoration {
        display: none;
    }

    .nav-links {
        display: none;
    }

    #cursor-dot, #cursor-ring {
        display: none;
    }

    body { cursor: auto; }
}

@media (max-width: 600px) {
    .grid-4 {
        grid-template-columns: 1fr;
    }

    .hero h1 {
        font-size: 2.6rem;
    }

    .contact-section h2 {
        font-size: 2.5rem;
    }
}

/* ============================================================
   Particle Engine — cursor trail + ambient section particles
   ============================================================ */

.cursor-trail-particle {
    position: fixed;
    pointer-events: none;
    border-radius: 50%;
    z-index: 9997;
    transform: translate(-50%, -50%);
    will-change: transform, opacity;
    opacity: 0;
}

.ambient-layer {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 0;
}

.ambient-particle {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    will-change: transform, opacity;
    opacity: 0;
}

@keyframes ambient-float {
    0%   { transform: translateY(0) scale(1);   opacity: 0; }
    15%  { opacity: var(--ap-alpha, 0.18); }
    85%  { opacity: var(--ap-alpha, 0.18); }
    100% { transform: translateY(-110vh) scale(0.5); opacity: 0; }
}

/* ============================================================
   Contact Universe Canvas
   ============================================================ */
#contact-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.contact-section > .container {
    position: relative;
    z-index: 1;
}
