/* ==========================================================================
   AGRONIX - IDENTIDAD VISUAL PREMIUM & AGRICULTURA INTELIGENTE
   ========================================================================== */

:root {
    /* Paleta extraída del Logo (Agricultura Tecnológica) */
    --color-primary: #27a321;      /* Verde vibrante hoja */
    --color-primary-dark: #1e8519; /* Verde oscuro intermedio */
    --color-slate-dark: #112d22;   /* Verde pizarra/oscuro corporativo */
    --color-slate-darker: #0a1c15; /* Fondo ultra oscuro para contraste */
    --color-accent: #5cdb3b;       /* Verde claro digital (píxeles) */
    
    /* Neutros y Superficies */
    --color-bg-light: #f4f7f6;
    --color-surface: #ffffff;
    --color-text-main: #1c2621;
    --color-text-muted: #5b6b64;
    --color-border: #e2e8e5;
    
    /* Efectos Glassmorphism */
    --glass-bg: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(255, 255, 255, 0.4);
    --glass-shadow: 0 8px 32px rgba(17, 45, 34, 0.06);
    
    /* Sombras Profesionales */
    --shadow-sm: 0 2px 8px rgba(17, 45, 34, 0.04);
    --shadow-md: 0 8px 24px rgba(17, 45, 34, 0.08);
    --shadow-hover: 0 16px 40px rgba(39, 163, 33, 0.12);
    
    /* Tipografía */
    --font-main: 'Inter', system-ui, -apple-system, sans-serif;
    
    /* Transiciones */
    --transition-smooth: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* ==========================================================================
   RESET & BASE
   ========================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-main);
    color: var(--color-text-main);
    background-color: var(--color-bg-light);
    line-height: 1.6;
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

/* ==========================================================================
   TYPOGRAPHY & UTILITIES
   ========================================================================== */
.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--color-slate-dark);
    text-align: center;
    margin-bottom: 0.5rem;
    position: relative;
}

.section-subtitle {
    text-align: center;
    color: var(--color-text-muted);
    font-size: 1.1rem;
    margin-bottom: 3rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    border-radius: 16px;
    transition: var(--transition-smooth);
}

/* ==========================================================================
   ANIMACIONES DE REVEAL (JS CONTROLLED)
   ========================================================================== */
.reveal-hidden {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.reveal-visible {
    opacity: 1;
    transform: translateY(0);
}

/* ==========================================================================
   BOTONES
   ========================================================================== */
.btn-primary, .btn-secondary {
    padding: 0.875rem 1.75rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition-smooth);
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-primary {
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(39, 163, 33, 0.2);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(39, 163, 33, 0.3);
    background: linear-gradient(135deg, var(--color-accent), var(--color-primary));
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--color-surface);
    border: 1px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(4px);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

/* ==========================================================================
   BACKGROUND ANIMADO (Nodos Tecnológicos del Logo)
   ========================================================================== */
.corn-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
    overflow: hidden;
}

.corn-bg span {
    position: absolute;
    bottom: -5vh;
    width: 10px;
    height: 10px;
    background-color: var(--color-primary);
    opacity: 0.08;
    border-radius: 2px;
    animation: floatUp 15s linear infinite;
}

@keyframes floatUp {
    0% {
        transform: translateY(0) rotate(0deg) scale(1);
        opacity: 0;
    }
    10% { opacity: 0.15; }
    90% { opacity: 0.15; }
    100% {
        transform: translateY(-110vh) rotate(360deg) scale(0.5);
        opacity: 0;
    }
}

/* ==========================================================================
   HEADER & NAVBAR
   ========================================================================== */
.header {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    padding: 1rem 0;
    transition: var(--transition-smooth);
}

.header.scrolled {
    padding: 0.5rem 0;
}

.header.scrolled .nav-container {
    box-shadow: var(--shadow-md);
    background: rgba(255, 255, 255, 0.95);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.75rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 12px;
    transition: var(--transition-smooth);
    background: rgba(255, 255, 255, 0.7);
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo img {
    height: 40px;
    width: auto;
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--color-slate-dark);
    letter-spacing: -0.5px;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 2.5rem;
}

.nav-menu li a {
    font-weight: 500;
    color: var(--color-slate-dark);
    font-size: 0.95rem;
    transition: color 0.3s ease;
    position: relative;
}

.nav-menu li a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -4px;
    left: 0;
    background-color: var(--color-primary);
    transition: width 0.3s ease;
}

.nav-menu li a:hover::after {
    width: 100%;
}

.nav-menu li a:hover {
    color: var(--color-primary);
}

.btn-nav-login {
    background-color: var(--color-slate-dark);
    color: white !important;
    padding: 0.5rem 1.25rem;
    border-radius: 6px;
}

