/* ================================
   Art&Technology - Propuesta v3
   Landing Page Styles
================================ */

/* Variables */
:root {
    --primary: #c62828;
    --primary-dark: #8e0000;
    --primary-light: #e53935;
    --secondary: #1a1a1a;
    --accent: #ff5252;
    --text: #334155;
    --text-light: #64748b;
    --text-dark: #1e293b;
    --white: #ffffff;
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-800: #1e293b;
    --gray-900: #1a1a1a;
    --gradient: linear-gradient(135deg, var(--primary-light) 0%, var(--primary-dark) 100%);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    --radius: 12px;
    --radius-lg: 20px;
    --transition: all 0.3s ease;
}

/* Reset & Base */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text);
    background-color: var(--white);
    overflow-x: hidden;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

ul {
    list-style: none;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ================================
   Navigation
================================ */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 8px 0;
    transition: var(--transition);
}

.navbar.scrolled {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow);
    padding: 5px 0;
}

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

.logo {
    position: relative;
}

.logo img {
    height: auto;
    width: 200px;
    transition: var(--transition);
}

.logo .logo-white {
    display: block;
}

.logo .logo-color {
    display: none;
}

.navbar.scrolled .logo .logo-white {
    display: none;
}

.navbar.scrolled .logo .logo-color {
    display: block;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 40px;
}

.nav-menu a {
    color: var(--white);
    font-weight: 500;
    font-size: 0.95rem;
    position: relative;
}

.nav-menu a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-light);
    transition: var(--transition);
}

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

.navbar.scrolled .nav-menu a {
    color: var(--text-dark);
}

.btn-nav {
    background: var(--white);
    color: var(--primary) !important;
    padding: 10px 24px;
    border-radius: 50px;
    font-weight: 600;
}

.btn-nav:hover {
    background: var(--primary);
    color: var(--white) !important;
}

.navbar.scrolled .btn-nav {
    background: var(--primary);
    color: var(--white) !important;
}

.navbar.scrolled .btn-nav:hover {
    background: var(--primary-dark);
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
}

.nav-toggle span {
    width: 25px;
    height: 2px;
    background: var(--white);
    transition: var(--transition);
}

.navbar.scrolled .nav-toggle span {
    background: var(--text-dark);
}

/* ================================
   Hero Section
================================ */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    padding: 120px 20px 80px;
}

.hero-bg {
    position: absolute;
    inset: 0;
    background: var(--gradient);
    z-index: -2;
}

/* WhatsApp Floating Button with Spline */
.whatsapp-float {
    position: fixed;
    bottom: 30px;
    right: 20px;
    width: 300px;
    height: 300px;
    z-index: 9999;
    cursor: default;
    transition: transform 0.3s ease, opacity 0.3s ease;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
}

.whatsapp-float.visible {
    opacity: 1;
    pointer-events: auto;
}

.whatsapp-float:hover {
    transform: scale(1.1);
}

.whatsapp-float spline-viewer {
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.whatsapp-float spline-viewer::part(hint),
.whatsapp-float spline-viewer::part(logo),
.whatsapp-float spline-viewer::part(watermark) {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
}

/* Ocultar marca de agua de Spline */
.whatsapp-float spline-viewer::part(logo) {
    display: none !important;
}

.whatsapp-float #logo,
.whatsapp-float [id*="logo"],
.whatsapp-float a[href*="spline"] {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
}

/* WhatsApp float responsive */
@media (max-width: 768px) {
    .whatsapp-float {
        width: 200px;
        height: 200px;
        bottom: 20px;
        right: 10px;
    }
}

.hero-bg::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="50" cy="50" r="1" fill="rgba(255,255,255,0.1)"/></svg>');
    background-size: 50px 50px;
    opacity: 0.5;
}

.hero-bg::after {
    content: '';
    position: absolute;
    bottom: -50%;
    right: -20%;
    width: 80%;
    height: 100%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    border-radius: 50%;
}

