@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;700;800&display=swap');

:root {
    --bg-primary: #121212;
    /* Deep Charcoal */
    --bg-secondary: #1a1a1a;
    /* Lighter Charcoal */
    --accent-gold: #c5a044;
    /* Updating gold to the energetic Orange used in the new hero */
    --accent-gold-glow: rgba(197, 160, 68, 0.4);
    --text-primary: #ffffff;
    --text-secondary: #cccccc;
    --glass-bg: rgba(255, 255, 255, 0.02);
    /* Very transparent */
    --glass-border: rgba(255, 255, 255, 0.08);
    /* Subtle transparent border */
    --transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
    max-width: 100vw;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: 'Outfit', sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
    max-width: 100vw;
}

h1,
h2,
h3,
h4 {
    font-weight: 700;
    letter-spacing: -0.02em;
}

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

ul {
    list-style: none;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Section Backgrounds with Geometric Patterns */
.bg-pattern {
    position: relative;
    overflow: hidden;
}

.bg-pattern::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: radial-gradient(circle at 2px 2px, rgba(255, 255, 255, 0.03) 1px, transparent 0);
    background-size: 40px 40px;
    pointer-events: none;
    z-index: 0;
}

/* Hero Section Specifics */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    background: transparent;
    position: relative;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.8rem 1.8rem;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    gap: 0.5rem;
    border: none;
    font-size: 1rem;
}

.btn-primary {
    background: var(--accent-gold);
    color: #1c1c1e;
    box-shadow: 0 4px 15px rgba(197, 160, 68, 0.2);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px var(--accent-gold-glow);
    background: #d4ac4b;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-3px);
    border-color: var(--accent-gold);
}

/* Selection */
::selection {
    background: var(--accent-gold);
    color: #1c1c1e;
}

/* Sections */
section {
    padding: 8rem 0;
    position: relative;
    z-index: 1;
}

.section-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(0, 21, 36, 0.92), rgba(0, 21, 36, 0.88));
    z-index: -1;
}

.section-tag {
    color: var(--accent-gold);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.2em;
    display: block;
    margin-bottom: 1rem;
    text-align: center;
}

.section-title {
    font-size: 2.5rem;
    margin-bottom: 4rem;
    text-align: center;
}

/* Glassmorphism */
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 2.5rem;
    transition: var(--transition);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
    /* Giving it depth */
}

.glass:hover {
    border-color: var(--accent-gold);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5);
    transform: translateY(-8px);
}

/* Portfolio Grid */
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2.5rem;
    width: 100%;
}



.portfolio-item {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    height: 550px;
    /* Vertical Rectangular aspect ratio for phone mocks */
    cursor: pointer;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
    background: #121212;
    /* Charcoal */
    display: flex;
    align-items: center;
    justify-content: center;
}

.portfolio-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.portfolio-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(18, 18, 18, 0.4), rgba(18, 18, 18, 0.95));
    backdrop-filter: blur(4px);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 2.5rem;
    opacity: 0;
    transition: var(--transition);
    border-radius: 20px;
}

.portfolio-overlay h3 {
    color: var(--accent-gold);
    font-size: 1.4rem;
    margin-bottom: 0.5rem;
    transform: translateY(20px);
    transition: var(--transition);
}

.portfolio-overlay p {
    color: #ffffff;
    font-size: 0.95rem;
    font-weight: 500;
    transform: translateY(20px);
    transition: var(--transition);
    transition-delay: 0.1s;
}

.portfolio-item:hover .portfolio-overlay {
    opacity: 1;
}

.portfolio-item:hover .portfolio-overlay h3,
.portfolio-item:hover .portfolio-overlay p {
    transform: translateY(0);
}

.portfolio-item:hover img {
    transform: scale(1.08);
    /* Zoom effect */
}

/* Reveal Animations */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: all 0.9s cubic-bezier(0.2, 1, 0.3, 1);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* Mobile Menu Toggle */
.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 6px;
    cursor: pointer;
    z-index: 1001;
}

.menu-toggle span {
    display: block;
    width: 25px;
    height: 2px;
    background: var(--text-primary);
    transition: var(--transition);
}

.mobile-menu-overlay {
    position: fixed;
    top: 0;
    right: -100%;
    width: 100%;
    height: 100vh;
    background: var(--bg-primary);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2.5rem;
    z-index: 999;
    /* Header has z-index 1000 so it sits on top */
    transition: var(--transition);
}

.mobile-menu-overlay.active {
    right: 0;
}

.mobile-menu-overlay a {
    font-size: 1.5rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-primary);
    letter-spacing: 0.1em;
}

/* Floating WhatsApp Link */
.whatsapp-float {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: #25d366;
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    box-shadow: 0 10px 25px rgba(37, 211, 102, 0.3);
    z-index: 1000;
    transition: var(--transition);
}

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

