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

:root {
    --primary: #7c3aed;
    --primary-dark: #5b21b6;
    --secondary: #0ea5e9;
    --accent: #f59e0b;
    --dark: #0f172a;
    --darker: #020617;
    --light: #f8fafc;
    --gray: #94a3b8;
    --success: #10b981;
    --glass: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: linear-gradient(135deg, var(--darker) 0%, var(--dark) 50%, #1e293b 100%);
    color: var(--light);
    line-height: 1.7;
    font-size: 18px;
    min-height: 100vh;
    overflow-x: hidden;
    padding-top: 80px;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        radial-gradient(circle at 20% 80%, rgba(124, 58, 237, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(14, 165, 233, 0.1) 0%, transparent 50%);
    z-index: -1;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Inter', sans-serif;
    line-height: 1.2;
    letter-spacing: -0.02em;
    color: var(--light);
    text-wrap: balance;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 9999;
    background: transparent;
    transition: background 250ms ease, box-shadow 250ms ease, backdrop-filter 250ms ease;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 18px 0;
}

header.header--scrolled {
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--light);
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(45deg, var(--primary), var(--secondary));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: bold;
    animation: logoPulse 3s infinite ease-in-out;
}

@keyframes logoPulse {
    0%, 100% { transform: scale(1); box-shadow: 0 0 0 rgba(124, 58, 237, 0); }
    50% { transform: scale(1.05); box-shadow: 0 0 15px rgba(124, 58, 237, 0.5); }
}

.logo-text {
    font-size: 24px;
    font-weight: 800;
    /* Gradient: White -> Gray -> Primary -> Secondary -> White */
    background: linear-gradient(
        to right,
        var(--light) 0%,
        #cbd5e1 25%, 
        var(--primary) 50%,
        var(--secondary) 75%,
        var(--light) 100%
    );
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    
    background-position: 0% 50%;
    transition: background-position 0.6s ease-out;
}

.logo:hover .logo-text {
    background-position: 100% 50%;
}

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

.nav-links a {
    color: var(--gray);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    position: relative;
    padding: 8px 0;
}

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

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    transition: var(--transition);
}

.nav-links a:hover::after {
    width: 100%;
}

/* Call to Action Buttons */
.cta-button {
    background: linear-gradient(45deg, var(--primary), var(--secondary));
    background-size: 200% 200%;
    color: white;
    padding: 12px 28px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(124, 58, 237, 0.3);
    position: relative;
    overflow: hidden;
}

.cta-button:hover:not(:disabled) {
    background-position: right center;
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 30px rgba(124, 58, 237, 0.5);
    animation: buttonPulse 2s infinite;
}

.cta-button:disabled {
    opacity: 0.7;
    cursor: wait;
    transform: none !important;
    animation: none !important;
}

/* Ripple Effect */
.ripple {
    position: absolute;
    border-radius: 50%;
    transform: scale(0);
    animation: ripple 0.6s linear;
    background-color: rgba(255, 255, 255, 0.4);
    pointer-events: none;
}

@keyframes ripple {
    to { transform: scale(4); opacity: 0; }
}

@keyframes buttonPulse {
    0% { box-shadow: 0 0 0 0 rgba(124, 58, 237, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(124, 58, 237, 0); }
    100% { box-shadow: 0 0 0 0 rgba(124, 58, 237, 0); }
}

/* Hamburger menu */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 28px;
    height: 20px;
    cursor: pointer;
}

.hamburger span {
    width: 100%;
    height: 3px;
    background: #fff;
    border-radius: 5px;
    transition: 0.3s;
}

/* Hero Section */
.hero {
    padding: 100px 0 80px;
    text-align: center;
    position: relative;
}

.hero-badge {
    display: inline-block;
    background: rgba(124, 58, 237, 0.1);
    color: var(--primary);
    padding: 8px 20px;
    border-radius: 50px;
    font-weight: 600;
    margin-bottom: 24px;
    border: 1px solid rgba(124, 58, 237, 0.3);
    animation: badgeFloat 3s ease-in-out infinite;
}