.hero-content {
    text-align: center;
    max-width: 800px;
    z-index: 1;
}

.hero h1 {
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: 700;
    color: var(--white);
    line-height: 1.2;
    margin-bottom: 24px;
}

.hero .highlight {
    background: linear-gradient(120deg, #fbbf24, #f59e0b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 40px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.hero-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 32px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    transition: var(--transition);
    border: none;
}

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

.btn-primary:hover {
    background: var(--gray-100);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: transparent;
    color: var(--white);
    border: 2px solid rgba(255, 255, 255, 0.5);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--white);
}

.hero-scroll {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85rem;
}

.scroll-indicator {
    width: 24px;
    height: 40px;
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 12px;
    position: relative;
}

.scroll-indicator::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 8px;
    background: var(--white);
    border-radius: 2px;
    animation: scroll 2s infinite;
}

@keyframes scroll {
    0%, 100% { transform: translateX(-50%) translateY(0); opacity: 1; }
    50% { transform: translateX(-50%) translateY(12px); opacity: 0; }
}

/* ================================
   Section Header
================================ */
.section-header {
    text-align: center;
    margin-bottom: 60px;
}

.section-header h2 {
    font-size: clamp(2rem, 4vw, 2.75rem);
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 16px;
}

.section-header p {
    font-size: 1.125rem;
    color: var(--text-light);
}

.section-header.light h2,
.section-header.light p {
    color: var(--white);
}

.section-header.light p {
    opacity: 0.8;
}

/* ================================
   Servicios Section
================================ */
.servicios {
    padding: 100px 0;
    background: var(--gray-50);
}

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

.servicio-card {
    background: var(--white);
    padding: 40px 30px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.servicio-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient);
    transform: scaleX(0);
    transition: var(--transition);
}

.servicio-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
}

.servicio-card:hover::before {
    transform: scaleX(1);
}

.servicio-card.featured {
    background: var(--gradient);
    color: var(--white);
}

.servicio-card.featured::before {
    background: rgba(255, 255, 255, 0.3);
}

.servicio-badge {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.servicio-icon {
    width: 140px;
    height: 140px;
    margin-bottom: 24px;
}

.servicio-icon:has(video) {
    width: calc(100% + 60px);
    height: 180px;
    margin: -40px -30px 24px -30px;
    overflow: hidden;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.servicio-icon img,
.servicio-icon svg {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 8px;
}

.servicio-icon video {
    width: 100%;
    height: 260px;
    object-fit: cover;
    border-radius: 0;
    display: block;
    margin: -40px auto;
}

.servicio-card.featured .servicio-icon {
    color: var(--white);
}

.servicio-card h3 {
    font-size: 1.35rem;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-dark);
}

.servicio-card.featured h3 {
    color: var(--white);
}

.servicio-card p {
    color: var(--text-light);
    margin-bottom: 20px;
    line-height: 1.7;
}

.servicio-card.featured p {
    color: rgba(255, 255, 255, 0.9);
}

.servicio-features {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.servicio-features li {
    background: var(--gray-100);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    color: var(--text);
}

.servicio-card.featured .servicio-features li {
    background: rgba(255, 255, 255, 0.2);
    color: var(--white);
}

/* ================================
   Nosotros Section
================================ */
.nosotros {
    padding: 100px 0;
}

.nosotros-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.nosotros-text h2 {
    font-size: clamp(2rem, 4vw, 2.75rem);
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 24px;
}

.nosotros-text .highlight {
    color: var(--primary);
}

.nosotros-text .lead {
    font-size: 1.2rem;
    color: var(--text);
    margin-bottom: 16px;
    font-weight: 500;
}

.nosotros-text p {
    color: var(--text-light);
    margin-bottom: 32px;
}

.stats {
    display: flex;
    gap: 30px;
    margin-top: 40px;
}

.stat {
    text-align: center;
    background: var(--gray-50);
    padding: 30px 25px;
    border-radius: var(--radius-lg);
    flex: 1;
    position: relative;
    overflow: hidden;
    transition: var(--transition);
}

.stat::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient);
}