.btn-nav-login::after {
    display: none;
}

.btn-nav-login:hover {
    background-color: var(--color-primary);
}

/* Menú Móvil */
.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 21px;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 1001;
}

.menu-toggle span {
    display: block;
    width: 100%;
    height: 3px;
    background-color: var(--color-slate-dark);
    border-radius: 3px;
    transition: var(--transition-smooth);
}

.menu-toggle.open span:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
}
.menu-toggle.open span:nth-child(2) {
    opacity: 0;
}
.menu-toggle.open span:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
}

/* ==========================================================================
   HERO SECTION
   ========================================================================== */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: 80px;
    background: var(--color-slate-darker);
    overflow: hidden;
}

/* Efecto de fondo elegante y corporativo */
.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 70% 50%, rgba(39, 163, 33, 0.08) 0%, rgba(10, 28, 21, 1) 70%);
    z-index: 1;
}

.hero-container {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.badge-tech {
    display: inline-block;
    padding: 0.4rem 1rem;
    background: rgba(39, 163, 33, 0.15);
    color: var(--color-accent);
    border: 1px solid rgba(39, 163, 33, 0.3);
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Rediseño limpio del .glitch */
.glitch {
    font-size: 3.5rem;
    font-weight: 800;
    color: var(--color-surface);
    line-height: 1.1;
    margin-bottom: 1.5rem;
    position: relative;
}

/* Efecto visual sofisticado en lugar de estilo cyberpunk */
.glitch::after {
    content: attr(data-text);
    position: absolute;
    left: 2px;
    top: 0;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.hero:hover .glitch::after {
    opacity: 1;
}

.hero-subtitle {
    font-size: 1.125rem;
    color: #a0b3ab;
    margin-bottom: 2.5rem;
    max-width: 90%;
}

.cta-buttons {
    display: flex;
    gap: 1rem;
}

/* Animación Visual Dron/Sensor */
.hero-visual {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    height: 400px;
}

.drone-scanner {
    position: relative;
    width: 300px;
    height: 300px;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* === NUEVO: Imagen de fondo del escáner (Cultivo de Maíz) === */
.scanner-bg-image {
    position: absolute;
    width: 96%;
    height: 96%;
    object-fit: cover;
    border-radius: 50%;
    z-index: 0;
    opacity: 0.8;
    /* Ligero filtro para integrarlo con la iluminación tecnológica */
    filter: sepia(10%) contrast(110%) brightness(0.9);
}

.shield-layer {
    position: absolute;
    border-radius: 50%;
    z-index: 1; /* Por encima de la imagen */
}

.ring-outer {
    width: 100%;
    height: 100%;
    border: 2px dashed rgba(92, 219, 59, 0.8);
    animation: rotateSlow 20s linear infinite;
}

.ring-inner {
    width: 70%;
    height: 70%;
    border: 1px solid rgba(39, 163, 33, 0.8);
    background: radial-gradient(circle, rgba(39, 163, 33, 0.2) 0%, transparent 70%);
    animation: pulse 4s ease-in-out infinite;
}

.crosshair {
    width: 120%;
    height: 120%;
    background: 
        linear-gradient(to right, transparent 49.5%, rgba(92, 219, 59, 0.6) 49.5%, rgba(92, 219, 59, 0.6) 50.5%, transparent 50.5%),
        linear-gradient(to bottom, transparent 49.5%, rgba(92, 219, 59, 0.6) 49.5%, rgba(92, 219, 59, 0.6) 50.5%, transparent 50.5%);
    z-index: 1;
}

.scan-line {
    position: absolute;
    width: 100%;
    height: 4px;
    background: var(--color-accent);
    box-shadow: 0 0 15px var(--color-accent);
    top: 0;
    z-index: 2; /* Por encima de todo */
    animation: scanVertical 3s ease-in-out infinite;
}

@keyframes rotateSlow {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes pulse {
    0% { transform: scale(0.95); opacity: 0.5; }
    50% { transform: scale(1.05); opacity: 1; }
    100% { transform: scale(0.95); opacity: 0.5; }
}

@keyframes scanVertical {
    0% { top: 10%; opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { top: 90%; opacity: 0; }
}

/* ==========================================================================
   STATS SECTION
   ========================================================================== */
.stats {
    margin-top: -60px;
    position: relative;
    z-index: 10;
    padding: 0 1rem;
}

.stats-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
}

.stat-item {
    padding: 2rem 1.5rem;
    text-align: center;
    background: rgba(255, 255, 255, 0.9);
}

.stat-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.stat-number {
    font-size: 3rem;
    font-weight: 800;
    color: var(--color-primary);
    margin-bottom: 0.5rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
}

.stat-number::after {
    content: '+';
    font-size: 2rem;
    color: var(--color-slate-dark);
    margin-left: 2px;
}

.stat-item p {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--color-text-muted);
}

/* ==========================================================================
   THREATS / PARÁMETROS (Amenazas)
   ========================================================================== */
.threats {
    padding: 6rem 0;
    background-color: var(--color-bg-light);
}

.threats-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
}

.threat-item {
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    border: 1px solid transparent;
}

.threat-item:hover {
    border-color: rgba(39, 163, 33, 0.2);
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.threat-icon {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    border-radius: 14px;
    background: rgba(39, 163, 33, 0.1);
    margin-bottom: 0.5rem;
}

.threat-item h3 {
    font-size: 1.25rem;
    color: var(--color-slate-dark);
}

.threat-item p {
    color: var(--color-text-muted);
    font-size: 0.95rem;
}

/* ==========================================================================
   SERVICIOS
   ========================================================================== */
.services {
    padding: 6rem 0;
    background: var(--color-surface);
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
}

.service-card {
    padding: 2.5rem 1.5rem;
    text-align: center;
    border-radius: 16px;
    background: var(--color-bg-light);
    border: 1px solid var(--color-border);
    transition: var(--transition-smooth);
}

.service-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-md);
    border-color: var(--color-primary);
    background: var(--color-surface);
}

.service-icon {
    width: 70px;
    height: 70px;
    margin: 0 auto 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(39, 163, 33, 0.05);
    color: var(--color-primary);
    transition: var(--transition-smooth);
}

.service-card:hover .service-icon {
    background: var(--color-primary);
    color: var(--color-surface);
}

.service-card h3 {
    font-size: 1.15rem;
    color: var(--color-slate-dark);
    margin-bottom: 1rem;
}

.service-card p {
    font-size: 0.9rem;
    color: var(--color-text-muted);
}

/* ==========================================================================
   CONTACTO
   ========================================================================== */
.contact {
    padding: 6rem 0;
    background-color: var(--color-bg-light);
    position: relative;
}

.contact-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    padding: 4rem;
    background: var(--color-surface);
}

.contact-info h2 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--color-slate-dark);
    margin-bottom: 1rem;
}

