/* CSS Variables */
:root {
    --color-bg-primary: #FFFFFF;
    --color-bg-secondary: #F5F5F5;
    --color-primary-red: #EC1B23;
    --color-text-main: #333333;
    /* Dark Gray for main text */
    --color-text-light: #333333;
    /* Lighter gray for secondary text */
    --color-white: #FFFFFF;

    --font-heading: 'Roboto Slab', serif;
    /* Main headings and special titles */
    --font-body: 'Roboto Condensed', sans-serif;
    /* Body text, navigation and UI elements */

    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 2rem;
    --spacing-lg: 4rem;
    --spacing-xl: 6rem;
}

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


/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scroll {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
        /* Assumes duplicate content for seamless loop */
    }
}

/* Global Fixes */
html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background-color: var(--color-bg-primary);
    color: var(--color-text-main);
    line-height: 1.6;
    overflow-x: hidden;
    /* Fix horizontal scroll issue */
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
    width: 100%;
}


a {
    text-decoration: none;
    color: inherit;
}

/* Hero Section */
.hero-section {
    padding: var(--spacing-xl) 0;
    text-align: center;
    background-image: url('../images/Fondo.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    color: var(--color-white);
    /* Ensure contrast */
}

.hero-title {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 3rem;
    color: rgb(255, 255, 255);
    /* White text for contrast */
    margin-bottom: var(--spacing-sm);
    line-height: 1.2;
    animation: fadeInUp 1s ease-out;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1),
        0 4px 8px rgba(0, 0, 0, 0.1),
        0 8px 16px rgba(0, 0, 0, 0.1),
        0 16px 32px rgba(0, 0, 0, 0.1),
        0 32px 64px rgba(0, 0, 0, 0.1),
        0 64px 128px rgba(0, 0, 0, 0.1);

}

.hero-subtitle {
    font-size: 1.25rem;
    color: #555d5f;
    /* Lighter white/gray */
    margin-bottom: var(--spacing-md);
    font-weight: 700;
    animation: fadeInUp 1s ease-out 0.3s backwards;

}

/* Trust Bar (Marquee) */
.trust-bar {
    background-color: var(--color-bg-secondary);
    padding: var(--spacing-md) 0;
    text-align: center;
    /* border-top: 1px solid #eee; Removed */
    /* border-bottom: 1px solid #eee; Removed */
    overflow: hidden;
    /* Hide scrolling logos */
}

.logos-carousel {
    display: flex;
    overflow: hidden;
    white-space: nowrap;
    position: relative;
}

.logos-track {
    display: flex;
    gap: var(--spacing-lg);
    animation: scroll 40s linear infinite;
    /* Increased from 30s to 40s (30% slower) */
    width: max-content;
}

.logo-item {
    transition: filter 0.3s, opacity 0.3s;
    filter: grayscale(100%);
    opacity: 0.7;
    cursor: default;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    /* Prevent shrinking */
}

/* Resize logos to be slightly larger (25% increase) */
.logo-item img {
    height: 63px;
    width: auto;
    object-fit: contain;
}

.logo-item:hover {
    filter: grayscale(0%);
    opacity: 1;
}

/* Animation Utilities */
.fade-in {
    animation: fadeInUp 0.8s ease-out forwards;
    opacity: 0;
    /* Start hidden */
}

/* Footer Typography & Updates */
.footer-col p {
    color: #e0e0e0;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
    font-family: var(--font-body);
}

.footer-col strong {
    font-family: var(--font-heading);
}


/* Philosophy Section */
.philosophy-section {
    padding: var(--spacing-xl) 0;
    background-color: var(--color-bg-primary);
}

.grid-2-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-md);
}

.philosophy-card {
    background: var(--color-white);
    padding: var(--spacing-md);
    /* box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05); Removed */
    /* border-radius: 8px; Removed */
    text-align: left;
    border-left: 5px solid var(--color-primary-red);
}

.philosophy-title {
    color: var(--color-primary-red);
    font-size: 1.5rem;
    margin-bottom: var(--spacing-sm);
    text-transform: uppercase;
}

/* Services Section */
.services-section {
    padding: var(--spacing-xl) 0;
    background-color: var(--color-bg-primary);
    /* Or white, cards are red */
}

.grid-3-col {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-md);
}