.stat:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.stat-number {
    display: inline-block;
    font-size: 3.5rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1;
}

.stat-suffix {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary);
    margin-left: -5px;
}

.stat-label {
    display: block;
    font-size: 0.95rem;
    color: var(--text);
    margin-top: 10px;
    font-weight: 500;
}

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

.image-frame {
    position: relative;
    padding: 20px;
}

.image-frame::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--gradient);
    border-radius: var(--radius-lg);
    transform: rotate(3deg);
    z-index: -1;
}

.image-placeholder {
    background: var(--white);
    border-radius: var(--radius);
    padding: 40px;
    box-shadow: var(--shadow-lg);
}

.image-placeholder img {
    max-width: 250px;
    margin: 0 auto;
}

/* ================================
   Por qué elegirnos Section
================================ */
.porque {
    padding: 100px 0;
    background: var(--gradient);
}

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

.porque-item {
    text-align: center;
    padding: 30px;
}

.porque-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 20px;
    color: var(--white);
}

.porque-icon svg {
    width: 100%;
    height: 100%;
}

.porque-item h4 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--white);
    margin-bottom: 12px;
}

.porque-item p {
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.95rem;
}

/* ================================
   Portafolio Section
================================ */
.portafolio {
    padding: 100px 0;
    background: var(--gray-50);
}

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

.proyecto-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.proyecto-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
}

.proyecto-image {
    position: relative;
    height: 220px;
    overflow: hidden;
}

.proyecto-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.proyecto-card:hover .proyecto-image img {
    transform: scale(1.1);
}

.proyecto-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, transparent 100%);
    display: flex;
    align-items: flex-end;
    padding: 20px;
}

.proyecto-category {
    background: var(--primary);
    color: var(--white);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.proyecto-info {
    padding: 24px;
}

.proyecto-info h4 {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.proyecto-info p {
    color: var(--text-light);
    font-size: 0.95rem;
}

/* ================================
   Contacto Section
================================ */
.contacto {
    padding: 100px 0;
}

.contacto-wrapper {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 60px;
    align-items: start;
}

.contacto-info h2 {
    font-size: clamp(2rem, 4vw, 2.5rem);
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 16px;
}

.contacto-info > p {
    color: var(--text-light);
    margin-bottom: 40px;
    font-size: 1.1rem;
}

.contacto-datos {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.contacto-item {
    display: flex;
    align-items: center;
    gap: 16px;
    color: var(--text);
}

.contacto-item svg {
    width: 24px;
    height: 24px;
    color: var(--primary);
    flex-shrink: 0;
}

.contacto-form-wrapper {
    background: var(--white);
    padding: 40px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

.contacto-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 16px 20px;
    font-size: 1rem;
    font-family: inherit;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    background: var(--gray-50);
    transition: var(--transition);
    color: var(--text-dark);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--white);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-light);
}

.form-group select {
    cursor: pointer;
    appearance: none;
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%2364748b"><path d="M7 10l5 5 5-5z"/></svg>');
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 24px;
}

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

.btn-full {
    width: 100%;
    background: var(--gradient);
    color: var(--white);
    padding: 16px;
    font-size: 1.05rem;
}

.btn-full:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* ================================
   Footer
================================ */
.footer {
    background: var(--gray-900);
    color: var(--white);
    padding: 80px 0 30px;
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 60px;
}

.footer-logo {
    height: 45px;
    width: auto;
    margin-bottom: 20px;
}

.footer-brand p {
    color: rgba(255, 255, 255, 0.7);
    max-width: 280px;
}

.footer h5 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 24px;
    color: var(--white);
}