@keyframes badgeFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.hero-title {
    font-size: 4.5rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 24px;
    /* FIX: Replaced gradient background-clip with solid color + shadow for visibility reliability */
    color: var(--light);
    text-shadow: 0 0 30px rgba(124, 58, 237, 0.3);
    position: relative;
    /* FIX: Disable text-wrap balance for this dynamic element to prevent layout jitter */
    text-wrap: normal; 
}

/* Typewriter Cursor */
.hero-title::after {
    content: '|';
    display: inline-block;
    margin-left: 4px; /* Adjusted spacing */
    color: var(--primary);
    -webkit-text-fill-color: var(--primary);
    font-weight: 400;
    animation: blinkCursor 1.2s step-end infinite;
    vertical-align: baseline; /* Better alignment with text */
}

@keyframes blinkCursor {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* Character reveal animation for Hero Title (Typewriter) */
.char-reveal {
    /* Using simple opacity transition for reveal */
    opacity: 0;
    /* Instant appearance for typing effect */
    animation: typeReveal 0.01s forwards;
}

@keyframes typeReveal {
    to { opacity: 1; }
}

.hero-subtitle {
    font-size: 1.35rem;
    color: var(--gray);
    max-width: 700px;
    margin: 0 auto 40px;
    font-weight: 400;
}

.hero-stack {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 40px;
}

.stack-item {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    padding: 10px 20px;
    border-radius: 50px;
    font-weight: 500;
    transition: var(--transition);
    cursor: pointer;
    position: relative;
    /* Subtle float animation */
    animation: subtleFloat 4s ease-in-out infinite;
    will-change: transform;
}

/* Staggered float for stack items */
.stack-item:nth-child(1) { animation-delay: 0s; }
.stack-item:nth-child(2) { animation-delay: 0.5s; }
.stack-item:nth-child(3) { animation-delay: 1s; }
.stack-item:nth-child(4) { animation-delay: 1.5s; }
.stack-item:nth-child(5) { animation-delay: 2s; }
.stack-item:nth-child(6) { animation-delay: 2.5s; }

@keyframes subtleFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.stack-item:hover {
    background: rgba(124, 58, 237, 0.1);
    border-color: var(--primary);
    color: #00c6ff;
    box-shadow: 0 0 15px rgba(0, 198, 255, 0.4);
    animation-play-state: paused;
    transform: translateY(-5px);
}

/* Tech Popup with Tooltips */
#tech-popup {
    position: fixed; /* Changed to fixed for better positioning logic */
    display: none;
    padding: 12px;
    border-radius: 16px;
    background: rgba(20, 20, 30, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
    z-index: 10000;
    min-width: 140px;
    pointer-events: auto; /* Allow interaction */
    /* Inicia invisible para que la transición funcione la primera vez */
    opacity: 0;
    transition: opacity 0.2s ease;
}

#tech-popup .icon-grid {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.tech-icon-wrapper {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.tech-icon-wrapper i {
    font-size: 28px;
    color: #fff;
    opacity: 0;
    cursor: pointer;
    transition: transform 0.2s ease;
    animation: 
        popIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards,
        heartbeat 1.5s ease-in-out infinite;
}

.tech-icon-wrapper:nth-child(1) i { animation-delay: 0.05s, 0.5s; }
.tech-icon-wrapper:nth-child(2) i { animation-delay: 0.15s, 0.6s; }
.tech-icon-wrapper:nth-child(3) i { animation-delay: 0.25s, 0.7s; }

.tech-icon-wrapper:hover i {
    transform: scale(1.2);
    color: var(--secondary);
}

