/* Variables */
:root {
    --color-bg: #fdfdfd;
    --color-text: #1a1a1a;
    --color-accent: #1E1E1E;
    --color-primary: #5C77FF;
    --color-gray: #757575;
    --color-light-gray: #f0f0f0;
    --font-primary: 'Outfit', sans-serif;
    --transition-smooth: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --border-radius: 0.25rem;
    /* ~4px basales, proporcional */
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-primary);
    background-color: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Header */
.header {
    position: fixed;
    top: 0;
    width: 100%;
    padding: 2rem 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
    transition: var(--transition-smooth);
    background-color: rgba(253, 253, 253, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid transparent;
}

.header.scrolled {
    padding: 1rem 5%;
    border-bottom: 1px solid var(--color-light-gray);
}

.main-logo {
    height: 40px;
    width: auto;
    object-fit: contain;
    transition: var(--transition-smooth);
    display: block;
}

.header.scrolled .main-logo {
    height: 32px;
}

.nav a {
    text-decoration: none;
    color: var(--color-text);
    margin-left: 2.5rem;
    font-weight: 500;
    font-size: 0.95rem;
    transition: var(--transition-smooth);
}

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

/* Hero Section */
.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    padding: 0 5%;
    position: relative;
}

.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('assets/hero_architecture.webp') no-repeat center center/cover;
    z-index: 1;
}

.hero-bg::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to right, rgba(245, 245, 245, 0.95) 0%, rgba(245, 245, 245, 0.2) 50%);
}

.hero-content {
    max-width: 800px;
    z-index: 10;
}

.hero-content h1 {
    font-size: 5rem;
    font-weight: 300;
    line-height: 1.1;
    margin-bottom: 1.5rem;
}

.hero-content h1 span {
    font-weight: 700;
}

.hero-content p {
    font-size: 1.25rem;
    color: var(--color-gray);
    margin-bottom: 3rem;
    max-width: 500px;
}

.cta-btn {
    display: inline-block;
    padding: 1rem 2.5rem;
    background-color: var(--color-primary);
    color: #fff;
    text-decoration: none;
    font-weight: 500;
    border-radius: var(--border-radius);
    transition: var(--transition-smooth);
}

.cta-btn:hover {
    background-color: #4A62D9;
    transform: translateY(-2px);
}

/* Clients Section */
.clients {
    padding: 4rem 5%;
    background-color: var(--color-bg);
    border-top: 1px solid var(--color-light-gray);
    border-bottom: 1px solid var(--color-light-gray);
}

.clients-container p {
    text-align: center;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--color-gray);
    letter-spacing: 2px;
    margin-bottom: 2rem;
    text-transform: uppercase;
}

.clients-logos {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 4rem;
    align-items: center;
}

.client-logo-img {
    height: 50px;
    width: auto;
    opacity: 1;
    transition: var(--transition-smooth);
    object-fit: contain;
}

.client-logo-img:hover {
    opacity: 0.6;
    filter: grayscale(100%);
}

/* Our Services Section */
.our-services {
    padding: 8rem 5%;
    background-color: var(--color-light-gray);
}

.services-wrapper {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
}

.srv-card {
    background: var(--color-bg);
    padding: 3rem 2rem;
    border-radius: var(--border-radius);
    transition: var(--transition-smooth);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.srv-card:hover {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    transform: translateY(-5px);
    border-color: var(--color-primary);
}

.srv-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--color-text);
}

.srv-card p {
    color: var(--color-gray);
    font-size: 0.95rem;
}

/* Portfolio Section */
.portfolio {
    padding: 8rem 5% 4rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
}

.section-header h2 {
    font-size: 2.5rem;
    font-weight: 300;
}

.projects-grid {
    display: flex;
    width: 100%;
    height: 75vh;
    /* Se elimina gap para evitar el salto de hover en los espacios vacíos */
}

.slide {
    flex: 1;
    min-width: 0;
    position: relative;
    border-radius: var(--border-radius);
    overflow: hidden;
    cursor: pointer;
    transition: all 0.6s cubic-bezier(0.25, 1, 0.5, 1);
    border-right: 0.5rem solid var(--color-bg);
}

.slide:last-child {
    border-right: none;
}

/* Default First-Child State */
.slide:first-child {
    flex: 5;
}

.slide:first-child img {
    transform: scale(1.02);
}

.slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

/* Reset on Grid Hover */
.projects-grid:hover .slide {
    flex: 1;
}

.projects-grid:hover .slide img {
    transform: scale(1);
}

/* Active Hover State */
.projects-grid:hover .slide:hover {
    flex: 5;
}

.projects-grid:hover .slide:hover img {
    transform: scale(1.02);
}

.slide-info {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 2.5rem 2rem 2rem;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent);
    color: #fff;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.4s ease;
}

.slide:first-child .slide-info {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    transition-delay: 0.2s;
}

.projects-grid:hover .slide .slide-info {
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition-delay: 0s;
}

.projects-grid:hover .slide:hover .slide-info {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    transition-delay: 0.2s;
}