.footer-links ul,
.footer-servicios ul {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.footer-links a,
.footer-servicios li {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.95rem;
    transition: var(--transition);
}

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

.social-links {
    display: flex;
    gap: 12px;
}

.social-links a {
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.social-links a:hover {
    background: var(--primary);
}

.social-links svg {
    width: 20px;
    height: 20px;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 30px;
    text-align: center;
}

.footer-bottom p {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.9rem;
}

/* ================================
   Responsive Design
================================ */
@media (max-width: 1024px) {
    .nosotros-content {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .nosotros-image {
        order: -1;
    }

    .contacto-wrapper {
        grid-template-columns: 1fr;
    }

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

@media (max-width: 768px) {
    .nav-toggle {
        display: flex;
        z-index: 1001;
    }

    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        max-width: 300px;
        height: 100vh;
        background: var(--white);
        flex-direction: column;
        justify-content: center;
        padding: 40px;
        gap: 30px;
        box-shadow: var(--shadow-xl);
        transition: var(--transition);
    }

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

    .nav-menu a {
        color: var(--text-dark);
        font-size: 1.2rem;
    }

    .nav-menu a::after {
        display: none;
    }

    .btn-nav {
        background: var(--gradient);
        color: var(--white) !important;
    }

    .nav-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }

    .nav-toggle.active span:nth-child(2) {
        opacity: 0;
    }

    .nav-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(5px, -5px);
    }

    .hero {
        min-height: auto;
        padding: 140px 20px 100px;
    }

    .hero-scroll {
        display: none;
    }

    .stats {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 15px;
    }

    .stat {
        flex: 1 1 calc(50% - 15px);
        min-width: 140px;
        padding: 20px 15px;
    }

    .stat-number {
        font-size: 2.5rem;
    }

    .stat-suffix {
        font-size: 1.8rem;
    }

    .stat-label {
        font-size: 0.85rem;
    }

    .servicios-grid,
    .portafolio-grid {
        grid-template-columns: 1fr;
    }

    .porque-grid {
        grid-template-columns: 1fr 1fr;
    }

    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .footer-brand p {
        margin: 0 auto;
    }

    .social-links {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .hero-buttons {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }

    .porque-grid {
        grid-template-columns: 1fr;
    }

    .contacto-form-wrapper {
        padding: 24px;
    }

    .section-header {
        margin-bottom: 40px;
    }

    .servicios,
    .nosotros,
    .porque,
    .portafolio,
    .contacto {
        padding: 70px 0;
    }
}

/* ================================
   ANIMATIONS & EFFECTS
================================ */

/* Floating Shapes in Hero */
.floating-shapes {
    position: absolute;
    inset: 0;
    overflow: hidden;
    z-index: 0;
    pointer-events: none;
}

.shape {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    animation: float 20s infinite ease-in-out;
}

.shape-1 {
    width: 300px;
    height: 300px;
    top: -100px;
    left: -100px;
    animation-delay: 0s;
}

.shape-2 {
    width: 200px;
    height: 200px;
    top: 50%;
    right: -50px;
    animation-delay: -5s;
}

.shape-3 {
    width: 150px;
    height: 150px;
    bottom: 20%;
    left: 10%;
    animation-delay: -10s;
}

.shape-4 {
    width: 100px;
    height: 100px;
    top: 30%;
    left: 30%;
    animation-delay: -15s;
}

.shape-5 {
    width: 250px;
    height: 250px;
    bottom: -100px;
    right: 20%;
    animation-delay: -7s;
}

@keyframes float {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg);
    }
    25% {
        transform: translate(20px, -30px) rotate(5deg);
    }
    50% {
        transform: translate(-10px, 20px) rotate(-5deg);
    }
    75% {
        transform: translate(30px, 10px) rotate(3deg);
    }
}

/* AOS - Animate on Scroll */
[data-aos] {
    opacity: 0;
    transition: opacity 0.6s ease, transform 0.6s ease;
}

[data-aos="fade-up"] {
    transform: translateY(40px);
}

[data-aos="fade-down"] {
    transform: translateY(-40px);
}

[data-aos="fade-left"] {
    transform: translateX(40px);
}

[data-aos="fade-right"] {
    transform: translateX(-40px);
}