.tech-tooltip {
    position: absolute;
    bottom: -35px;
    left: 50%;
    transform: translateX(-50%) translateY(5px) scale(0.9);
    background: rgba(255, 255, 255, 0.95);
    color: var(--darker);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: all 0.2s ease;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.tech-icon-wrapper:hover .tech-tooltip {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
}

@keyframes popIn {
    from { opacity: 0; transform: scale(0.5); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes heartbeat {
    0%, 100% { transform: scale(1); text-shadow: none; }
    50% { transform: scale(1.15); text-shadow: 0 0 10px rgba(255, 255, 255, 0.5); }
}

/* Servicios */
.services {
    padding: 80px 0;
}

.section-title {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 16px;
    text-align: center;
}

.section-subtitle {
    color: var(--gray);
    text-align: center;
    max-width: 700px;
    margin: 0 auto 60px;
    font-size: 1.2rem;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
}

.service-card {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 40px 30px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    /* 3D Transform Properties */
    transform-style: preserve-3d;
    will-change: transform;
}

.service-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow);
    border-color: rgba(124, 58, 237, 0.3);
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
}

.service-icon {
    width: 70px;
    height: 70px;
    background: linear-gradient(45deg, var(--primary), var(--secondary));
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    margin: 0 auto 24px;
}

.service-icon.active i {
    animation: serviceIconAnim 4s ease-in-out infinite;
}

@keyframes serviceIconAnim {
    0%, 100% { 
        transform: translateY(0) scale(1); 
        text-shadow: 0 0 0 rgba(255, 255, 255, 0); 
    }
    50% { 
        transform: translateY(-5px) scale(1.1); 
        text-shadow: 0 0 15px rgba(255, 255, 255, 0.6); 
    }
}

.service-title {
    font-size: 1.6rem;
    font-weight: 800;
    margin-bottom: 16px;
}

.service-description {
    color: var(--gray);
    margin-bottom: 20px;
}

.service-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 20px;
    justify-content: center;
}

.tech-tag {
    padding: 6px 12px;
    border-radius: 6px;
    background: linear-gradient(135deg, #4cc9f0, #4361ee);
    color: white;
    font-weight: 600;
    font-size: 12px;
    transition: transform .25s ease, box-shadow .25s ease;
}

.tech-tag:hover {
    transform: scale(1.12);
    box-shadow: 0 0 14px rgba(67, 97, 238, 0.8);
}

/* Proyectos */
.projects {
    padding: 80px 0;
    background: rgba(0, 0, 0, 0.2);
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
}

.project-card {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    overflow: hidden;
    cursor: pointer;
    transition: var(--transition);
    transform-style: preserve-3d;
    will-change: transform;
}

.project-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.project-image {
    height: 220px;
    background: linear-gradient(45deg, var(--primary-dark), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 110px;
    color: #4aa3ff;
}

.project-content {
    padding: 30px;
}

.project-title {
    font-size: 1.4rem;
    font-weight: 800;
    margin-bottom: 12px;
    text-align: center;
    width: 100%;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 16px 0;
    justify-content: center;
}

.project-tag {
    background: rgba(124, 58, 237, 0.1);
    color: var(--primary);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.project-view-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--light);
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    gap: 8px;
    width: 100%;
    justify-content: center;
    align-items: center;
    transition: var(--transition);
    margin-top: 15px;
    position: relative;
    overflow: hidden;
}

.project-view-btn:hover {
    background: rgba(124, 58, 237, 0.2);
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(124, 58, 237, 0.2);
}

/* Filosofía */
.philosophy {
    padding: 80px 0;
    text-align: center;
}

.philosophy-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-top: 60px;
}

.philosophy-item {
    padding: 30px;
}

.philosophy-number {
    font-size: 3.5rem;
    font-weight: 800;
    background: linear-gradient(45deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    line-height: 1;
    margin-bottom: 20px;
}

/* Contacto */
.contact {
    padding: 80px 0;
    background: rgba(0, 0, 0, 0.2);
}

.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 50px;
    align-items: start;
}

.contact-methods {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.contact-method {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 24px;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    transition: var(--transition);
}

.contact-method:hover {
    background: rgba(124, 58, 237, 0.1);
    transform: translateX(5px);
}

.contact-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(45deg, var(--primary), var(--secondary));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

/* Contact Form Styles */
.contact-form-wrapper {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    padding: 30px;
    border-radius: 20px;
    position: relative;
    overflow: hidden;
}

.form-group {
    margin-bottom: 20px;
    position: relative;
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: #fff;
    font-family: inherit;
    font-size: 1rem;
    transition: var(--transition);
}

.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: var(--secondary);
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.1);
}

