:root {
    /* Colors */
    --bg-color: #050505;
    --primary: #8B5CF6;
    /* Electric Violet */
    --primary-glow: rgba(139, 92, 246, 0.4);
    --secondary: #EC4899;
    /* Neon Magenta */
    --accent: #A78BFA;
    --text-main: #F8FAFC;
    --text-muted: #94A3B8;
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
    --card-bg: rgba(10, 10, 10, 0.6);

    /* Typography */
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;

    /* Spacing */
    --section-padding: 100px 0;
    --container-max-width: 1200px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    cursor: none !important;
}

html {
    scroll-behavior: initial;
    /* Lenis handles this */
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: var(--font-body);
    line-height: 1.6;
    overflow-x: hidden;
    cursor: none;
    /* Custom cursor */
}

body::after {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    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)'/%3E%3C/svg%3E");
    opacity: 0.05;
    pointer-events: none;
    z-index: 9999;
}

/* Custom Cursor */
#custom-cursor {
    position: fixed;
    top: 0;
    left: 0;
    width: 10px;
    height: 10px;
    background: white;
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    mix-blend-mode: difference;
    transform: translate(-50%, -50%);
    will-change: transform;
    transition: width 0.3s, height 0.3s, background 0.3s;
}

#cursor-halo {
    position: fixed;
    top: 0;
    left: 0;
    width: 40px;
    height: 40px;
    border: 1px solid var(--primary);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9998;
    transform: translate(-50%, -50%);
    will-change: transform;
    background: radial-gradient(circle, var(--primary-glow) 0%, transparent 70%);
    transition: width 0.3s, height 0.3s, background 0.3s, border-color 0.3s;
}

@media (max-width: 1024px) {

    #custom-cursor,
    #cursor-halo {
        display: none !important;
    }

    * {
        cursor: auto !important;
    }
}

/* Base Layout */
.container {
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 24px;
}

.container.narrow {
    max-width: 700px;
}

.section {
    padding: var(--section-padding);
    position: relative;
    z-index: 1;
}

.center {
    text-align: center;
}

.overflow-hidden {
    overflow: hidden;
}

/* Background Canvas */
#neural-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    /* Slightly above lights */
    opacity: 0.4;
    pointer-events: none;
}

/* Ambient Background Lights */
.bg-ambient-lights {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.light {
    position: absolute;
    border-radius: 50%;
    filter: blur(140px);
    opacity: 0.15;
    will-change: transform;
}

.light-1 {
    width: 50vw;
    height: 50vw;
    background: radial-gradient(circle, var(--primary) 0%, transparent 70%);
    top: -10%;
    left: -10%;
    animation: floatLight 15s ease-in-out infinite alternate;
}

.light-2 {
    width: 45vw;
    height: 45vw;
    background: radial-gradient(circle, var(--secondary) 0%, transparent 70%);
    bottom: -5%;
    right: -10%;
    animation: floatLight 20s ease-in-out infinite alternate-reverse;
}

.light-3 {
    width: 35vw;
    height: 35vw;
    background: radial-gradient(circle, var(--accent) 0%, transparent 70%);
    top: 40%;
    left: 45%;
    animation: floatLight 18s ease-in-out infinite;
}

@keyframes floatLight {
    0% {
        transform: translate(0, 0) scale(1);
    }

    33% {
        transform: translate(10%, 15%) scale(1.1);
    }

    66% {
        transform: translate(-5%, 20%) scale(0.9);
    }

    100% {
        transform: translate(0, 0) scale(1);
    }
}

/* Navbar */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 20px 0;
    z-index: 1000;
    transition: background 0.3s, backdrop-filter 0.3s;
}

.navbar.scrolled {
    background: rgba(5, 5, 5, 0.7);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--glass-border);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 32px;
    align-items: center;
}

.nav-links a {
    color: var(--text-main);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: color 0.3s;
}

.nav-links a:not(.btn-primary):hover {
    color: var(--primary);
}

/* Buttons */
.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    padding: 12px 28px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: transform 0.3s, box-shadow 0.3s;
    border: none;
    cursor: pointer;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px var(--primary-glow);
}

.btn-secondary {
    background: transparent;
    color: white;
    padding: 12px 28px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    border: 1px solid var(--glass-border);
    transition: background 0.3s, border-color 0.3s;
}

.btn-secondary:hover {
    background: var(--glass-bg);
    border-color: var(--primary);
}

.btn-text {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 16px;
}

.w-full {
    width: 100%;
    justify-content: center;
}

/* Hero Section */
.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
}

.badge {
    display: inline-block;
    padding: 6px 16px;
    background: rgba(139, 92, 246, 0.1);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 50px;
    color: var(--accent);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 1px;
    margin-bottom: 24px;
}

.hero-title {
    font-family: var(--font-heading);
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    line-height: 1.1;
    font-weight: 800;
    margin-bottom: 24px;
}

.gradient-text {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    background-size: 200% auto;
    animation: gradientShift 5s ease infinite;
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-muted);
    max-width: 700px;
    margin: 0 auto 40px;
}

.hero-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
}

/* Scroll Indicator */
.scroll-indicator {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
}

.mouse {
    width: 26px;
    height: 42px;
    border: 2px solid var(--glass-border);
    border-radius: 20px;
    display: flex;
    justify-content: center;
}

.wheel {
    width: 4px;
    height: 8px;
    background: var(--primary);
    border-radius: 2px;
    margin-top: 8px;
    animation: scrollMove 2s infinite;
}