[data-aos="zoom-in"] {
    transform: scale(0.9);
}

[data-aos="zoom-out"] {
    transform: scale(1.1);
}

[data-aos].aos-animate {
    opacity: 1;
    transform: translate(0) scale(1);
}

/* Text Reveal Animation */
.text-reveal {
    animation: textReveal 1s ease forwards;
}

@keyframes textReveal {
    from {
        opacity: 0;
        transform: translateY(30px);
        filter: blur(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
        filter: blur(0);
    }
}

/* Typing Effect */
.typing-text {
    display: inline;
    min-width: 10px;
}

.cursor {
    display: inline-block;
    color: #fbbf24;
    font-weight: 400;
    animation: blink 0.7s infinite;
    margin-left: 2px;
}

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

/* Cursor Glow Effect */
.cursor-glow {
    position: fixed;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(198, 40, 40, 0.15) 0%, transparent 70%);
    pointer-events: none;
    transform: translate(-50%, -50%);
    z-index: 9999;
    transition: opacity 0.3s ease;
    mix-blend-mode: screen;
}

/* Card Tilt Effect Enhancement */
.servicio-card,
.proyecto-card {
    transform-style: preserve-3d;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.servicio-card::after,
.proyecto-card::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.servicio-card:hover::after,
.proyecto-card:hover::after {
    opacity: 1;
}

/* Glassmorphism Effect */
.contacto-form-wrapper {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.navbar.scrolled {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

/* Stats Counter Animation */
.stat {
    position: relative;
}

.stat-number {
    display: inline-block;
    font-variant-numeric: tabular-nums;
}

.stat-suffix {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    margin-left: 2px;
}

/* Button Loading Animation */
.btn-loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.btn.success {
    background: #10b981 !important;
    color: white !important;
}

/* Form Focus Animation */
.form-group {
    position: relative;
}

.form-group.focused input,
.form-group.focused textarea,
.form-group.focused select {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(198, 40, 40, 0.1);
}

/* Image Frame Animation */
.image-frame {
    transition: transform 0.5s ease;
}

.image-frame:hover {
    transform: rotate(0deg) scale(1.02);
}

.image-frame::before {
    transition: transform 0.5s ease;
}

.image-frame:hover::before {
    transform: rotate(6deg);
}

/* Social Links Hover */
.social-links a {
    position: relative;
    overflow: hidden;
}

.social-links a::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--gradient);
    transform: scale(0);
    border-radius: 50%;
    transition: transform 0.3s ease;
    z-index: -1;
}

.social-links a:hover::before {
    transform: scale(1);
}

.social-links a:hover {
    background: transparent;
    transform: translateY(-3px);
}

/* Porque Item Hover */
.porque-item {
    transition: transform 0.3s ease;
    border-radius: var(--radius);
}

.porque-item:hover {
    transform: translateY(-10px);
    background: rgba(255, 255, 255, 0.05);
}

.porque-icon {
    transition: transform 0.3s ease;
}

.porque-item:hover .porque-icon {
    transform: scale(1.1) rotate(5deg);
}

/* Proyecto Card Overlay Animation */
.proyecto-overlay {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.proyecto-card:hover .proyecto-overlay {
    opacity: 1;
}

.proyecto-category {
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.proyecto-card:hover .proyecto-category {
    transform: translateY(0);
}

/* Nav Link Hover Effect */
.nav-menu li {
    position: relative;
}

.nav-menu a::before {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    width: 6px;
    height: 6px;
    background: var(--primary-light);
    border-radius: 50%;
    transform: translateX(-50%) scale(0);
    transition: transform 0.3s ease;
}

.nav-menu a:hover::before {
    transform: translateX(-50%) scale(1);
}

/* Servicio Badge Pulse */
.servicio-badge {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.4);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(255, 255, 255, 0);
    }
}

/* Smooth Section Transitions */
section {
    position: relative;
}

/* Hero Gradient Animation */
.hero-bg {
    background-size: 200% 200%;
    animation: gradientShift 15s ease infinite;
}

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

/* Scroll Indicator Enhanced */
.hero-scroll {
    animation: fadeInUp 1s ease 1s forwards;
    opacity: 0;
}

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

/* Button Ripple Effect */
.btn {
    position: relative;
    overflow: hidden;
}

.btn::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    background: radial-gradient(circle, rgba(255,255,255,0.3) 0%, transparent 70%);
    transform: scale(0);
    opacity: 0;
    transition: transform 0.5s ease, opacity 0.5s ease;
}