.contact-form input.error,
.contact-form textarea.error {
    border-color: #ef4444;
}

.error-message {
    color: #ef4444;
    font-size: 0.85rem;
    margin-top: 5px;
    display: none;
    animation: fadeIn 0.3s ease;
}

.error-message.visible {
    display: block;
}

/* Success Message Animation */
.success-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 20px;
    animation: scaleIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.success-icon {
    font-size: 4rem;
    color: var(--success);
    margin-bottom: 20px;
    animation: 
        scaleIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275),
        pulseSuccess 2s infinite ease-in-out 0.5s;
}

.success-content h3 {
    margin-bottom: 10px;
    opacity: 0;
    animation: fadeIn 0.5s ease forwards 0.3s;
}

.success-content p {
    color: var(--gray);
    opacity: 0;
    animation: fadeIn 0.5s ease forwards 0.5s;
}

.success-content button {
    opacity: 0;
    animation: fadeIn 0.5s ease forwards 0.7s;
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes pulseSuccess {
    0%, 100% { transform: scale(1); text-shadow: 0 0 0 rgba(16, 185, 129, 0); }
    50% { transform: scale(1.1); text-shadow: 0 0 20px rgba(16, 185, 129, 0.4); }
}

/* Footer */
footer {
    padding: 60px 0 30px;
    border-top: 1px solid var(--glass-border);
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-logo {
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 16px;
    background: linear-gradient(45deg, var(--light), #cbd5e1);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.footer-text {
    color: var(--gray);
    line-height: 1.7;
}

.footer-heading {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--light);
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 12px;
}

.footer-links a {
    color: var(--gray);
    text-decoration: none;
    transition: var(--transition);
    position: relative;
    display: inline-block;
}

/* Gradient underline animation for footer links */
.footer-links a::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 2px;
    bottom: -2px;
    left: 0;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    transform: scaleX(0);
    transform-origin: bottom right;
    transition: transform 0.3s ease-out;
}

.footer-links a:hover {
    color: var(--light);
}

.footer-links a:hover::after {
    transform: scaleX(1);
    transform-origin: bottom left;
}

/* Social Links with dynamic gradient hover */
.social-links {
    display: flex;
    gap: 16px;
    margin-top: 40px;
}

.social-link {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--light);
    text-decoration: none;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
    z-index: 1;
}

/* Class for entrance animation (Pop & Beat) */
.social-link.active-animate {
    opacity: 1;
    animation: 
        popIn 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards,
        socialBeat 3s ease-in-out infinite 0.6s;
}

/* Animation Keyframes for Social Beat */
@keyframes socialBeat {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.social-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, var(--primary), var(--secondary));
    background-size: 200% 200%;
    opacity: 0;
    z-index: -1;
    transition: opacity 0.3s ease, background-position 0.3s ease;
}

.social-link:hover {
    border-color: transparent;
    transform: translateY(-5px) scale(1.1);
    box-shadow: 0 10px 20px rgba(124, 58, 237, 0.4);
    /* Pause or remove animation on hover so transform works */
    animation: none;
}

.social-link.active-animate:hover {
    animation: none;
}

.social-link:hover::before {
    opacity: 1;
    background-position: right center;
    animation: gradientShift 3s ease infinite;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Footer Stack Styles */
.footer-stack-section {
    padding: 30px 0;
    border-top: 1px solid var(--glass-border);
    margin-bottom: 40px;
    text-align: center;
}

.footer-stack {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 20px;
}

.footer-stack-item {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    padding: 10px 20px;
    border-radius: 50px;
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--gray);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
    /* Animación similar al Hero */
    animation: float 6s ease-in-out infinite;
    will-change: transform;
}