/* --- Client Logos Marquee --- */
.clients-section {
    background-color: var(--bg-primary);
    padding: 3rem 0;
    overflow: hidden;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.clients-marquee-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    padding: 0 5%;
}

.clients-marquee {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 3rem;
    width: 100%;
}

.client-logo-item {
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    filter: brightness(0) invert(1) opacity(0.6);
    transition: filter 0.3s ease, transform 0.3s ease;
}

.client-logo-item:hover {
    filter: brightness(0) invert(1) opacity(1);
    transform: scale(1.1);
}

.client-logo-item img {
    max-height: 50px;
    max-width: 140px;
    width: auto;
    object-fit: contain;
}

.client-logo-item.solid-bg {
    filter: none !important;
}

.client-logo-item.solid-bg img {
    filter: grayscale(1) invert(1) brightness(2);
    mix-blend-mode: screen;
    opacity: 0.6;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.client-logo-item.solid-bg:hover img {
    opacity: 1;
    transform: scale(1.1);
}

/* For sprite images */
.sprite-logo {
    width: 140px;
    height: 60px;
    background-image: url('images/clients/sprite.png');
    background-size: 400% 300%;
    background-repeat: no-repeat;
}

.sprite-logo-2 {
    width: 140px;
    height: 60px;
    background-image: url('images/clients/sprite2.png');
    background-size: 400% 300%;
    background-repeat: no-repeat;
    filter: none !important;
    mix-blend-mode: screen;
    opacity: 0.6;
    transition: filter 0.3s ease, transform 0.3s ease, opacity 0.3s ease;
}

.sprite-logo-2:hover {
    filter: none !important;
    opacity: 1;
    transform: scale(1.1);
}

/* Map the 12 logos on the 4x3 sprite grid */
.sprite-1 {
    background-position: 0% 0%;
}

.sprite-2 {
    background-position: 33.33% 0%;
}

.sprite-3 {
    background-position: 66.66% 0%;
}

.sprite-4 {
    background-position: 100% 0%;
}

.sprite-5 {
    background-position: 0% 50%;
}

.sprite-6 {
    background-position: 33.33% 50%;
}

.sprite-7 {
    background-position: 66.66% 50%;
}

.sprite-8 {
    background-position: 100% 50%;
}

.sprite-9 {
    background-position: 0% 100%;
}

.sprite-10 {
    background-position: 33.33% 100%;
}

.sprite-11 {
    background-position: 66.66% 100%;
}

.sprite-12 {
    background-position: 100% 100%;
}

/* Responsive */
@media (max-width: 992px) {
    .portfolio-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-auto-flow: row;
        overflow-x: visible;
        gap: 1.5rem;
    }

    .portfolio-item {
        height: 500px;
    }
}

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

    section {
        padding: 5rem 0;
    }

    .section-title {
        font-size: 2.2rem !important;
        text-align: center;
        margin-bottom: 3rem;
    }

    .section-tag {
        text-align: center;
        margin-bottom: 1.5rem;
    }

    /* Centering containers on mobile */
    .container {
        padding: 0 1.5rem;
        text-align: center;
        max-width: 100vw;
        box-sizing: border-box;
    }

    /* Hero Responsive */
    .hero {
        padding: 6rem 0 4rem;
        min-height: auto;
    }

    .hero .container>div {
        grid-template-columns: 1fr !important;
        gap: 3rem !important;
        text-align: center !important;
    }

    .hero h1 {
        font-size: 2.8rem !important;
        margin: 1rem 0 !important;
        text-align: center !important;
    }

    .hero p {
        margin: 0 auto 2.5rem !important;
        text-align: center !important;
    }

    .hero div[style*="justify-content: center"],
    .hero div[style*="display: flex"],
    .hero div[style*="flex-start"] {
        justify-content: center !important;
    }

    /* Problem Responsive */
    #problema {
        padding: 6rem 0 !important;
        text-align: center !important;
    }

    #problema .container>div {
        grid-template-columns: 1fr !important;
        gap: 3rem !important;
    }

    #problema div[style*="order: 2"],
    #problema div[style*="order: 1"] {
        order: unset !important;
    }

    #problema h2,
    #problema p,
    #problema .glass {
        text-align: center !important;
    }

    /* Process Responsive */
    #proceso {
        padding: 6rem 0 !important;
        text-align: center !important;
    }

    #proceso .container>div {
        grid-template-columns: 1fr !important;
        gap: 2rem !important;
    }

    #proceso h2 {
        font-size: 2.5rem !important;
        text-align: center !important;
    }

    /* Portfolio Grid */
    .portfolio-grid {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
        grid-auto-flow: row;
        overflow-x: visible;
        gap: 2rem;
    }

    .portfolio-item {
        height: 480px;
        /* Better for organic mobile scrolling */
    }

    nav {
        padding: 0.8rem 1.5rem !important;
        width: 95% !important;
    }

    .nav-links {
        display: none !important;
    }

    .menu-toggle {
        display: flex;
    }
}