.slide-info h3 {
    font-size: 1.8rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: #fff;
}

.slide-info p {
    font-size: 1rem;
    font-weight: 300;
    opacity: 0.8;
    color: #fff;
    margin-bottom: 1.5rem;
}

.view-more-btn {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    color: #fff;
    padding: 0.6rem 1.5rem;
    cursor: pointer;
    font-family: var(--font-primary);
    font-weight: 500;
    border-radius: var(--border-radius);
    transition: var(--transition-smooth);
}

.view-more-btn:hover {
    background: #fff;
    color: var(--color-primary);
    border-color: #fff;
}

/* About Us Section */
.about {
    padding: 8rem 5%;
    background-color: var(--color-light-gray);
}

.about-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
}

.about-text h2 {
    font-size: 3rem;
    font-weight: 300;
    margin-bottom: 2rem;
}

.about-text p {
    font-size: 1.1rem;
    color: var(--color-gray);
    margin-bottom: 1.5rem;
}

.about-stats {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 3rem;
}

.stat {
    display: flex;
    flex-direction: column;
}

.stat-number {
    font-size: 4rem;
    font-weight: 700;
    color: var(--color-accent);
    line-height: 1;
}

.stat-label {
    font-size: 1.1rem;
    color: var(--color-gray);
    font-weight: 500;
}

/* Methodology / Services */
.services {
    padding: 8rem 5%;
}

.methodology-compact {
    display: flex;
    justify-content: space-between;
    gap: 2rem;
}

.methodology-step {
    flex: 1;
    padding-top: 1.5rem;
    border-top: 2px solid var(--color-light-gray);
    position: relative;
    transition: var(--transition-smooth);
}

.methodology-step:hover {
    border-top-color: var(--color-primary);
    transform: translateY(-5px);
}

.m-step-num {
    position: absolute;
    top: -1.2rem;
    left: 0;
    background: var(--color-bg);
    padding-right: 1rem;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--color-primary);
}

.m-step-info h3 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.m-step-info p {
    font-size: 0.95rem;
    color: var(--color-gray);
}

/* Contact */
.contact {
    padding: 8rem 5%;
    background-color: var(--color-accent);
    color: #fff;
}

.contact-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
}

.contact-info h2 {
    font-size: 3.5rem;
    font-weight: 300;
    margin-bottom: 1rem;
}

.contact-info>p {
    font-size: 1.2rem;
    opacity: 0.8;
    margin-bottom: 3rem;
}

.info-block {
    margin-bottom: 2rem;
}