/* Staggered animation for footer items (expanded for new items) */
.footer-stack-item:nth-child(1) { animation-delay: 0.2s; animation-duration: 6.2s; }
.footer-stack-item:nth-child(2) { animation-delay: 1.2s; animation-duration: 5.8s; }
.footer-stack-item:nth-child(3) { animation-delay: 2.2s; animation-duration: 6.5s; }
.footer-stack-item:nth-child(4) { animation-delay: 0.7s; animation-duration: 6.0s; }
.footer-stack-item:nth-child(5) { animation-delay: 1.7s; animation-duration: 5.5s; }
.footer-stack-item:nth-child(6) { animation-delay: 0.5s; animation-duration: 6.3s; }
.footer-stack-item:nth-child(7) { animation-delay: 1.5s; animation-duration: 5.7s; }
.footer-stack-item:nth-child(8) { animation-delay: 2.5s; animation-duration: 6.1s; }
.footer-stack-item:nth-child(9) { animation-delay: 0.9s; animation-duration: 5.9s; }
.footer-stack-item:nth-child(10) { animation-delay: 1.9s; animation-duration: 6.4s; }
.footer-stack-item:nth-child(11) { animation-delay: 0.3s; animation-duration: 5.6s; }
.footer-stack-item:nth-child(12) { animation-delay: 1.3s; animation-duration: 6.6s; }
.footer-stack-item:nth-child(13) { animation-delay: 2.3s; animation-duration: 5.4s; }
.footer-stack-item:nth-child(14) { animation-delay: 0.8s; animation-duration: 6.7s; }
.footer-stack-item:nth-child(15) { animation-delay: 1.8s; animation-duration: 5.3s; }

.footer-stack-item i {
    font-size: 1.2em;
    color: var(--secondary);
}

.footer-stack-item:hover {
    background: rgba(124, 58, 237, 0.1);
    border-color: var(--primary);
    color: #00c6ff; /* Cyan glow matching Hero */
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 0 15px rgba(0, 198, 255, 0.4);
    animation-play-state: paused;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.copyright {
    text-align: center;
    color: var(--gray);
    padding-top: 30px;
    border-top: 1px solid var(--glass-border);
}

/* WhatsApp flotante */
.whatsapp-float {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: #25D366;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: white;
    text-decoration: none;
    box-shadow: 0 4px 20px rgba(37, 211, 102, 0.4);
    z-index: 1000;
    transition: var(--transition);
}

.whatsapp-float:hover {
    transform: scale(1.1) rotate(10deg);
    box-shadow: 0 6px 25px rgba(37, 211, 102, 0.6);
}

/* Modales */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 999999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.4s;
    padding: 20px;
}

.modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-glass {
    background: rgba(30, 41, 59, 0.95); /* Más opaco para mejor lectura */
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    width: 100%;
    max-width: 900px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    transform: scale(0.9) translateY(20px);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s ease;
}