.service-card {
    background-color: var(--color-primary-red);
    color: var(--color-white);
    padding: var(--spacing-md);
    border-radius: 12px;
    min-height: 300px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.3s;
    position: relative;
    overflow: hidden;
}

.service-card:hover {
    transform: translateY(-5px);
}

.card-top {
    display: flex;
    justify-content: flex-start;
}

.pill-button {
    background-color: var(--color-white);
    border-radius: 50px;
    padding: 0.5rem 1.5rem;
    display: inline-flex;
    align-items: center;
    color: var(--color-primary-red);
    font-weight: bold;
}

.pill-button .arrow {
    font-size: 1.2rem;
}

.card-content {
    margin-top: auto;
}

.service-title {
    font-family: var(--font-heading);
    font-size: 2.3rem;
    font-weight: 700;
    margin-bottom: var(--spacing-xs);
    line-height: 1.1;
}

.service-subtitle {
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    opacity: 0.9;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2rem;
    }

    .grid-2-col,
    .grid-3-col {
        grid-template-columns: 1fr;
    }

    .service-card {
        min-height: 300px;
    }

    .header-logo {
        height: 50px;
        /* Smaller logo for mobile but bigger than before */
    }

    .main-header .container {
        flex-direction: column;
        gap: 10px;
        padding-bottom: 10px;
    }

    .header-nav {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.8rem;
    }
}

/* Header */
/* Header */
/* Header */
.main-header {
    background-color: var(--color-primary-red);
    display: flex;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 10px 0;
}

.main-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.header-logo {
    height: 70px;
    width: auto;
    display: block;
}

.header-nav {
    display: flex;
    gap: var(--spacing-md);
    align-items: center;
}

.nav-link {
    color: var(--color-white);
    font-family: var(--font-heading);
    font-weight: 500;
    font-size: 0.95rem;
    transition: opacity 0.3s;
    position: relative;
    text-decoration: none;
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 2px;
    bottom: -4px;
    left: 0;
    background-color: var(--color-white);
    transform: scaleX(0);
    transform-origin: bottom right;
    transition: transform 0.3s ease-out;
}

.nav-link:hover::after {
    transform: scaleX(1);
    transform-origin: bottom left;
}

.nav-link:hover {
    opacity: 0.8;
}

.header-btn {
    background-color: var(--color-white);
    color: var(--color-primary-red);
    padding: 0.5rem 1.2rem;
    border-radius: 4px;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.9rem;
    text-transform: uppercase;
    transition: all 0.3s ease;
}

.header-btn:hover {
    background-color: #f0f0f0;
    transform: translateY(-2px);
}

/* About Section (Quiénes Somos) */
.about-section {
    padding: var(--spacing-xl) 0;
    background-color: var(--color-white);
}

.section-title {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 3rem;
    color: var(--color-text-main);
    margin-bottom: var(--spacing-md);
    text-align: center;
    position: relative;
    display: inline-block;
    /* To allow underlining if needed */
}

/* Red underline style for "Somos?" based on image analysis hint */
.section-title::after {
    content: '';
    display: block;
    width: 60%;
    height: 4px;
    background-color: var(--color-primary-red);
    margin: 0.5rem auto 0;
}

.about-content {
    max-width: 800px;
    margin: 0 auto;
    border-left: 5px solid var(--color-primary-red);
    padding-left: var(--spacing-md);
    text-align: left;
}

.about-content p {
    margin-bottom: var(--spacing-sm);
    font-size: 1.1rem;
    color: var(--color-text-light);
}

/* Footer */
.main-footer {
    background-color: #4a4a4a;
    /* Dark gray */
    color: var(--color-white);
    padding: var(--spacing-xl) 0 var(--spacing-sm);
    margin-top: var(--spacing-xl);
}

.footer-grid {
    align-items: flex-start;
    margin-bottom: var(--spacing-lg);
}

.footer-title {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.5rem;
    margin-bottom: var(--spacing-xs);
    color: var(--color-white);
}

/* Mix fonts for "Razón SOCIAL" styling if desired */
.footer-title strong,
.footer-title span {
    font-family: var(--font-heading);
    font-style: normal;
    text-transform: uppercase;
}

.footer-col p {
    color: #e0e0e0;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.footer-col a {
    color: var(--color-white);
    text-decoration: none;
    transition: color 0.3s;
}


.mt-4 {
    margin-top: 1.5rem;
}