.contact-info h3 {
    font-size: 1.2rem;
    color: var(--color-primary);
    margin-bottom: 1rem;
}

.contact-info p {
    color: var(--color-text-muted);
    margin-bottom: 2rem;
}

.contact-details {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.contact-detail-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-weight: 500;
    color: var(--color-slate-dark);
}

.detail-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(39, 163, 33, 0.1);
    color: var(--color-primary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 1rem 1.25rem;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: var(--color-bg-light);
    font-family: var(--font-main);
    font-size: 0.95rem;
    color: var(--color-text-main);
    transition: var(--transition-smooth);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 4px rgba(39, 163, 33, 0.1);
    background: var(--color-surface);
}

.btn-submit {
    width: 100%;
    padding: 1rem;
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.footer {
    background: var(--color-slate-darker);
    color: #a0b3ab;
    padding: 4rem 0 2rem;
    text-align: center;
}

.footer-container {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.footer-logo-img {
    height: 32px;
    filter: brightness(0) invert(1);
}

.footer-logo .logo-text {
    color: var(--color-surface);
    font-size: 1.25rem;
}

.footer-tagline {
    font-size: 0.95rem;
    margin-bottom: 2rem;
}

.footer-divider {
    width: 100%;
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin-bottom: 2rem;
}

.footer-copyright {
    font-size: 0.85rem;
}

/* ==========================================================================
   RESPONSIVE DESIGN
   ========================================================================== */
@media (max-width: 1024px) {
    .stats-container {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .hero-container {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 2rem;
    }

    .hero-content {
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    
    .hero-subtitle {
        margin-left: auto;
        margin-right: auto;
    }

    .glitch {
        font-size: 2.5rem;
    }

    .threats-container {
        grid-template-columns: 1fr;
    }

    .contact-wrapper {
        grid-template-columns: 1fr;
        padding: 2rem;
    }

    /* Navegación Móvil */
    .menu-toggle {
        display: flex;
    }

    .nav-menu {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: var(--color-surface);
        flex-direction: column;
        padding: 2rem;
        gap: 1.5rem;
        box-shadow: var(--shadow-md);
        clip-path: polygon(0 0, 100% 0, 100% 0, 0 0);
        transition: all 0.4s ease-in-out;
    }

    .nav-menu.open {
        clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
    }
}

@media (max-width: 480px) {
    .stats-container {
        grid-template-columns: 1fr;
    }
    
    .services-grid {
        grid-template-columns: 1fr;
    }
    
    .cta-buttons {
        flex-direction: column;
        width: 100%;
    }
    
    .drone-scanner {
        transform: scale(0.8);
    }
}