.modal.active .modal-glass {
    transform: scale(1) translateY(0);
    opacity: 1;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 30px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-header h3 {
    font-size: 1.8rem;
    background: linear-gradient(45deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin: 0;
}

.modal-close {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

.modal-body {
    padding: 30px;
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 30px;
}

.modal-image {
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.modal-image i {
    font-size: 100px;
    color: var(--secondary);
    opacity: 0.9;
    text-shadow: 0 0 30px rgba(14, 165, 233, 0.3);
}

.modal-content h4 {
    font-size: 1.5rem;
    margin-bottom: 15px;
    color: var(--light);
}

.modal-description {
    font-size: 1.1rem;
    line-height: 1.7;
    margin-bottom: 25px;
    color: var(--gray);
}

.modal-features h5,
.modal-tech h5 {
    font-size: 1.1rem;
    margin-bottom: 15px;
    color: var(--light);
}

.modal-features ul {
    list-style: none;
    margin-bottom: 25px;
}

.modal-features li {
    padding: 6px 0;
    padding-left: 25px;
    position: relative;
    color: var(--gray);
}

.modal-features li:before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--success);
    font-weight: bold;
}

.tech-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 25px;
}

.tech-badge {
    background: rgba(124, 58, 237, 0.15);
    border: 1px solid rgba(124, 58, 237, 0.3);
    color: var(--primary);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    transition: var(--transition);
}

.tech-badge:hover {
    background: rgba(124, 58, 237, 0.25);
    transform: translateY(-2px);
}

.modal-stats {
    display: flex;
    gap: 30px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.stat-item i {
    font-size: 1.8rem;
    color: var(--secondary);
}

.stat-item span {
    font-size: 0.9rem;
    color: var(--gray);
    text-align: center;
}

/* Colores de iconos base */
.fa-react { color: #61DAFB; }
.fa-vuejs { color: #42B883; }
.fa-js { color: #F7DF1E; }
.fa-node { color: #3C873A; }
.fa-python { color: #3776AB; }
.fa-server { color: #7D7D7D; }
.fa-database { color: #4E89FF; }
.fa-code-branch { color: #9A4DFF; }
.fa-docker { color: #2496ED; }
.fa-aws { color: #FF9900; }
.fa-cloud { color: #00C9FF; }
.fa-network-wired { color: #34C3FF; }
.fa-plug { color: #888; }
.fa-cubes { color: #7289DA; }
.fa-robot { color: #FF4B4B; }
.fa-brain { color: #FF5EDB; }
.fa-wave-square { color: #00FF9D; }

/* Responsive */
@media (max-width: 768px) {
    body {
        font-size: 16px;
        padding-top: 70px;
    }
    
    .hero-title {
        font-size: 2.8rem;
    }

    .nav-links {
        position: absolute;
        top: 70px;
        right: 20px;
        background: rgba(15, 23, 42, 0.95);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        padding: 22px 28px;
        border-radius: 16px;
        border: 1px solid rgba(255,255,255,0.1);
        display: flex;
        flex-direction: column;
        gap: 18px;
        opacity: 0;
        pointer-events: none;
        transform: translateY(-20px) scale(0.95);
        transition: all 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
        width: 200px;
        box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    }

    .nav-links a {
        font-size: 1.1rem;
        padding: 8px 0;
        border-bottom: 1px solid rgba(255,255,255,0.05);
    }
    
    .nav-links a:last-child {
        border-bottom: none;
    }

    .nav-links.active {
        opacity: 1;
        pointer-events: auto;
        transform: translateY(0) scale(1);
    }

    .hamburger {
        display: flex;
    }

    .hamburger.active span:nth-child(1) {
        transform: rotate(45deg) translateY(7px);
    }
    .hamburger.active span:nth-child(2) {
        opacity: 0;
    }
    .hamburger.active span:nth-child(3) {
        transform: rotate(-45deg) translateY(-7px);
    }

    .desktop-only {
        display: none;
    }

    .modal-body {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .modal-image i {
        font-size: 60px;
    }
    
    .modal-glass {
        max-height: 85vh;
        margin: 10px;
    }
    
    .modal-stats {
        flex-direction: row;
        justify-content: space-around;
    }

    .services-grid,
    .projects-grid,
    .philosophy-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 2.2rem;
    }

    .section-title {
        font-size: 2rem;
    }
    
    .modal-stats {
        flex-direction: column;
        gap: 15px;
    }
}
.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem; /* espacio entre logo y texto */
}

.logo-img {
    width: 200px; /* ajusta según tu diseño */
    height: auto;
}
.philosophy-item {
  background: linear-gradient(
    145deg,
    rgba(0, 240, 255, 0.08),
    rgba(120, 0, 255, 0.06)
  );
  border-radius: 18px;
  padding: 32px 28px;
  border: 1px solid rgba(0, 240, 255, 0.35);
  box-shadow:
    0 0 0 1px rgba(0, 240, 255, 0.12),
    0 20px 45px rgba(0, 0, 0, 0.35);
}

.philosophy-number {
  font-size: 3.2rem;
  font-weight: 700;
  font-family: 'Montserrat', sans-serif;
  margin-bottom: 14px;
  letter-spacing: 3px;
  background: linear-gradient(90deg, #00f0ff, #7a00ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.philosophy-item h3 {
  color: #e8faff;
}

.philosophy-item p {
  color: rgba(232, 250, 255, 0.75);
}
.philosophy-item {
  transform-style: preserve-3d;
  transition: transform 0.15s ease-out, box-shadow 0.25s ease;
  will-change: transform;
}