.info-block h4 {
    font-size: 1.1rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.info-block p {
    opacity: 0.7;
}

.social-links {
    margin-top: 3rem;
    display: flex;
    gap: 2rem;
}

.social-links a {
    color: #fff;
    text-decoration: none;
    font-weight: 500;
    opacity: 0.8;
    transition: var(--transition-smooth);
}

.social-links a:hover {
    opacity: 1;
}

/* Form Card */
.form-card {
    background: #fff;
    padding: 3rem 2.5rem;
    border-radius: var(--border-radius);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    color: var(--color-text);
}

.form-card h3 {
    font-size: 1.8rem;
    margin-bottom: 2rem;
    font-weight: 300;
}

.contact-form form {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.input-group {
    position: relative;
}

.input-group input,
.input-group textarea {
    width: 100%;
    background: transparent;
    border: none;
    border-bottom: 1px solid #ccc;
    padding: 10px 0;
    color: var(--color-text);
    font-family: var(--font-primary);
    font-size: 1.1rem;
    outline: none;
    transition: var(--transition-smooth);
}

.input-group input:focus,
.input-group textarea:focus {
    border-bottom-color: var(--color-primary);
}

.iti {
    width: 100%;
}

.iti__flag-container {
    padding-bottom: 5px;
}

.input-group label {
    position: absolute;
    top: 10px;
    left: 0;
    color: var(--color-gray);
    pointer-events: none;
    transition: var(--transition-smooth);
}

.input-group input:focus~label,
.input-group input:valid~label,
.input-group textarea:focus~label,
.input-group textarea:valid~label {
    top: -15px;
    font-size: 0.8rem;
    color: var(--color-primary);
}

.submit-btn {
    background: var(--color-primary);
    color: #fff;
    border: none;
    border-radius: var(--border-radius);
    padding: 1.2rem 2rem;
    font-family: var(--font-primary);
    font-weight: 500;
    font-size: 1.1rem;
    cursor: pointer;
    transition: var(--transition-smooth);
    align-self: flex-start;
    margin-top: 1rem;
    width: 100%;
}

.submit-btn:hover {
    background: #4A62D9;
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(92, 119, 255, 0.3);
}

.form-feedback {
    margin-top: 1rem;
    font-size: 0.9rem;
    opacity: 0.9;
}

/* Footer */
footer {
    background-color: var(--color-accent);
    color: rgba(255, 255, 255, 0.3);
    text-align: center;
    padding: 0 5% 3rem;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

/* Animations */
.fade-up {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: opacity, transform;
}

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

.delay-100 {
    transition-delay: 0.1s;
}

.delay-200 {
    transition-delay: 0.2s;
}

.delay-300 {
    transition-delay: 0.3s;
}

.delay-400 {
    transition-delay: 0.4s;
}

.delay-500 {
    transition-delay: 0.5s;
}

.delay-600 {
    transition-delay: 0.6s;
}

.delay-700 {
    transition-delay: 0.7s;
}

.delay-800 {
    transition-delay: 0.8s;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: var(--color-bg);
    z-index: 1000;
    display: flex;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

.modal.active {
    opacity: 1;
    pointer-events: all;
}

.close-btn {
    position: absolute;
    top: 2rem;
    right: 3rem;
    background: transparent;
    border: none;
    font-size: 3rem;
    color: var(--color-text);
    cursor: pointer;
    z-index: 1010;
    line-height: 1;
    transition: var(--transition-smooth);
}

.close-btn:hover {
    transform: scale(1.1);
}

.modal-content {
    display: flex;
    width: 100%;
    height: 100%;
}

.modal-gallery {
    position: relative;
    width: 65%;
    height: 100%;
    background: #000;
}

.modal-gallery img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery-controls {
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    transform: translateY(-50%);
    padding: 0 1rem;
    pointer-events: none;
}

.gallery-btn {
    pointer-events: all;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-smooth);
}

.gallery-btn:hover {
    background: #fff;
    color: #000;
}

.gallery-indicators {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 0.5rem;
}

.indicator {
    width: 8px;
    height: 8px;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.indicator.active {
    background: var(--color-primary);
    transform: scale(1.2);
}

.modal-details {
    width: 35%;
    padding: 6rem 4rem;
    overflow-y: auto;
}

.modal-details h2 {
    font-size: 3rem;
    font-weight: 300;
    margin-bottom: 2rem;
}

.modal-specs {
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--color-light-gray);
}

.modal-specs div {
    margin-bottom: 0.8rem;
    font-size: 1.1rem;
}

.modal-specs strong {
    font-weight: 500;
    margin-right: 0.5rem;
    color: var(--color-gray);
}

.modal-details p {
    font-size: 1.1rem;
    color: var(--color-gray);
    line-height: 1.8;
}

/* Responsive */
@media (max-width: 1024px) {
    .projects-grid {
        height: 60vh;
    }

    .about-container {
        grid-template-columns: 1fr;
    }

    .services-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .services-wrapper {
        grid-template-columns: repeat(2, 1fr);
    }

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

    .modal-content {
        flex-direction: column;
    }

    .modal-gallery {
        width: 100%;
        height: 50vh;
    }

    .modal-details {
        width: 100%;
        padding: 3rem;
    }
}

@media (max-width: 768px) {
    html {
        font-size: 14px;
    }

    .header {
        padding: 1rem 5%;
    }

    .nav {
        display: none;
    }

    .hero-content h1 {
        font-size: 3rem;
        margin-bottom: 1rem;
    }

    .hero-content p {
        font-size: 1rem;
        margin-bottom: 2rem;
    }

    .clients,
    .portfolio,
    .about,
    .services,
    .contact,
    .our-services {
        padding: 4rem 5%;
    }

    .clients-logos {
        gap: 1.5rem;
    }

    .client-logo-img {
        height: 40px;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .section-header h2 {
        font-size: 2rem;
    }

    .projects-grid {
        flex-direction: column;
        height: 120vh;
    }

    .slide {
        border-right: none;
        border-bottom: 0.5rem solid var(--color-bg);
    }

    .slide:last-child {
        border-bottom: none;
    }

    .slide-info h3 {
        font-size: 1.5rem;
    }

    .about-text h2,
    .services h2,
    .contact-info h2 {
        font-size: 2.2rem;
    }

    .about-stats {
        gap: 1.5rem;
        margin-top: 2rem;
    }

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

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

    .methodology-compact {
        flex-direction: column;
        gap: 3rem;
        margin-left: 1.2rem;
    }

    .methodology-step {
        padding-top: 0;
        padding-left: 2.5rem;
        border-top: none;
        border-left: 2px solid var(--color-light-gray);
    }

    .methodology-step:hover {
        border-left-color: var(--color-primary);
        border-top-color: transparent;
        transform: translateX(5px);
    }

    .m-step-num {
        top: -0.2rem;
        left: -1.2rem;
        width: 2.4rem;
        text-align: center;
        padding-right: 0;
        padding-bottom: 0.5rem;
    }

    .form-card {
        padding: 2rem 1.5rem;
    }

    .contact-container {
        gap: 2rem;
    }

    .contact-info>p {
        margin-bottom: 2rem;
    }

    .social-links {
        gap: 1rem;
        flex-wrap: wrap;
    }

    .modal-details {
        padding: 2rem;
    }

    .modal-details h2 {
        font-size: 1.8rem;
        margin-bottom: 1rem;
    }

    .close-btn {
        top: 1rem;
        right: 1rem;
        font-size: 2.5rem;
        color: #fff;
        background: rgba(0, 0, 0, 0.5);
        width: 40px;
        height: 40px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}