.btn:active::after {
    transform: scale(2);
    opacity: 1;
    transition: 0s;
}

/* Footer Link Underline Animation */
.footer-links a {
    position: relative;
    display: inline-block;
}

.footer-links a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--primary-light);
    transition: width 0.3s ease;
}

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

/* Contacto Item Hover */
.contacto-item {
    padding: 12px 16px;
    border-radius: var(--radius);
    transition: background 0.3s ease, transform 0.3s ease;
}

.contacto-item:hover {
    background: var(--gray-50);
    transform: translateX(10px);
}

/* Service Features Tag Hover */
.servicio-features li {
    transition: transform 0.2s ease, background 0.2s ease;
    cursor: default;
}

.servicio-features li:hover {
    transform: scale(1.05);
    background: var(--gray-200);
}

.servicio-card.featured .servicio-features li:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* ================================
   Partners Section - Infinite Slider
================================ */
.partners {
    padding: 80px 0;
    background: var(--white);
    overflow: hidden;
}

.partners-slider {
    width: 100%;
    overflow: hidden;
    padding: 20px 0;
    mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
    -webkit-mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
}

.partners-track {
    display: flex;
    gap: 40px;
    animation: scrollPartners 30s linear infinite;
    width: max-content;
}

.partners-track:hover {
    animation-play-state: paused;
}

@keyframes scrollPartners {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

.partner-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding: 10px 30px;
    transition: var(--transition);
}

.partner-logo:hover {
    transform: scale(1.08);
}

.partner-logo img {
    max-width: 540px;
    max-height: 270px;
    width: auto;
    height: auto;
    object-fit: contain;
    transition: var(--transition);
}

@media (max-width: 768px) {
    .partners-track {
        gap: 20px;
        animation-duration: 20s;
    }

    .partner-logo {
        padding: 10px 20px;
    }

    .partner-logo img {
        max-width: 300px;
        max-height: 150px;
    }
}

/* ================================
   Publicaciones Section
================================ */
.publicaciones {
    padding: 100px 0;
    background: var(--gray-50);
}

.publicaciones-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 40px;
}

.publicacion-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: row;
    transition: var(--transition);
}

.publicacion-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
}

.publicacion-image {
    flex: 0 0 200px;
    position: relative;
    overflow: hidden;
}

.publicacion-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.publicacion-card:hover .publicacion-image img {
    transform: scale(1.05);
}

.publicacion-content {
    padding: 30px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex: 1;
}

.publicacion-content h3 {
    font-size: 1.35rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 12px;
}

.publicacion-content p {
    color: var(--text-light);
    font-size: 0.95rem;
    line-height: 1.7;
    margin-bottom: 20px;
}

.publicacion-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.publicacion-actions .btn {
    padding: 10px 20px;
    font-size: 0.9rem;
}

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

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

.publicacion-actions .btn-primary {
    background: var(--gradient);
    color: var(--white);
}

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

    .publicacion-card {
        flex-direction: column;
    }

    .publicacion-image {
        flex: 0 0 250px;
        height: 250px;
    }

    .publicacion-content {
        padding: 24px;
    }
}

@media (max-width: 480px) {
    .publicacion-image {
        flex: 0 0 200px;
        height: 200px;
    }

    .publicacion-actions {
        flex-direction: column;
    }

    .publicacion-actions .btn {
        width: 100%;
    }
}

/* Reduce Motion for Accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .cursor-glow {
        display: none;
    }
}
