/* =========================================
   1. VARIABLES & CONFIGURACIÓN GLOBAL
   ========================================= */
:root {
    /* Paleta de Colores Corporativa (HQ Web Solutions) */
    --hq-blue-light: #39A7FF;
    --hq-blue-medium: #0072C6;
    --hq-blue-dark: #003A66;

    /* Escala de Grises */
    --hq-gray-xlight: #f8f9fb;
    --hq-gray-light: #F2F2F2;
    --hq-gray-medium: #C0C0C0;
    --hq-gray-dark: #808080;
    --dark: #1f2933;
    --gray: #6b7280;
    --white: #ffffff;

    /* Asignación Semántica */
    --primary: var(--hq-blue-dark);
    --secondary: var(--hq-blue-light);
    --accent: var(--hq-blue-medium);
    --border-color: #d5d8e0;
    
    /* Gradientes */
    --gradient: linear-gradient(90deg, #39A7FF 0%, #0072C6 50%, #003A66 100%);
    --gradient-glow: radial-gradient(circle, rgba(57, 167, 255, 0.5) 0%, rgba(57, 167, 255, 0) 70%);
    
    /* Sombras */
    --shadow-light: 0 8px 24px rgba(0, 58, 102, 0.08);
    --shadow-medium: 0 10px 30px rgba(0, 58, 102, 0.15);
}

/* =========================================
   2. ANIMACIONES & UTILIDADES (MOVIDO AQUÍ PARA EVITAR CONFLICTOS)
   ========================================= */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease; /* Separamos las transiciones */
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Clases Utilitarias */
.bg-white { background: var(--white); }
.text-gray { color: var(--gray); }
.contact-info-title { margin-bottom: 2rem; color: var(--primary); }
.btn-full { width: 100%; }
.btn-large { font-size: 1.1rem; padding: 1rem 2rem; }

/* Animación de pulso para CTA */
.btn-pulse {
    position: relative;
    overflow: hidden;
    animation: pulse-shadow 2s infinite;
}

.btn-pulse::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: 0.5s;
}

@keyframes pulse-shadow {
    0% { box-shadow: 0 0 0 0 rgba(57, 167, 255, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(57, 167, 255, 0); }
    100% { box-shadow: 0 0 0 0 rgba(57, 167, 255, 0); }
}

/* =========================================
   3. NAVEGACIÓN (NAVBAR)
   ========================================= */
.nav {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    z-index: 1000;
    padding: 0.3rem 0;
    box-shadow: 0 2px 10px rgba(0, 58, 102, 0.1);
    transition: all 0.3s ease;
    border-bottom: 1px solid var(--border-color);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    padding: 0;
}

.logo img {
    height: 80px;
    width: auto;
    display: block;
    transition: transform 0.3s ease;
}

.logo:hover img {
    transform: scale(1.05);
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-link {
    color: var(--dark);
    font-weight: 500;
    transition: color 0.3s ease;
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gradient);
    transition: width 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active-link::after {
    width: 100%;
}

.nav-link.active-link {
    color: var(--primary);
}

.nav-cta {
    border: none;
    padding: 0.5rem 1.25rem;
    font-size: 1rem;
    border-radius: 50px;
}

.nav-cta::after {
    content: none;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
}

.nav-toggle span {
    width: 25px;
    height: 3px;
    background: var(--primary);
    margin: 3px 0;
    transition: 0.3s;
}

/* =========================================
   4. COMPONENTES UI (Botones, Inputs, Cards)
   ========================================= */
.btn {
    display: inline-flex;   
    align-items: center;    
    justify-content: center; 
    text-align: center;
    line-height: 1;    
    white-space: nowrap;    
    min-height: 48px;
    padding: 0 2rem;    
    border-radius: 50px;
    font-weight: 600;
    transition: all 0.3s ease;
    cursor: pointer;
    font-size: 1rem;
    border: none;
    text-decoration: none;
}

.btn-primary {
    background: var(--gradient);
    color: var(--white);
    box-shadow: 0 4px 15px rgba(0, 58, 102, 0.3);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 58, 102, 0.4);
}

.btn-secondary {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
}

.btn-secondary:hover {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

.form-input,
.form-textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 1rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    background: var(--white);
}

.form-input:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--secondary);
    box-shadow: 0 0 0 4px rgba(57, 167, 255, 0.1);
}

.form-textarea {
    resize: vertical;
    min-height: 120px;
}

/* =========================================
   5. SECCIONES GENERALES
   ========================================= */
.section {
    padding: 5rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 1rem;
}

.section-subtitle {
    font-size: 1.1rem;
    color: var(--gray);
}

/* =========================================
   6. HERO SECTION
   ========================================= */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 0 2rem;
    background: linear-gradient(135deg, var(--white) 0%, #f0f7ff 100%);
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: var(--gradient-glow);
    opacity: 0.3;
    animation: float 20s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    50% { transform: translate(-30px, -30px) rotate(180deg); }
}

.hero-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    position: relative;
}

.hero-text h1 {
    font-size: clamp(2.5rem, 5vw + 1rem, 3.5rem);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
    background: var(--gradient);
    -webkit-text-fill-color: transparent;
    -webkit-background-clip: text;
    background-clip: text;
}

.hero-text p {
    font-size: clamp(1rem, 1.5vw + 0.5rem, 1.25rem);
    color: var(--gray);
    margin-bottom: 2rem;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
}

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