/* Hero/Footer CTA Buttons */
.cta-container {
    margin-top: var(--spacing-md);
    display: inline-block;
    text-align: center;
}

.premium-btn {
    display: inline-block;
    background-color: var(--color-primary-red);
    color: var(--color-white);
    padding: 1rem 2.5rem;
    border-radius: 50px;
    font-family: var(--font-heading);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(236, 27, 35, 0.4);
    border: 2px solid transparent;
}

.premium-btn:hover {
    background-color: transparent;
    border-color: var(--color-white);
    /* White border on grey background */
    color: var(--color-white);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(236, 27, 35, 0.6);
}

.footer-bottom {
    border-top: 1px solid #666;
    padding-top: var(--spacing-sm);
    text-align: center;
    font-size: 0.9rem;
    color: #ccc;
}

/* Scroll Animations */
/* Scroll Animations */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out !important;
    will-change: opacity, transform;
}

.animate-on-scroll.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* --- Portfolio Specific Styles --- */

/* Portfolio Hero */
.page-hero {
    background-color: #F9F9F9;
    padding: var(--spacing-xl) 0;
    text-align: center;
}

.page-hero .hero-title {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 3.5rem;
    /* +3rem as requested */
    color: var(--color-text-main);
    margin-bottom: var(--spacing-sm);
    line-height: normal;
}

.page-hero .hero-subtitle {
    font-family: var(--font-body);
    font-size: 1.2rem;
    color: var(--color-text-light);
    max-width: 700px;
    margin: 0 auto var(--spacing-md);
    font-weight: 400;
}

/* Portfolio Grids */
.portfolio-section {
    padding: var(--spacing-xl) 0;
    background-color: var(--color-white);
}

.portfolio-grid {
    display: grid;
    gap: var(--spacing-md);
}

/* Grid Variants */
/* 1. Branding Grid: Clean, logo focus */
.portfolio-grid.grid-branding {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

/* 2. Marketing Grid: Cellphone aspect ratio */
.portfolio-grid.grid-marketing {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
}

/* 3. Web Grid: Large/Wide */
.portfolio-grid.grid-web {
    grid-template-columns: 1fr;
    /* Stack on mobile */
}

@media (min-width: 768px) {
    .portfolio-grid.grid-web {
        grid-template-columns: repeat(2, 1fr);
        /* 2 cols on tablet+ */
    }
}

/* 4. Applications Grid: Masonry-like (using standard grid for simplicity for now, customizable) */
.portfolio-grid.grid-applications {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

/* Portfolio Cards */
.portfolio-item {
    background: var(--color-white);
    border-radius: 8px;
    /* sutil radius */
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid #eee;
    /* Very subtle border */
}

/* Mockup specific: No border/shadow for mockups if preferred,
   but user asked for radius and soft shadow on hover.
   We will keep it consistent.
*/

.portfolio-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
    /* Sombra suave */
}

.portfolio-img-container {
    width: 100%;
    overflow: hidden;
    background-color: var(--color-white);
    /* Pure white background */
    display: flex;
    align-items: center;
    justify-content: center;
    /* Height can be auto or fixed depending on grid */
}

.portfolio-img-container img {
    width: 100%;
    height: auto;
    object-fit: cover;
    /* Default */
    display: block;
}

/* Specific image styling adjustments based on Mockups vs Logos */
.grid-branding .portfolio-img-container {
    padding: var(--spacing-md);
    /* Whitespace for logos */
    aspect-ratio: 1 / 1;
}

.grid-branding .portfolio-img-container img {
    object-fit: contain;
}

/* .grid-marketing .portfolio-img-container img {
    Portait/Phone mockups usually don't need padding if they are full device
} */

/* Portfolio Legend/Tags */
.portfolio-info {
    padding: var(--spacing-sm) var(--spacing-sm);
    text-align: center;
    background-color: var(--color-white);
}

.client-name {
    display: block;
    font-family: var(--font-body);
    font-weight: 700;
    text-transform: uppercase;
    color: var(--color-text-main);
    font-size: 0.95rem;
    margin-bottom: 0.2rem;
}

.project-type {
    display: block;
    font-family: var(--font-body);
    color: #999;
    /* Gris suave */
    font-size: 0.85rem;
}

/* Mockups - remove border if needed or requested, but keeping minimal border for consistency */
.portfolio-item.mockup {
    border: none;
}