@keyframes scrollMove {
    0% {
        transform: translateY(0);
        opacity: 0;
    }

    50% {
        opacity: 1;
    }

    100% {
        transform: translateY(15px);
        opacity: 0;
    }
}

/* Sections General */
.section-header {
    margin-bottom: 60px;
}

.section-title {
    font-family: var(--font-heading);
    font-size: clamp(2rem, 4vw, 3rem);
    margin-bottom: 16px;
}

.section-description {
    color: var(--text-muted);
    max-width: 800px;
    font-size: 1.1rem;
}

.section-header.center .section-description {
    margin: 0 auto;
}

/* Cards Grid */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 32px;
}

.card {
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    padding: 40px;
    border-radius: 24px;
    backdrop-filter: blur(8px);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), border-color 0.3s, box-shadow 0.3s;
    position: relative;
    overflow: hidden;
}

.card:hover {
    border-color: var(--primary);
    box-shadow: 0 20px 40px rgba(139, 92, 246, 0.1);
    transform: translateY(-10px);
}

.card-icon {
    width: 60px;
    height: 60px;
    background: rgba(139, 92, 246, 0.1);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
    color: var(--primary);
}

.card h3 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    margin-bottom: 16px;
}

.card p {
    color: var(--text-muted);
}

/* IA Section Grid */
.ia-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 60px;
    align-items: center;
}

.ia-list {
    list-style: none;
    margin-top: 32px;
}

.ia-list li {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    font-weight: 500;
}

.ia-list i {
    color: var(--primary);
}

.ia-sidebar-card {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.05), rgba(236, 72, 153, 0.05));
}

.sidebar-list {
    list-style: none;
    margin-top: 24px;
}

.sidebar-list li {
    padding: 12px 0;
    border-bottom: 1px solid var(--glass-border);
    color: var(--text-main);
    display: flex;
    justify-content: space-between;
}

.sidebar-list li:last-child {
    border-bottom: none;
}

/* Solutions Grid */
.solutions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 32px;
}

.card-flip {
    perspective: 1000px;
    height: 300px;
    background: transparent;
    border: none;
    padding: 0;
}

.card-flip:hover {
    transform: none;
    /* Disable default uplift to avoid conflict with flip */
}

.card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    transform-style: preserve-3d;
}

.card-flip:hover .card-inner {
    transform: rotateY(180deg);
}

.card-front,
.card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.card-back {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(236, 72, 153, 0.2));
    transform: rotateY(180deg);
    text-align: center;
    align-items: center;
}

.solution-header h3 {
    font-size: 2rem;
    margin-bottom: 20px;
}

/* Contact Box */
.contact-box {
    padding: 60px;
    border-radius: 32px;
    background: rgba(10, 10, 10, 0.4);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(12px);
}

.glass {
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

.contact-form {
    margin-top: 40px;
}

.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-muted);
}

.form-group input,
.form-group textarea {
    width: 100%;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 14px 20px;
    color: white;
    font-family: inherit;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 15px rgba(139, 92, 246, 0.2);
}

/* Footer */
.main-footer {
    padding: 60px 0;
    border-top: 1px solid var(--glass-border);
}

.footer-logo {
    margin-bottom: 20px;
    opacity: 0.8;
}

.main-footer p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 992px) {
    .ia-grid {
        grid-template-columns: 1fr;
    }

    .nav-links {
        display: none;
    }

    /* Simplified for demo, would add burger menu in real app */
}

@media (max-width: 768px) {
    .hero-title {
        font-size: 3rem;
    }

    .hero-actions {
        flex-direction: column;
    }

    .solutions-grid {
        grid-template-columns: 1fr;
    }

    .contact-box {
        padding: 30px;
    }
}

/* Proyectos (Portfolio) */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 32px;
    margin-top: 40px;
}

@media (max-width: 768px) {
    .projects-grid {
        grid-template-columns: 1fr;
    }
}

.project-card {
    display: flex;
    flex-direction: column;
    padding: 40px !important;
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    transition: all 0.4s ease;
}

.project-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
}

.project-brand-icon {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), rgba(236, 72, 153, 0.1));
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
}

.project-brand-icon i {
    width: 28px;
    height: 28px;
}

.project-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.tag {
    padding: 4px 12px;
    background: rgba(139, 92, 246, 0.05);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.project-info h3 {
    margin-bottom: 12px;
    font-size: 1.8rem;
    font-family: var(--font-heading);
}

.project-info p {
    margin-bottom: 32px;
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-muted);
}

.project-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 24px;
    border-top: 1px solid var(--glass-border);
}

.project-location {
    color: var(--text-muted);
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-sm {
    padding: 8px 20px;
    font-size: 0.9rem;
}

/* Placeholder card for scalability */
.project-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    border: 2px dashed var(--glass-border) !important;
    background: transparent !important;
    padding: 40px !important;
}

.placeholder-content {
    opacity: 0.5;
    transition: all 0.4s ease;
}

.project-placeholder:hover {
    border-color: var(--primary) !important;
    background: rgba(139, 92, 246, 0.02) !important;
}

.project-placeholder:hover .placeholder-content {
    opacity: 1;
    transform: translateY(-5px);
}

.placeholder-icon {
    width: 64px;
    height: 64px;
    background: rgba(139, 92, 246, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    color: var(--primary);
}

.project-placeholder h3 {
    margin-bottom: 12px;
}

.badge-status {
    padding: 4px 12px;
    background: rgba(236, 72, 153, 0.1);
    border: 1px solid rgba(236, 72, 153, 0.2);
    border-radius: 50px;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

[data-lucide="loader"] {
    animation: rotate 2s linear infinite;
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}