.hero-image img {
    width: 100%;
    max-width: 400px;
    aspect-ratio: 1 / 1;
    border-radius: 50%;
    object-fit: cover;
    object-position: center;
    box-shadow: 0 20px 40px rgba(0, 58, 102, 0.15);
    border: 4px solid transparent;
    background: linear-gradient(var(--white), var(--white)) padding-box,
    var(--gradient) border-box;
    animation: pulse-border 4s ease-in-out infinite;
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}

@keyframes pulse-border {
    0%, 100% { border-color: var(--primary); }
    50% { border-color: var(--secondary); }
}

.hero-image img:hover {
    transform: translateY(-10px) rotate(-5deg);
    box-shadow: 0 30px 60px rgba(0, 114, 198, 0.25);
}

/* =========================================
   7. SERVICIOS
   ========================================= */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.service-card {
    background: var(--white);
    padding: 2rem;
    border-radius: 15px;
    box-shadow: var(--shadow-light);
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
    display: flex; 
    flex-direction: column;
}

.service-card:hover {
    transform: translateY(-5px);
    border-color: var(--secondary);
    box-shadow: 0 12px 35px rgba(0, 58, 102, 0.15); 
}

.service-icon {
    font-size: 3rem;
    color: var(--primary);
    margin-bottom: 1rem;
}

.service-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--dark);
}

.service-price {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    margin: 1rem 0;
}

.service-features {
    list-style: none;
    margin: 1rem 0;
    flex-grow: 1; 
}

.service-features li {
    padding: 0.5rem 0;
    color: var(--gray);
}

.service-features li::before {
    content: '✓';
    color: var(--accent);
    font-weight: bold;
    margin-right: 0.5rem;
}

.service-card .btn-primary {
    margin-top: auto; 
}

/* =========================================
   8. HABILIDADES (SKILLS)
   ========================================= */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.skill-card {
    background: var(--white);
    padding: 2rem;
    border-radius: 15px;
    text-align: center;
    box-shadow: var(--shadow-light);
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
}

.skill-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-medium);
    border-color: var(--accent);
}

.skill-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.skill-name {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--dark);
}

.skill-card span img {
    width: 65px;
    display: inline;
}

/* =========================================
   9. PROYECTOS (AHORA SÍ FUNCIONARÁ EL HOVER)
   ========================================= */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
}

.project-card {
    background: var(--white);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: var(--shadow-light);
    /* Transición suave para el efecto de zoom */
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); 
    border: 1px solid var(--border-color);
    position: relative;
    z-index: 1;
}

.project-card:hover {
    /* Efecto Pop-out */
    transform: scale(1.05) translateY(-10px);
    box-shadow: 0 30px 60px rgba(0, 58, 102, 0.25);
    border-color: var(--secondary);
    z-index: 10;
}

.project-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    object-position: top;
}

.project-content {
    padding: 2rem;
}

.project-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--dark);
}

.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 1rem 0;
}

.tech-tag {
    background: var(--hq-gray-xlight);
    color: var(--primary);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
    border: 1px solid var(--border-color);
}

/* =========================================
   10. CONTACTO
   ========================================= */
.contact-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: start;
}

.contact-form {
    background: var(--white);
    padding: 2rem;
    border-radius: 15px;
    box-shadow: var(--shadow-light);
    border: 1px solid var(--border-color);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--dark);
}

.contact-info {
    padding: 2rem;
}

.contact-item {
    display: flex;
    align-items: center;
    margin-bottom: 1.5rem;
}

.contact-icon {
    font-size: 1.5rem;
    color: var(--primary);
    margin-right: 1rem;
    width: 30px;
}

/* =========================================
   11. FOOTER
   ========================================= */
.footer {
    background: var(--primary);
    color: var(--white);
    padding: 3rem 2rem 1rem;
    text-align: center;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
}

.social-links {
    display: flex;
    justify-content: center; 
    align-items: center;    
    gap: 2rem;
    margin-bottom: 1rem;
}

.social-link {
    color: var(--white);
    font-size: 1.5rem;
    transition: color 0.3s ease;
}

.social-link:hover {
    color: var(--accent);
}

.flag {
    display: inline-block;
    width: 16px;
    height: 12px;
    background-size: cover;
    background-image: url('https://flagcdn.com/16x12/ve.png');
    margin-right: 0.5rem;
}

/* =========================================
   12. RESPONSIVE DESIGN
   ========================================= */
@media (max-width: 768px) {
    .nav-menu {
        position: fixed;
        left: -100%;
        top: 89px;
        flex-direction: column;
        background-color: var(--white);
        width: 100%;
        text-align: center;
        transition: 0.3s;
        box-shadow: 0 10px 27px rgba(0, 58, 102, 0.08);
        padding: 2rem 0;
        border-top: 1px solid var(--border-color);
        height: auto;
    }

    .nav-menu.active {
        left: 0;
    }

    .nav-toggle {
        display: flex;
    }

    .contact-content {
        grid-template-columns: 1fr;
    }

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

    .hero {
        padding: 6rem 1rem 4rem;
        min-height: auto;
    }

    .hero-content {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }

    .hero-buttons {
        justify-content: center;
        flex-wrap: wrap;
        gap: 0.75rem;
    }

    .hero-image img {
        max-width: 220px;
        margin-top: 1.5rem;
    }
}